Skip to content

Commit

Permalink
Remove masks_to_bounds from GraphicsLayer
Browse files Browse the repository at this point in the history
This is no longer used in layer list mode.

In layer list mode, cc::Layer's masks_to_bounds is only used in
Layer::SetBounds to call SetSubtreePropertyChanged, but this will
already be called when the associated clip changes.

Bug: 993936
Change-Id: I1d32a5d15b847588a4a6855871b680caea0cfbed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1956542
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#722777}
  • Loading branch information
progers authored and Commit Bot committed Dec 8, 2019
1 parent 3163477 commit 61b9004
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
1 change: 1 addition & 0 deletions cc/layers/layer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ SkColor Layer::SafeOpaqueBackgroundColor() const {

void Layer::SetMasksToBounds(bool masks_to_bounds) {
DCHECK(IsPropertyChangeAllowed());
DCHECK(!layer_tree_host_ || !layer_tree_host_->IsUsingLayerLists());
if (inputs_.masks_to_bounds == masks_to_bounds)
return;
inputs_.masks_to_bounds = masks_to_bounds;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,6 @@ void CompositedLayerMapping::UpdateOverflowControlsHostLayerGeometry(
owning_layer_.GetLayoutBox()->PixelSnappedBorderBoxRect(
owning_layer_.SubpixelAccumulation());
overflow_controls_host_layer_->SetSize(gfx::Size(border_box.Size()));
overflow_controls_host_layer_->SetMasksToBounds(true);
}

void CompositedLayerMapping::UpdateMaskLayerGeometry() {
Expand Down Expand Up @@ -1393,7 +1392,6 @@ bool CompositedLayerMapping::UpdateScrollingLayers(
CreateGraphicsLayer(CompositingReason::kLayerForScrollingContainer);
scrolling_layer_->SetDrawsContent(false);
scrolling_layer_->SetHitTestable(false);
scrolling_layer_->SetMasksToBounds(true);

// Inner layer which renders the content that scrolls.
scrolling_contents_layer_ =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,6 @@ void GraphicsLayer::SetSize(const gfx::Size& size) {
// Note that we don't resize m_contentsLayer. It's up the caller to do that.
}


bool GraphicsLayer::MasksToBounds() const {
return CcLayer()->masks_to_bounds();
}

void GraphicsLayer::SetMasksToBounds(bool masks_to_bounds) {
CcLayer()->SetMasksToBounds(masks_to_bounds);
}

void GraphicsLayer::SetDrawsContent(bool draws_content) {
// NOTE: This early-exit is only correct because we also properly call
// cc::Layer::SetIsDrawable() whenever |contents_layer_| is set to a new
Expand Down
3 changes: 0 additions & 3 deletions third_party/blink/renderer/platform/graphics/graphics_layer.h
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ class PLATFORM_EXPORT GraphicsLayer : public DisplayItemClient,

void SetRenderingContext(int id);

bool MasksToBounds() const;
void SetMasksToBounds(bool);

bool DrawsContent() const { return draws_content_; }
void SetDrawsContent(bool);

Expand Down

0 comments on commit 61b9004

Please sign in to comment.