compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 00:28:48 +0000 (00:28 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Aug 2013 00:28:48 +0000 (00:28 +0000)
commiteb0d7520a21b8604258b13cc1b854abf51bfaad0
tree863c4556f91561c5c403d5abc250fc84aeeaa0a2
parent4908389d40024ebe2b113559f8460106899363d1
compositing/geometry/bounds-ignores-hidden-dynamic.html has incorrect initial rendering
https://bugs.webkit.org/show_bug.cgi?id=119825

Source/WebCore:

Reviewed by Tim Horton.

r137526 and some earlier commits attempted to avoid unconditionally
repainting layers when their size changes, because this was causing
TiledBacking layers to repaint when the document size changed.

However, the approach required that we have good information about
whether size changes require a repaint, which in some cases is hard
to determine, especially when RenderLayer changes affect our
decisions about which layers are composited.

Fix by pushing the decision about whether to repaint on size change
into GraphicsLayer. The default is to repaint on size change,
but GraphicsLayer provides a function that can be overridden to
modify this behavior; GraphicsLayerCA does so to avoid repaints
when layers with TiledBackings get resized.

Test: compositing/repaint/repaint-on-layer-grouping-change.html

* WebCore.exp.in: WebKit2 needs GraphicsLayer::setSize, which is no longer inline.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::setOffsetFromRenderer):
(WebCore::GraphicsLayer::setSize):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::shouldRepaintOnSizeChange):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::shouldRepaintOnSizeChange):
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerBacking.h: No longer need m_boundsConstrainedByClipping
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::RenderLayerBacking::updateCompositedBounds):
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): setSize takes
care of repainting for us now, so we can remove all the conditional code.

LayoutTests:

Reviewed by Tim Horton.

Test that dumps repaint rects on layers after visibility changes affect
the layer hierarchy.

* compositing/repaint/repaint-on-layer-grouping-change-expected.txt: Added.
* compositing/repaint/repaint-on-layer-grouping-change.html: Added.
* compositing/repaint/resize-repaint-expected.txt: Update result.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@154470 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/repaint/repaint-on-layer-grouping-change-expected.txt [new file with mode: 0644]
LayoutTests/compositing/repaint/repaint-on-layer-grouping-change.html [new file with mode: 0644]
LayoutTests/compositing/repaint/resize-repaint-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h