Commit 494f7a59 authored by chrishtr@chromium.org's avatar chrishtr@chromium.org

Only allocate a foreground layer for a CLM if there are composited negative-z-index-children.

Otherwise, those children can be rendered as pat of the software rendering of the current
layer and its non-compositing descendants.

BUG=

Review URL: https://codereview.chromium.org/535553002

git-svn-id: svn://svn.chromium.org/blink/trunk@181424 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 86201b19
...@@ -11,13 +11,7 @@ ...@@ -11,13 +11,7 @@
{ {
"transformOrigin": [50, 50], "transformOrigin": [50, 50],
"bounds": [500, 250], "bounds": [500, 250],
"drawsContent": true, "drawsContent": true
"children": [
{
"bounds": [500, 250],
"drawsContent": true
}
]
}, },
{ {
"children": [ "children": [
...@@ -25,13 +19,7 @@ ...@@ -25,13 +19,7 @@
"position": [0, 250], "position": [0, 250],
"transformOrigin": [50, 50], "transformOrigin": [50, 50],
"bounds": [150, 150], "bounds": [150, 150],
"drawsContent": true, "drawsContent": true
"children": [
{
"bounds": [150, 150],
"drawsContent": true
}
]
}, },
{ {
"bounds": [792, 100], "bounds": [792, 100],
......
...@@ -12,13 +12,7 @@ ...@@ -12,13 +12,7 @@
"transformOrigin": [-10, -10], "transformOrigin": [-10, -10],
"bounds": [50, 50], "bounds": [50, 50],
"contentsOpaque": true, "contentsOpaque": true,
"drawsContent": true, "drawsContent": true
"children": [
{
"bounds": [50, 50],
"drawsContent": true
}
]
} }
] ]
} }
......
...@@ -15,13 +15,7 @@ ...@@ -15,13 +15,7 @@
"bounds": [160, 90], "bounds": [160, 90],
"contentsOpaque": true, "contentsOpaque": true,
"drawsContent": true, "drawsContent": true,
"backgroundColor": "#FF0000", "backgroundColor": "#FF0000"
"children": [
{
"bounds": [160, 90],
"drawsContent": true
}
]
}, },
{ {
"bounds": [800, 600], "bounds": [800, 600],
......
...@@ -753,11 +753,13 @@ bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer ...@@ -753,11 +753,13 @@ bool RenderLayerCompositor::clipsCompositingDescendants(const RenderLayer* layer
return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOverflowClip(); return layer->hasCompositingDescendant() && layer->renderer()->hasClipOrOverflowClip();
} }
// If an element has negative z-index children, those children render in front of the // If an element has composited negative z-index children, those children render in front of the
// layer background, so we need an extra 'contents' layer for the foreground of the layer // layer background, so we need an extra 'contents' layer for the foreground of the layer
// object. // object.
bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* layer) const bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* layer) const
{ {
if (!layer->hasCompositingDescendant())
return false;
return layer->stackingNode()->hasNegativeZOrderList(); return layer->stackingNode()->hasNegativeZOrderList();
} }
......
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