Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index b10112afd144ff73c2d6f3d69809053b17af46eb..da2e3ee84efa8ec095535f526d120e28b2445938 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -47,6 +47,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), |
@@ -125,7 +127,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() || |
+ !uses_default_blend_mode())) |
layer_tree_host_->set_needs_filter_context(); |
} |
@@ -505,6 +508,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) |
@@ -832,6 +851,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()); |