Chromium Code Reviews| Index: ui/compositor/layer.cc |
| diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
| index ae2085fe7b641e10f509d2f52c43980d5cf2d38a..dbf55d14e365c539c986a61cf8eee51fc1296681 100644 |
| --- a/ui/compositor/layer.cc |
| +++ b/ui/compositor/layer.cc |
| @@ -52,6 +52,7 @@ Layer::Layer() |
| fills_bounds_opaquely_(true), |
| layer_updated_externally_(false), |
| opacity_(1.0f), |
| + invert_(false), |
| delegate_(NULL), |
| scale_canvas_(true), |
| device_scale_factor_(1.0f) { |
| @@ -205,6 +206,19 @@ void Layer::SetBackgroundBlur(int blur_radius) |
| background_blur_radius_ = blur_radius; |
| } |
| +void Layer::SetInvert(bool invert) |
| +{ |
|
sky
2012/05/16 21:07:48
{ on previous line
Zachary Kuznia
2012/05/17 08:25:25
Done.
|
| + WebKit::WebFilterOperations filters; |
| + if (invert) { |
| + filters.append(WebKit::WebBasicComponentTransferFilterOperation( |
| + WebKit::WebBasicComponentTransferFilterOperation:: |
| + BasicComponentTransferFilterTypeInvert, 1.0)); |
| + } |
| + web_layer_.setFilters(filters); |
| + |
| + invert_ = invert; |
| +} |
| + |
| float Layer::GetTargetOpacity() const { |
| if (animator_.get() && animator_->IsAnimatingProperty( |
| LayerAnimationElement::OPACITY)) |