Chromium Code Reviews| Index: cc/layers/layer_impl.cc |
| diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc |
| index 99f950293ce7da829a371f41af2a36cff9eba440..16ba7e1442c51d8a5eb0f0c517b920fa8b9316a4 100644 |
| --- a/cc/layers/layer_impl.cc |
| +++ b/cc/layers/layer_impl.cc |
| @@ -53,6 +53,8 @@ LayerImpl::LayerImpl(LayerTreeImpl* tree_impl, int id) |
| masks_to_bounds_(false), |
| contents_opaque_(false), |
| opacity_(1.0), |
| + blend_mode_(SkXfermode::kSrcOver_Mode), |
| + is_root_for_isolated_group_(false), |
| preserves_3d_(false), |
| use_parent_backface_visibility_(false), |
| draw_checkerboard_for_missing_tiles_(false), |
| @@ -246,7 +248,8 @@ scoped_ptr<SharedQuadState> LayerImpl::CreateSharedQuadState() const { |
| draw_properties_.visible_content_rect, |
| draw_properties_.clip_rect, |
| draw_properties_.is_clipped, |
| - draw_properties_.opacity); |
| + draw_properties_.opacity, |
| + blend_mode_); |
| return state.Pass(); |
| } |
| @@ -524,6 +527,8 @@ void LayerImpl::PushPropertiesTo(LayerImpl* layer) { |
| layer->SetTouchEventHandlerRegion(touch_event_handler_region_); |
| layer->SetContentsOpaque(contents_opaque_); |
| layer->SetOpacity(opacity_); |
| + layer->SetBlendMode(blend_mode_); |
| + layer->SetIsRootForIsolatedGroup(is_root_for_isolated_group_); |
| layer->SetPosition(position_); |
| layer->SetIsContainerForFixedPositionLayers( |
| is_container_for_fixed_position_layers_); |
| @@ -880,6 +885,24 @@ bool LayerImpl::OpacityIsAnimatingOnImplOnly() const { |
| return opacity_animation && opacity_animation->is_impl_only(); |
| } |
| +void LayerImpl::SetBlendMode(SkXfermode::Mode blend_mode) { |
| + if (blend_mode_ == blend_mode) |
| + return; |
| + |
| + blend_mode_ = blend_mode; |
| + NoteLayerPropertyChangedForSubtree(); |
| +} |
| + |
| +void LayerImpl::SetIsRootForIsolatedGroup(bool root) { |
| + if (is_root_for_isolated_group_ == root) |
| + return; |
| + |
| + is_root_for_isolated_group_ = root; |
| + // Specifying the root for an isolated group does not affect the current |
| + // layer; it affects only children. |
| + NoteLayerPropertyChangedForDescendants(); |
|
rosca
2013/11/21 13:04:46
enne: could you please take another look at this c
enne (OOO)
2013/11/21 18:15:59
Hmm, on second thought this should be removed. Ma
|
| +} |
| + |
| void LayerImpl::SetPosition(gfx::PointF position) { |
| if (position_ == position) |
| return; |
| @@ -1281,6 +1304,9 @@ CompositingReasonsAsValue(CompositingReasons reasons) { |
| if (reasons & kCompositingReasonOutOfFlowClipping) |
| reason_list->AppendString("Has clipping ancestor"); |
| + if (reasons & kCompositingReasonIsolateCompositedDescendants) |
| + reason_list->AppendString("Should isolate composited descendants"); |
| + |
| return reason_list.PassAs<base::Value>(); |
| } |