mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Using the equality operator in PaintContext. Pay attention this
is a change on behavior as we previously didn't test for alpha channel.
This commit is contained in:
parent
3088b8fc30
commit
7a36634963
1 changed files with 3 additions and 5 deletions
|
@ -729,9 +729,8 @@ impl<'a> PaintContext<'a> {
|
||||||
};
|
};
|
||||||
|
|
||||||
let mut lighter_color;
|
let mut lighter_color;
|
||||||
let mut darker_color = color::black();;
|
let mut darker_color = color::black();
|
||||||
// TODO(Savago): Use equality operators when we sync with rust-azure.
|
if color != darker_color {
|
||||||
if color.r != darker_color.r || color.g != darker_color.g || color.b != darker_color.b {
|
|
||||||
darker_color = self.scale_color(color, if is_groove { 1.0/3.0 } else { 2.0/3.0 });
|
darker_color = self.scale_color(color, if is_groove { 1.0/3.0 } else { 2.0/3.0 });
|
||||||
lighter_color = color;
|
lighter_color = color;
|
||||||
} else {
|
} else {
|
||||||
|
@ -775,8 +774,7 @@ impl<'a> PaintContext<'a> {
|
||||||
|
|
||||||
// You can't scale black color (i.e. 'scaled = 0 * scale', equals black).
|
// You can't scale black color (i.e. 'scaled = 0 * scale', equals black).
|
||||||
let mut scaled_color = color::black();
|
let mut scaled_color = color::black();
|
||||||
// TODO(Savago): Use equality operators when we sync with rust-azure.
|
if color != scaled_color {
|
||||||
if color.r != scaled_color.r || color.g != scaled_color.g || color.b != scaled_color.b {
|
|
||||||
scaled_color = match direction {
|
scaled_color = match direction {
|
||||||
Direction::Top | Direction::Left => {
|
Direction::Top | Direction::Left => {
|
||||||
self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 })
|
self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 })
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue