diff options
author | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-02-03 18:51:50 -0800 |
---|---|---|
committer | Adenilson Cavalcanti <cavalcantii@gmail.com> | 2015-02-03 18:51:50 -0800 |
commit | 7a366349635e5b818b1c6ab3268775a2f645c23f (patch) | |
tree | dec609fb22fa09e4c90ab60ec9a47622d5ac233b | |
parent | 3088b8fc30b700117ec3e96b88651b887947ad93 (diff) | |
download | servo-7a366349635e5b818b1c6ab3268775a2f645c23f.tar.gz servo-7a366349635e5b818b1c6ab3268775a2f645c23f.zip |
Using the equality operator in PaintContext. Pay attention this
is a change on behavior as we previously didn't test for alpha
channel.
-rw-r--r-- | components/gfx/paint_context.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index 77b0effb037..64495418ffe 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -729,9 +729,8 @@ impl<'a> PaintContext<'a> { }; let mut lighter_color; - let mut darker_color = color::black();; - // TODO(Savago): Use equality operators when we sync with rust-azure. - if color.r != darker_color.r || color.g != darker_color.g || color.b != darker_color.b { + let mut darker_color = color::black(); + if color != darker_color { darker_color = self.scale_color(color, if is_groove { 1.0/3.0 } else { 2.0/3.0 }); lighter_color = color; } else { @@ -775,8 +774,7 @@ impl<'a> PaintContext<'a> { // You can't scale black color (i.e. 'scaled = 0 * scale', equals black). let mut scaled_color = color::black(); - // TODO(Savago): Use equality operators when we sync with rust-azure. - if color.r != scaled_color.r || color.g != scaled_color.g || color.b != scaled_color.b { + if color != scaled_color { scaled_color = match direction { Direction::Top | Direction::Left => { self.scale_color(color, if is_inset { 2.0/3.0 } else { 1.0 }) |