Chromium Code Reviews| Index: cc/layers/layer.cc |
| diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
| index 15de22340069d2ca2622db4f13b00f81338ade75..4a61721e14fe24af250980f7d90f8ea5092b3b18 100644 |
| --- a/cc/layers/layer.cc |
| +++ b/cc/layers/layer.cc |
| @@ -45,6 +45,8 @@ Layer::Layer() |
| background_color_(0), |
| compositing_reasons_(kCompositingReasonUnknown), |
| opacity_(1.f), |
| + blend_mode_(SkXfermode::kSrcOver_Mode), |
| + is_root_for_isolated_group_(false), |
| anchor_point_z_(0.f), |
| is_container_for_fixed_position_layers_(false), |
| is_drawable_(false), |
| @@ -123,7 +125,8 @@ void Layer::SetLayerTreeHost(LayerTreeHost* host) { |
| if (host && layer_animation_controller_->has_any_animation()) |
| host->SetNeedsCommit(); |
| - if (host && (!filters_.IsEmpty() || !background_filters_.IsEmpty())) |
| + if (host && (!filters_.IsEmpty() || !background_filters_.IsEmpty() || |
|
enne (OOO)
2013/11/01 18:49:02
Can you combine all these conditions in a single "
rosca
2013/11/04 17:14:34
Done.
|
| + !uses_default_blend_mode())) |
| layer_tree_host_->set_needs_filter_context(); |
| } |
| @@ -503,6 +506,22 @@ bool Layer::OpacityCanAnimateOnImplThread() const { |
| return false; |
| } |
| +void Layer::SetBlendMode(SkXfermode::Mode blend_mode) { |
| + if (blend_mode_ == blend_mode) |
| + return; |
| + blend_mode_ = blend_mode; |
| + SetNeedsCommit(); |
| + if (!uses_default_blend_mode() && layer_tree_host_) |
| + layer_tree_host_->set_needs_filter_context(); |
| +} |
| + |
| +void Layer::SetIsRootForIsolatedGroup(bool root) { |
| + if (is_root_for_isolated_group_ == root) |
| + return; |
| + is_root_for_isolated_group_ = root; |
| + SetNeedsCommit(); |
| +} |
| + |
| void Layer::SetContentsOpaque(bool opaque) { |
| DCHECK(IsPropertyChangeAllowed()); |
| if (contents_opaque_ == opaque) |
| @@ -820,6 +839,8 @@ void Layer::PushPropertiesTo(LayerImpl* layer) { |
| if (!layer->OpacityIsAnimatingOnImplOnly() && !OpacityIsAnimating()) |
| layer->SetOpacity(opacity_); |
| DCHECK(!(OpacityIsAnimating() && layer->OpacityIsAnimatingOnImplOnly())); |
| + layer->SetBlendMode(blend_mode_); |
| + layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); |
| layer->SetPosition(position_); |
| layer->SetIsContainerForFixedPositionLayers( |
| IsContainerForFixedPositionLayers()); |