Title: [173181] trunk
- Revision
- 173181
- Author
- [email protected]
- Date
- 2014-09-02 11:30:06 -0700 (Tue, 02 Sep 2014)
Log Message
Non-composited child RenderLayers cause allocation of unncessary backing store
https://bugs.webkit.org/show_bug.cgi?id=136375
Reviewed by David Hyatt.
Source/WebCore:
A composited element that has non-composited descendant elements that fall into
RenderLayers was getting backing store when none was required. descendentLayerPaintsIntoAncestor()
was simply checking the "visibility:visible" bit on descendant non-composited layers,
instead of actually asking them if they have any visual content.
Added a couple of FIXME comments.
Test: compositing/backing/child-layer-no-backing.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::descendentLayerPaintsIntoAncestor):
LayoutTests:
Test with a composited div with various configurations of non-composited child layers.
* compositing/backing/child-layer-no-backing-expected.txt: Added.
* compositing/backing/child-layer-no-backing.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (173180 => 173181)
--- trunk/LayoutTests/ChangeLog 2014-09-02 18:25:32 UTC (rev 173180)
+++ trunk/LayoutTests/ChangeLog 2014-09-02 18:30:06 UTC (rev 173181)
@@ -1,3 +1,15 @@
+2014-09-02 Simon Fraser <[email protected]>
+
+ Non-composited child RenderLayers cause allocation of unncessary backing store
+ https://bugs.webkit.org/show_bug.cgi?id=136375
+
+ Reviewed by David Hyatt.
+
+ Test with a composited div with various configurations of non-composited child layers.
+
+ * compositing/backing/child-layer-no-backing-expected.txt: Added.
+ * compositing/backing/child-layer-no-backing.html: Added.
+
2014-09-02 Michael Saboff <[email protected]>
Out of bounds write in vmEntryToJavaScript / JSC::JITCode::execute
Added: trunk/LayoutTests/compositing/backing/child-layer-no-backing-expected.txt (0 => 173181)
--- trunk/LayoutTests/compositing/backing/child-layer-no-backing-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/backing/child-layer-no-backing-expected.txt 2014-09-02 18:30:06 UTC (rev 173181)
@@ -0,0 +1,38 @@
+Grandchild content
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 785.00 1091.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 785.00 1091.00)
+ (contentsOpaque 1)
+ (children 5
+ (GraphicsLayer
+ (position 18.00 10.00)
+ (bounds 200.00 200.00)
+ )
+ (GraphicsLayer
+ (position 18.00 220.00)
+ (bounds 200.00 200.00)
+ )
+ (GraphicsLayer
+ (position 18.00 430.00)
+ (bounds 200.00 200.00)
+ )
+ (GraphicsLayer
+ (position 18.00 640.00)
+ (anchor 0.50 0.46)
+ (bounds 200.00 218.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 18.00 850.00)
+ (anchor 0.50 0.50)
+ (bounds 202.00 202.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/compositing/backing/child-layer-no-backing.html (0 => 173181)
--- trunk/LayoutTests/compositing/backing/child-layer-no-backing.html (rev 0)
+++ trunk/LayoutTests/compositing/backing/child-layer-no-backing.html 2014-09-02 18:30:06 UTC (rev 173181)
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .container {
+ height: 200px;
+ width: 200px;
+ margin: 10px;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+
+ .child {
+ position: relative;
+ height: 100%;
+ width: 100%;
+ }
+ </style>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function dumpLayers()
+ {
+ var layersResult = document.getElementById('layers');
+ if (window.testRunner)
+ layersResult.innerText = window.internals.layerTreeAsText(document);
+ }
+
+ window.addEventListener('load', dumpLayers, false)
+ </script>
+</head>
+<body>
+ <div class="composited container">
+ <div class="child">
+ </div>
+ </div>
+
+ <div class="composited container">
+ <div class="child">
+ <div class="child">
+ </div>
+ </div>
+ </div>
+
+ <div class="composited container">
+ <div class="child" style="visibility:hidden">
+ Child content
+ </div>
+ </div>
+
+ <div class="composited container">
+ <div class="child" style="visibility:hidden">
+ Child content
+ <div class="child" style="visibility:visible">
+ Grandchild content
+ </div>
+ </div>
+ </div>
+
+ <div class="composited container">
+ <div class="child" style="visibility:hidden">
+ <div class="child" style="visibility:visible; border: 1px solid black">
+ </div>
+ </div>
+ </div>
+
+<pre id="layers">Layer tree goes here in DRT</pre>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (173180 => 173181)
--- trunk/Source/WebCore/ChangeLog 2014-09-02 18:25:32 UTC (rev 173180)
+++ trunk/Source/WebCore/ChangeLog 2014-09-02 18:30:06 UTC (rev 173181)
@@ -1,3 +1,24 @@
+2014-09-02 Simon Fraser <[email protected]>
+
+ Non-composited child RenderLayers cause allocation of unncessary backing store
+ https://bugs.webkit.org/show_bug.cgi?id=136375
+
+ Reviewed by David Hyatt.
+
+ A composited element that has non-composited descendant elements that fall into
+ RenderLayers was getting backing store when none was required. descendentLayerPaintsIntoAncestor()
+ was simply checking the "visibility:visible" bit on descendant non-composited layers,
+ instead of actually asking them if they have any visual content.
+
+ Added a couple of FIXME comments.
+
+ Test: compositing/backing/child-layer-no-backing.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateClipRects):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::descendentLayerPaintsIntoAncestor):
+
2014-09-02 Commit Queue <[email protected]>
Unreviewed, rolling out r173175.
@@ -580,7 +601,7 @@
2014-08-29 Csaba Osztrogonác <[email protected]>
- Unreviwed, remove empty directories.
+ Unreviewed, remove empty directories.
* Modules/networkinfo: Removed.
* inspector/front-end: Removed.
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (173180 => 173181)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-09-02 18:25:32 UTC (rev 173180)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-09-02 18:30:06 UTC (rev 173181)
@@ -6319,6 +6319,7 @@
if (hasVisibleContent() && hasNonEmptyChildRenderers())
return true;
+ // FIXME: a visibility:hidden replaced element should return false here.
if (renderer().isReplaced() || renderer().hasMask())
return true;
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (173180 => 173181)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-09-02 18:25:32 UTC (rev 173180)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-09-02 18:30:06 UTC (rev 173181)
@@ -1503,6 +1503,7 @@
return finalOpacity;
}
+// FIXME: Code is duplicated in RenderLayer. Also, we should probably not consider filters a box decoration here.
static inline bool hasBoxDecorations(const RenderStyle& style)
{
return style.hasBorder() || style.hasBorderRadius() || style.hasOutline() || style.hasAppearance() || style.boxShadow() || style.hasFilter();
@@ -1754,7 +1755,7 @@
for (size_t i = 0; i < listSize; ++i) {
RenderLayer* curLayer = normalFlowList->at(i);
if (!compositedWithOwnBackingStore(curLayer)
- && (curLayer->hasVisibleContent() || descendentLayerPaintsIntoAncestor(*curLayer)))
+ && (curLayer->isVisuallyNonEmpty() || descendentLayerPaintsIntoAncestor(*curLayer)))
return true;
}
}
@@ -1769,7 +1770,7 @@
for (size_t i = 0; i < listSize; ++i) {
RenderLayer* curLayer = negZOrderList->at(i);
if (!compositedWithOwnBackingStore(curLayer)
- && (curLayer->hasVisibleContent() || descendentLayerPaintsIntoAncestor(*curLayer)))
+ && (curLayer->isVisuallyNonEmpty() || descendentLayerPaintsIntoAncestor(*curLayer)))
return true;
}
}
@@ -1779,7 +1780,7 @@
for (size_t i = 0; i < listSize; ++i) {
RenderLayer* curLayer = posZOrderList->at(i);
if (!compositedWithOwnBackingStore(curLayer)
- && (curLayer->hasVisibleContent() || descendentLayerPaintsIntoAncestor(*curLayer)))
+ && (curLayer->isVisuallyNonEmpty() || descendentLayerPaintsIntoAncestor(*curLayer)))
return true;
}
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes