Tiled drawing GraphicsLayer tree dumps should match non-tiled more closely

https://bugs.webkit.org/show_bug.cgi?id=122172

Reviewed by Anders Carlsson.

No new tests, but will be tested by all of the compositing tests after bug 121859 lands.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties):
Only dump drawsContent and backgroundColor if the client says we should.
Provide the ability to skip over a layer in the dump, making it appear as if that layer's
children are direct decendents of that layer's parent.

* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::shouldSkipLayerInDump): Added.
(WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer): Added.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldSkipLayerInDump):
Added. Always skip the root tile cache's flattening layer, as it is
uninteresting and does not exist in the non-tiled-drawing compositing case.

(WebCore::RenderLayerBacking::shouldDumpPropertyForLayer):
Don't dump drawsContent on the root tile cache.
Don't dump backgroundcolor on the root tile cache, unless it is non-white.
This may require some WebKit2-specific rebaselines, but they will occur later.

* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::layerTreeAsText):
If the root tile cache has no composited children, don't dump anything,
to match the traditional case where we drop out of compositing when
we have no reason to be compositing. Except, do dump the root tile cache's
layers if we're specifically being asked to dump tile caches.

* platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-body-layer-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-opacity-html-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-positioned-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-transformed-html-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-zoomed-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-html-background-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-non-propagated-body-background-expected.txt:
* platform/mac-wk2/tiled-drawing/sticky/sticky-layers-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-slow-scrolling-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-speculative-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-size-slow-zoomed-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt:
* platform/mac-wk2/tiled-drawing/use-tiled-drawing-expected.txt:
Rebaseline some tests given these changes.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@156749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ee4d8a7a
2013-10-01 Tim Horton <timothy_horton@apple.com>
Tiled drawing GraphicsLayer tree dumps should match non-tiled more closely
https://bugs.webkit.org/show_bug.cgi?id=122172
Reviewed by Anders Carlsson.
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-background-no-image-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-body-layer-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-opacity-html-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-positioned-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-transformed-html-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-body-background-zoomed-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-html-background-expected.txt:
* platform/mac-wk2/tiled-drawing/fixed-background/fixed-non-propagated-body-background-expected.txt:
* platform/mac-wk2/tiled-drawing/sticky/sticky-layers-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-after-scroll-speculative-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-scroll-to-bottom-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-slow-scrolling-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-coverage-speculative-expected.txt:
* platform/mac-wk2/tiled-drawing/tile-size-slow-zoomed-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-expected.txt:
* platform/mac-wk2/tiled-drawing/tiled-drawing-zoom-scrolled-expected.txt:
* platform/mac-wk2/tiled-drawing/use-tiled-drawing-expected.txt:
Rebaseline some tests given these changes.
2013-10-01 Joone Hur <joone.hur@intel.com>
Quirksmode: CSS1: WebKit fails dynamic :first-letter test
......@@ -4,15 +4,9 @@
(GraphicsLayer
(bounds 785.00 1700.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(tile cache coverage 0, 0 785 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -14,14 +14,9 @@
)
(GraphicsLayer
(bounds 785.00 1600.00)
(drawsContent 1)
(tile cache coverage 0, 0 785 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -14,14 +14,9 @@
)
(GraphicsLayer
(bounds 785.00 1700.00)
(drawsContent 1)
(tile cache coverage 0, 0 785 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -14,14 +14,9 @@
)
(GraphicsLayer
(bounds 785.00 1700.00)
(drawsContent 1)
(tile cache coverage 0, 0 785 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -14,14 +14,9 @@
)
(GraphicsLayer
(bounds 785.00 3700.00)
(drawsContent 1)
(tile cache coverage 0, 0 785 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -14,14 +14,9 @@
)
(GraphicsLayer
(bounds 795.00 1710.00)
(drawsContent 1)
(tile cache coverage 0, 0 795 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -16,14 +16,9 @@
)
(GraphicsLayer
(bounds 785.00 1700.00)
(drawsContent 1)
(tile cache coverage 0, 0 445 x 667)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 3)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -14,14 +14,9 @@
)
(GraphicsLayer
(bounds 785.00 1516.00)
(drawsContent 1)
(tile cache coverage 0, 0 785 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -4,15 +4,10 @@
(GraphicsLayer
(bounds 785.00 1700.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #C0C0C0)
(tile cache coverage 0, 0 785 x 1200)
(tile size 785 x 600)
(top left tile 0, 0 tiles grid 1 x 2)
(children 1
(GraphicsLayer
)
)
)
)
)
......
......@@ -5,48 +5,42 @@ Left sticky Right sticky Left % sticky Right % sticky Left and Right Left and Ri
(GraphicsLayer
(bounds 2008.00 585.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(children 1
(children 6
(GraphicsLayer
(children 6
(GraphicsLayer
(position 820.00 25.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 812.00 93.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 960.00 161.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 812.00 229.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 820.00 297.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 960.00 365.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
)
(position 820.00 25.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 812.00 93.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 960.00 161.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 812.00 229.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 820.00 297.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
(GraphicsLayer
(position 960.00 365.00)
(bounds 300.00 60.00)
(contentsOpaque 1)
(drawsContent 1)
)
)
)
......
......@@ -6,19 +6,11 @@
(GraphicsLayer
(bounds 785.00 5021.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(visible rect 0.00, 3000.00 785.00 x 600.00)
(contentsScale 1.00)
(tile cache coverage 0, 2560 785 x 1536)
(tile size 512 x 512)
(top left tile 0, 5 tiles grid 2 x 3)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.00)
)
)
)
)
)
......
......@@ -6,19 +6,11 @@
(GraphicsLayer
(bounds 785.00 5021.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(visible rect 0.00, 3000.00 785.00 x 600.00)
(contentsScale 1.00)
(tile cache coverage 0, 2048 785 x 2560)
(tile size 512 x 512)
(top left tile 0, 4 tiles grid 2 x 5)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.00)
)
)
)
)
)
......
......@@ -6,19 +6,11 @@
(GraphicsLayer
(bounds 785.00 5021.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(visible rect 0.00, 4421.00 785.00 x 600.00)
(contentsScale 1.00)
(tile cache coverage 0, 4096 785 x 925)
(tile size 512 x 512)
(top left tile 0, 8 tiles grid 2 x 2)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.00)
)
)
)
)
)
......
......@@ -6,19 +6,11 @@
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(visible rect 0.00, 0.00 800.00 x 600.00)
(contentsScale 1.00)
(tile cache coverage 0, 0 800 x 600)
(tile size 800 x 600)
(top left tile 0, 0 tiles grid 1 x 1)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.00)
)
)
)
)
)
......
......@@ -6,19 +6,11 @@
(GraphicsLayer
(bounds 785.00 5021.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(visible rect 0.00, 0.00 785.00 x 600.00)
(contentsScale 1.00)
(tile cache coverage 0, 0 785 x 2048)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 4)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.00)
)
)
)
)
)
......
......@@ -7,20 +7,12 @@
(anchor 0.00 0.00)
(bounds 785.00 585.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(transform [1.70 0.00 0.00 0.00] [0.00 1.70 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
(visible rect 0.00, 0.00 461.76 x 344.12)
(contentsScale 1.00)
(tile cache coverage 0, 0 461 x 344)
(tile size 785 x 585)
(top left tile 0, 0 tiles grid 1 x 1)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.70)
)
)
)
)
)
......
......@@ -8,19 +8,11 @@ document.body.scrollTop = 1000
(GraphicsLayer
(bounds 5008.00 5016.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(visible rect 1000.00, 1000.00 785.00 x 585.00)
(contentsScale 1.00)
(tile cache coverage 512, 0 2048 x 2560)
(tile size 512 x 512)
(top left tile 1, 0 tiles grid 4 x 5)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.00)
)
)
)
)
)
......
......@@ -7,20 +7,12 @@
(anchor 0.00 0.00)
(bounds 785.00 585.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(transform [2.30 0.00 0.00 0.00] [0.00 2.30 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
(visible rect 0.00, 0.00 341.30 x 254.35)
(contentsScale 1.00)
(tile cache coverage 0, 0 445 x 445)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 2.30)
)
)
)
)
)
......
......@@ -7,20 +7,12 @@
(anchor 0.00 0.00)
(bounds 1208.00 2021.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(transform [2.30 0.00 0.00 0.00] [0.00 2.30 0.00 0.00] [0.00 0.00 1.00 0.00] [0.00 0.00 0.00 1.00])
(visible rect 800.00, 1000.00 341.30 x 254.35)
(contentsScale 1.00)
(tile cache coverage 667, 890 540 x 445)
(tile size 512 x 512)
(top left tile 3, 4 tiles grid 3 x 2)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 2.30)
)
)
)
)
)
......
......@@ -6,19 +6,11 @@
(GraphicsLayer
(bounds 1208.00 2021.00)
(contentsOpaque 1)
(drawsContent 1)
(backgroundColor #FFFFFF)
(visible rect 0.00, 0.00 785.00 x 585.00)
(contentsScale 1.00)
(tile cache coverage 0, 0 1024 x 1024)
(tile size 512 x 512)
(top left tile 0, 0 tiles grid 2 x 2)
(children 1
(GraphicsLayer
(visible rect 0.00, 0.00 0.00 x 0.00)
(contentsScale 1.00)
)
)
)
)
)
......
2013-10-01 Tim Horton <timothy_horton@apple.com>
Tiled drawing GraphicsLayer tree dumps should match non-tiled more closely
https://bugs.webkit.org/show_bug.cgi?id=122172
Reviewed by Anders Carlsson.
No new tests, but will be tested by all of the compositing tests after bug 121859 lands.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::dumpProperties):
Only dump drawsContent and backgroundColor if the client says we should.
Provide the ability to skip over a layer in the dump, making it appear as if that layer's
children are direct decendents of that layer's parent.
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::shouldSkipLayerInDump): Added.
(WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer): Added.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldSkipLayerInDump):
Added. Always skip the root tile cache's flattening layer, as it is
uninteresting and does not exist in the non-tiled-drawing compositing case.
(WebCore::RenderLayerBacking::shouldDumpPropertyForLayer):
Don't dump drawsContent on the root tile cache.
Don't dump backgroundcolor on the root tile cache, unless it is non-white.
This may require some WebKit2-specific rebaselines, but they will occur later.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateBacking):
(WebCore::RenderLayerCompositor::layerTreeAsText):
If the root tile cache has no composited children, don't dump anything,
to match the traditional case where we drop out of compositing when
we have no reason to be compositing. Except, do dump the root tile cache's
layers if we're specifically being asked to dump tile caches.
2013-10-01 Joone Hur <joone.hur@intel.com>
Quirksmode: CSS1: WebKit fails dynamic :first-letter test
......@@ -629,7 +629,7 @@ void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBe
ts << "(preserves3D " << m_preserves3D << ")\n";
}
if (m_drawsContent) {
if (m_drawsContent && m_client->shouldDumpPropertyForLayer(this, "drawsContent")) {
writeIndent(ts, indent + 1);
ts << "(drawsContent " << m_drawsContent << ")\n";
}
......@@ -654,7 +654,7 @@ void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBe
ts << ")\n";
}
if (m_backgroundColor.isValid()) {
if (m_backgroundColor.isValid() && m_client->shouldDumpPropertyForLayer(this, "backgroundColor")) {
writeIndent(ts, indent + 1);
ts << "(backgroundColor " << m_backgroundColor.nameForRenderTreeAsText() << ")\n";
}
......@@ -744,14 +744,29 @@ void GraphicsLayer::dumpProperties(TextStream& ts, int indent, LayerTreeAsTextBe
dumpAdditionalProperties(ts, indent, behavior);
if (m_children.size()) {
writeIndent(ts, indent + 1);
ts << "(children " << m_children.size() << "\n";
unsigned i;
for (i = 0; i < m_children.size(); i++)
m_children[i]->dumpLayer(ts, indent + 2, behavior);
writeIndent(ts, indent + 1);
ts << ")\n";
TextStream childrenStream;
unsigned totalChildCount = m_children.size();
for (size_t childIndex = 0; childIndex < m_children.size(); childIndex++) {
GraphicsLayer* child = m_children[childIndex];
if (!m_client->shouldSkipLayerInDump(child)) {
child->dumpLayer(childrenStream, indent + 2, behavior);
continue;
}
const Vector<GraphicsLayer*>& grandChildren = child->children();
totalChildCount += grandChildren.size() - 1;
for (size_t grandChildIndex = 0; grandChildIndex < grandChildren.size(); grandChildIndex++)
grandChildren[grandChildIndex]->dumpLayer(childrenStream, indent + 2, behavior);
}
writeIndent(childrenStream, indent + 1);
childrenStream << ")\n";
if (totalChildCount) {
writeIndent(ts, indent + 1);
ts << "(children " << totalChildCount << "\n";
ts << childrenStream.release();
}
}
}
......
......@@ -90,6 +90,9 @@ public:
virtual bool isTrackingRepaints() const { return false; }
virtual bool shouldSkipLayerInDump(const GraphicsLayer*) const { return false; }
virtual bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char*) const { return true; }
#ifndef NDEBUG
// RenderLayerBacking overrides this to verify that it is not
// currently painting contents. An ASSERT fails, if it is.
......
......@@ -2089,6 +2089,28 @@ bool RenderLayerBacking::isTrackingRepaints() const
return static_cast<GraphicsLayerClient&>(compositor()).isTrackingRepaints();
}
bool RenderLayerBacking::shouldSkipLayerInDump(const GraphicsLayer* layer) const
{
// Skip the root tile cache's flattening layer.
return m_isMainFrameRenderViewLayer && layer && layer == m_childContainmentLayer.get();
}
bool RenderLayerBacking::shouldDumpPropertyForLayer(const GraphicsLayer* layer, const char* propertyName) const
{
// For backwards compatibility with WebKit1 and other platforms,
// skip some properties on the root tile cache.
if (m_isMainFrameRenderViewLayer && layer == m_graphicsLayer.get()) {
if (!strcmp(propertyName, "drawsContent"))
return false;
// Background color could be of interest to tests or other dumpers if it's non-white.
if (!strcmp(propertyName, "backgroundColor") && layer->backgroundColor() == Color::white)
return false;
}
return true;
}
#ifndef NDEBUG
void RenderLayerBacking::verifyNotPainting()
{
......
......@@ -170,6 +170,8 @@ public:
virtual bool getCurrentTransform(const GraphicsLayer*, TransformationMatrix&) const OVERRIDE;
virtual bool isTrackingRepaints() const OVERRIDE;
virtual bool shouldSkipLayerInDump(const GraphicsLayer*) const OVERRIDE;
virtual bool shouldDumpPropertyForLayer(const GraphicsLayer*, const char* propertyName) const OVERRIDE;
#ifndef NDEBUG