Commit 7fac2ba3 authored by Philip Rogers's avatar Philip Rogers Committed by Commit Bot

Remove is_root_for_isolated_group from cc::Layer

Now that BlinkGenPropertyTrees has launched, there is no need to track
is_root_for_isolated_group on cc::Layer as it is now tracked using
render surface reasons.

Bug: 993936
Change-Id: Ifa5b0b497392d8cb4020826139a6270c2faaf20e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1815610
Commit-Queue: Philip Rogers <pdr@chromium.org>
Reviewed-by: default avatarXianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#698552}
parent 89a5f6e6
...@@ -94,7 +94,6 @@ Layer::Inputs::Inputs(int layer_id) ...@@ -94,7 +94,6 @@ Layer::Inputs::Inputs(int layer_id)
opacity(1.f), opacity(1.f),
blend_mode(SkBlendMode::kSrcOver), blend_mode(SkBlendMode::kSrcOver),
masks_to_bounds(false), masks_to_bounds(false),
is_root_for_isolated_group(false),
hit_testable(false), hit_testable(false),
contents_opaque(false), contents_opaque(false),
is_drawable(false), is_drawable(false),
...@@ -781,15 +780,6 @@ void Layer::SetBlendMode(SkBlendMode blend_mode) { ...@@ -781,15 +780,6 @@ void Layer::SetBlendMode(SkBlendMode blend_mode) {
SetPropertyTreesNeedRebuild(); SetPropertyTreesNeedRebuild();
} }
void Layer::SetIsRootForIsolatedGroup(bool root) {
DCHECK(IsPropertyChangeAllowed());
if (inputs_.is_root_for_isolated_group == root)
return;
inputs_.is_root_for_isolated_group = root;
SetPropertyTreesNeedRebuild();
SetNeedsCommit();
}
void Layer::SetHitTestable(bool should_hit_test) { void Layer::SetHitTestable(bool should_hit_test) {
DCHECK(IsPropertyChangeAllowed()); DCHECK(IsPropertyChangeAllowed());
if (inputs_.hit_testable == should_hit_test) if (inputs_.hit_testable == should_hit_test)
......
...@@ -258,15 +258,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> { ...@@ -258,15 +258,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
void SetBlendMode(SkBlendMode blend_mode); void SetBlendMode(SkBlendMode blend_mode);
SkBlendMode blend_mode() const { return inputs_.blend_mode; } SkBlendMode blend_mode() const { return inputs_.blend_mode; }
// A layer is root for an isolated group when it and all its descendants are
// drawn over a black and fully transparent background, creating an isolated
// group. It should be used along with SetBlendMode(), in order to restrict
// layers within the group to blend with layers outside this group.
void SetIsRootForIsolatedGroup(bool root);
bool is_root_for_isolated_group() const {
return inputs_.is_root_for_isolated_group;
}
// Set or get the list of filter effects to be applied to the contents of the // Set or get the list of filter effects to be applied to the contents of the
// layer and its subtree (together as a single composited entity) when // layer and its subtree (together as a single composited entity) when
// drawing them into their target. // drawing them into their target.
...@@ -861,8 +852,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> { ...@@ -861,8 +852,6 @@ class CC_EXPORT Layer : public base::RefCounted<Layer> {
bool masks_to_bounds : 1; bool masks_to_bounds : 1;
bool is_root_for_isolated_group : 1;
// Hit testing depends on this bit. // Hit testing depends on this bit.
bool hit_testable : 1; bool hit_testable : 1;
......
...@@ -941,7 +941,6 @@ TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) { ...@@ -941,7 +941,6 @@ TEST_F(LayerTest, CheckPropertyChangeCausesCorrectBehavior) {
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsFastRoundedCorner(true)); EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsFastRoundedCorner(true));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetOpacity(0.5f)); EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetOpacity(0.5f));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetBlendMode(SkBlendMode::kHue)); EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetBlendMode(SkBlendMode::kHue));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetIsRootForIsolatedGroup(true));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetContentsOpaque(true)); EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetContentsOpaque(true));
EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetPosition(gfx::PointF(4.f, 9.f))); EXPECT_SET_NEEDS_COMMIT(1, test_layer->SetPosition(gfx::PointF(4.f, 9.f)));
// We can use any layer pointer here since we aren't syncing for real. // We can use any layer pointer here since we aren't syncing for real.
......
...@@ -122,8 +122,6 @@ const char* RenderSurfaceReasonToString(RenderSurfaceReason reason) { ...@@ -122,8 +122,6 @@ const char* RenderSurfaceReasonToString(RenderSurfaceReason reason) {
return "clip axis alignment"; return "clip axis alignment";
case RenderSurfaceReason::kMask: case RenderSurfaceReason::kMask:
return "mask"; return "mask";
case RenderSurfaceReason::kRootOrIsolatedGroup:
return "root or isolated group";
case RenderSurfaceReason::kTrilinearFiltering: case RenderSurfaceReason::kTrilinearFiltering:
return "trilinear filtering"; return "trilinear filtering";
case RenderSurfaceReason::kCache: case RenderSurfaceReason::kCache:
......
...@@ -37,7 +37,6 @@ enum class RenderSurfaceReason : uint8_t { ...@@ -37,7 +37,6 @@ enum class RenderSurfaceReason : uint8_t {
kClipPath, kClipPath,
kClipAxisAlignment, kClipAxisAlignment,
kMask, kMask,
kRootOrIsolatedGroup,
kTrilinearFiltering, kTrilinearFiltering,
kCache, kCache,
kCopyRequest, kCopyRequest,
......
...@@ -223,7 +223,7 @@ class LayerTreeHostBlendingPixelTest ...@@ -223,7 +223,7 @@ class LayerTreeHostBlendingPixelTest
scoped_refptr<Layer> background = scoped_refptr<Layer> background =
CreateColorfulBackdropLayer(kRootWidth, kRootHeight); CreateColorfulBackdropLayer(kRootWidth, kRootHeight);
background->SetIsRootForIsolatedGroup(true); background->SetForceRenderSurfaceForTesting(true);
root->AddChild(background); root->AddChild(background);
CreateBlendingColorLayers(kRootWidth, kRootHeight, background.get(), flags); CreateBlendingColorLayers(kRootWidth, kRootHeight, background.get(), flags);
...@@ -351,7 +351,7 @@ TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithTransparent) { ...@@ -351,7 +351,7 @@ TEST_P(LayerTreeHostBlendingPixelTest, BlendingWithTransparent) {
CreateSolidColorLayer(gfx::Rect(kRootWidth, kRootHeight), kCSSOrange); CreateSolidColorLayer(gfx::Rect(kRootWidth, kRootHeight), kCSSOrange);
root->AddChild(background); root->AddChild(background);
background->SetIsRootForIsolatedGroup(true); background->SetForceRenderSurfaceForTesting(true);
// Orange child layers will blend with the green background // Orange child layers will blend with the green background
gfx::Rect child_rect(kRootWidth, kRootHeight); gfx::Rect child_rect(kRootWidth, kRootHeight);
......
...@@ -833,7 +833,6 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, PixelAlignedNoop) { ...@@ -833,7 +833,6 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, PixelAlignedNoop) {
mask_isolation->SetPosition(gfx::PointF(20, 20)); mask_isolation->SetPosition(gfx::PointF(20, 20));
mask_isolation->SetBounds(gfx::Size(350, 250)); mask_isolation->SetBounds(gfx::Size(350, 250));
mask_isolation->SetMasksToBounds(true); mask_isolation->SetMasksToBounds(true);
mask_isolation->SetIsRootForIsolatedGroup(true);
root->AddChild(mask_isolation); root->AddChild(mask_isolation);
scoped_refptr<Layer> content = scoped_refptr<Layer> content =
...@@ -858,7 +857,7 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, PixelAlignedClippedCircle) { ...@@ -858,7 +857,7 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, PixelAlignedClippedCircle) {
mask_isolation->SetPosition(gfx::PointF(20, 20)); mask_isolation->SetPosition(gfx::PointF(20, 20));
mask_isolation->SetBounds(gfx::Size(350, 250)); mask_isolation->SetBounds(gfx::Size(350, 250));
mask_isolation->SetMasksToBounds(true); mask_isolation->SetMasksToBounds(true);
mask_isolation->SetIsRootForIsolatedGroup(true); mask_isolation->SetForceRenderSurfaceForTesting(true);
root->AddChild(mask_isolation); root->AddChild(mask_isolation);
scoped_refptr<Layer> content = scoped_refptr<Layer> content =
...@@ -895,7 +894,7 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, ...@@ -895,7 +894,7 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest,
mask_isolation->SetPosition(gfx::PointF(20, 20)); mask_isolation->SetPosition(gfx::PointF(20, 20));
mask_isolation->SetBounds(gfx::Size(350, 250)); mask_isolation->SetBounds(gfx::Size(350, 250));
mask_isolation->SetMasksToBounds(true); mask_isolation->SetMasksToBounds(true);
mask_isolation->SetIsRootForIsolatedGroup(true); mask_isolation->SetForceRenderSurfaceForTesting(true);
root->AddChild(mask_isolation); root->AddChild(mask_isolation);
scoped_refptr<Layer> content = scoped_refptr<Layer> content =
...@@ -936,7 +935,6 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, RotatedClippedCircle) { ...@@ -936,7 +935,6 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, RotatedClippedCircle) {
} }
mask_isolation->SetBounds(gfx::Size(350, 250)); mask_isolation->SetBounds(gfx::Size(350, 250));
mask_isolation->SetMasksToBounds(true); mask_isolation->SetMasksToBounds(true);
mask_isolation->SetIsRootForIsolatedGroup(true);
root->AddChild(mask_isolation); root->AddChild(mask_isolation);
scoped_refptr<Layer> content = scoped_refptr<Layer> content =
...@@ -983,7 +981,6 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, RotatedClippedCircleUnderflow) { ...@@ -983,7 +981,6 @@ TEST_P(LayerTreeHostMaskAsBlendingPixelTest, RotatedClippedCircleUnderflow) {
} }
mask_isolation->SetBounds(gfx::Size(350, 250)); mask_isolation->SetBounds(gfx::Size(350, 250));
mask_isolation->SetMasksToBounds(true); mask_isolation->SetMasksToBounds(true);
mask_isolation->SetIsRootForIsolatedGroup(true);
root->AddChild(mask_isolation); root->AddChild(mask_isolation);
scoped_refptr<Layer> content = scoped_refptr<Layer> content =
......
...@@ -418,14 +418,6 @@ RenderSurfaceReason ComputeRenderSurfaceReason(const MutatorHost& mutator_host, ...@@ -418,14 +418,6 @@ RenderSurfaceReason ComputeRenderSurfaceReason(const MutatorHost& mutator_host,
DCHECK(!is_root); DCHECK(!is_root);
return RenderSurfaceReason::kOpacity; return RenderSurfaceReason::kOpacity;
} }
// If the layer has isolation.
// TODO(rosca): to be optimized - create separate rendering surface only when
// the blending descendants might have access to the content behind this layer
// (layer has transparent background or descendants overflow).
// https://code.google.com/p/chromium/issues/detail?id=301738
if (layer->is_root_for_isolated_group()) {
return RenderSurfaceReason::kRootOrIsolatedGroup;
}
// If we force it. // If we force it.
if (layer->force_render_surface_for_testing()) if (layer->force_render_surface_for_testing())
......
...@@ -249,7 +249,6 @@ void CompositedLayerMapping::CreatePrimaryGraphicsLayer() { ...@@ -249,7 +249,6 @@ void CompositedLayerMapping::CreatePrimaryGraphicsLayer() {
UpdateOpacity(GetLayoutObject().StyleRef()); UpdateOpacity(GetLayoutObject().StyleRef());
UpdateTransform(GetLayoutObject().StyleRef()); UpdateTransform(GetLayoutObject().StyleRef());
UpdateLayerBlendMode(GetLayoutObject().StyleRef()); UpdateLayerBlendMode(GetLayoutObject().StyleRef());
UpdateIsRootForIsolatedGroup();
} }
void CompositedLayerMapping::DestroyGraphicsLayers() { void CompositedLayerMapping::DestroyGraphicsLayers() {
...@@ -289,16 +288,6 @@ void CompositedLayerMapping::UpdateLayerBlendMode(const ComputedStyle& style) { ...@@ -289,16 +288,6 @@ void CompositedLayerMapping::UpdateLayerBlendMode(const ComputedStyle& style) {
SetBlendMode(style.GetBlendMode()); SetBlendMode(style.GetBlendMode());
} }
void CompositedLayerMapping::UpdateIsRootForIsolatedGroup() {
bool isolate = owning_layer_.ShouldIsolateCompositedDescendants();
// non stacking context layers should never isolate
DCHECK(owning_layer_.GetLayoutObject().StyleRef().IsStackingContext() ||
!isolate);
graphics_layer_->SetIsRootForIsolatedGroup(isolate);
}
void CompositedLayerMapping::UpdateBackgroundPaintsOntoScrollingContentsLayer( void CompositedLayerMapping::UpdateBackgroundPaintsOntoScrollingContentsLayer(
bool& invalidate_graphics_layer, bool& invalidate_graphics_layer,
bool& invalidate_scrolling_contents_layer) { bool& invalidate_scrolling_contents_layer) {
...@@ -898,7 +887,6 @@ void CompositedLayerMapping::UpdateGraphicsLayerGeometry( ...@@ -898,7 +887,6 @@ void CompositedLayerMapping::UpdateGraphicsLayerGeometry(
owning_layer_.GetScrollableArea()->PositionOverflowControls(); owning_layer_.GetScrollableArea()->PositionOverflowControls();
UpdateLayerBlendMode(GetLayoutObject().StyleRef()); UpdateLayerBlendMode(GetLayoutObject().StyleRef());
UpdateIsRootForIsolatedGroup();
UpdateContentsRect(); UpdateContentsRect();
UpdateBackgroundColor(); UpdateBackgroundColor();
......
...@@ -394,7 +394,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient { ...@@ -394,7 +394,6 @@ class CORE_EXPORT CompositedLayerMapping final : public GraphicsLayerClient {
void UpdateOpacity(const ComputedStyle&); void UpdateOpacity(const ComputedStyle&);
void UpdateTransform(const ComputedStyle&); void UpdateTransform(const ComputedStyle&);
void UpdateLayerBlendMode(const ComputedStyle&); void UpdateLayerBlendMode(const ComputedStyle&);
void UpdateIsRootForIsolatedGroup();
// Return the opacity value that this layer should use for compositing. // Return the opacity value that this layer should use for compositing.
float CompositingOpacity(float layout_object_opacity) const; float CompositingOpacity(float layout_object_opacity) const;
......
...@@ -101,9 +101,6 @@ std::unique_ptr<JSONObject> GraphicsLayerAsJSON( ...@@ -101,9 +101,6 @@ std::unique_ptr<JSONObject> GraphicsLayerAsJSON(
layer->GetBlendMode())); layer->GetBlendMode()));
} }
if (layer->IsRootForIsolatedGroup())
json->SetBoolean("isolate", true);
if (layer->ContentsOpaque()) if (layer->ContentsOpaque())
json->SetBoolean("contentsOpaque", true); json->SetBoolean("contentsOpaque", true);
......
...@@ -701,14 +701,6 @@ BlendMode GraphicsLayer::GetBlendMode() const { ...@@ -701,14 +701,6 @@ BlendMode GraphicsLayer::GetBlendMode() const {
return BlendModeFromSkBlendMode(CcLayer()->blend_mode()); return BlendModeFromSkBlendMode(CcLayer()->blend_mode());
} }
bool GraphicsLayer::IsRootForIsolatedGroup() const {
return CcLayer()->is_root_for_isolated_group();
}
void GraphicsLayer::SetIsRootForIsolatedGroup(bool isolated) {
CcLayer()->SetIsRootForIsolatedGroup(isolated);
}
void GraphicsLayer::SetHitTestable(bool should_hit_test) { void GraphicsLayer::SetHitTestable(bool should_hit_test) {
if (hit_testable_ == should_hit_test) if (hit_testable_ == should_hit_test)
return; return;
......
...@@ -174,8 +174,6 @@ class PLATFORM_EXPORT GraphicsLayer : public cc::LayerClient, ...@@ -174,8 +174,6 @@ class PLATFORM_EXPORT GraphicsLayer : public cc::LayerClient,
BlendMode GetBlendMode() const; BlendMode GetBlendMode() const;
void SetBlendMode(BlendMode); void SetBlendMode(BlendMode);
bool IsRootForIsolatedGroup() const;
void SetIsRootForIsolatedGroup(bool);
void SetHitTestable(bool); void SetHitTestable(bool);
bool GetHitTestable() const { return hit_testable_; } bool GetHitTestable() const { return hit_testable_; }
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
"name": "LayoutBlockFlow (positioned) DIV class='stacking-context'", "name": "LayoutBlockFlow (positioned) DIV class='stacking-context'",
"position": [8, 8], "position": [8, 8],
"bounds": [160, 90], "bounds": [160, 90],
"isolate": true,
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#008000" "backgroundColor": "#008000"
}, },
......
...@@ -33,7 +33,6 @@ ...@@ -33,7 +33,6 @@
"name": "LayoutBlockFlow (positioned) DIV class='stacking-context'", "name": "LayoutBlockFlow (positioned) DIV class='stacking-context'",
"position": [8, 8], "position": [8, 8],
"bounds": [160, 90], "bounds": [160, 90],
"isolate": true,
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#008000" "backgroundColor": "#008000"
}, },
...@@ -59,7 +58,6 @@ ...@@ -59,7 +58,6 @@
{ {
"name": "LayoutBlockFlow (positioned) DIV class='stacking-context'", "name": "LayoutBlockFlow (positioned) DIV class='stacking-context'",
"bounds": [160, 90], "bounds": [160, 90],
"isolate": true,
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#008000", "backgroundColor": "#008000",
"transform": 2 "transform": 2
......
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
"name": "LayoutBlockFlow (positioned) DIV class='stacking-context'", "name": "LayoutBlockFlow (positioned) DIV class='stacking-context'",
"position": [8, 8], "position": [8, 8],
"bounds": [160, 90], "bounds": [160, 90],
"isolate": true,
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#008000" "backgroundColor": "#008000"
}, },
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
{ {
"name": "LayoutBlockFlow DIV class='accelerated-stacking-context'", "name": "LayoutBlockFlow DIV class='accelerated-stacking-context'",
"bounds": [784, 90], "bounds": [784, 90],
"isolate": true,
"contentsOpaque": true, "contentsOpaque": true,
"backgroundColor": "#0000FF", "backgroundColor": "#0000FF",
"transform": 1 "transform": 1
......
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
}, },
{ {
"name": "LayoutBlockFlow HTML", "name": "LayoutBlockFlow HTML",
"bounds": [800, 69], "bounds": [800, 69]
"isolate": true
}, },
{ {
"name": "LayoutBlockFlow DIV", "name": "LayoutBlockFlow DIV",
......
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
}, },
{ {
"name": "LayoutBlockFlow HTML", "name": "LayoutBlockFlow HTML",
"bounds": [800, 70], "bounds": [800, 70]
"isolate": true
}, },
{ {
"name": "LayoutBlockFlow DIV", "name": "LayoutBlockFlow DIV",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment