Track a coverage rect through GraphicsLayerCA flushes, use it to mark backing store attached
https://bugs.webkit.org/show_bug.cgi?id=144165

Reviewed by Dean Jackson.

Source/WebCore:

Push in the clipRect as the secondary rect when doing a GraphicsLayerCA flush,
which maps this rect through all the layers. Each layer tests intersection with
this rect to determine if its backing store should be attached.

This will cause us to drop backing store for layers that don't intersect the
visible part of the view, which is too aggressive. A future patch will add
some padding.

Tests: compositing/visible-rect/coverage-clipped.html
       compositing/visible-rect/coverage-scrolling.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::GraphicsLayerCA): Remove initialization of things with
C++11 initializers. Initialize the new m_intersectsCoverageRect bit.
(WebCore::GraphicsLayerCA::flushCompositingState): Push the clipRect in as the
secondary coverage rect. A future patch will inflate this on the way down the tree.
(WebCore::GraphicsLayerCA::computeVisibleRect): If we're clipping, and
we have a secondary coverage rect, that rect can be clipped to us too.
(WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
(WebCore::GraphicsLayerCA::recursiveCommitChanges):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateBackingStoreAttachment):
(WebCore::GraphicsLayerCA::dumpAdditionalProperties):
* platform/graphics/ca/GraphicsLayerCA.h: New CoverageRectChanged bit.
Use more C++11 initializers.
(WebCore::GraphicsLayerCA::coverageRect):

LayoutTests:

Updated results that now include coverage rects, and a new test that includes both visible
and hidden layers.

* compositing/contents-scale/animating-expected.txt:
* compositing/contents-scale/rounded-contents-scale-expected.txt:
* compositing/contents-scale/scaled-ancestor-expected.txt:
* compositing/contents-scale/simple-scale-expected.txt:
* compositing/contents-scale/z-translate-expected.txt:
* compositing/visible-rect/coverage-clipped-expected.txt: Added.
* compositing/visible-rect/coverage-clipped.html: Added.
* compositing/visible-rect/coverage-scrolling-expected.txt: Added.
* compositing/visible-rect/coverage-scrolling.html: Added.
* platform/ios-simulator-wk2/compositing/visible-rect/coverage-clipped-expected.txt: Added.
* platform/ios-simulator-wk2/compositing/visible-rect/coverage-scrolling-expected.txt: Added.
* platform/mac-wk2/compositing/tiling/rotated-tiled-clamped-expected.txt:
* platform/mac-wk2/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
* platform/mac-wk2/compositing/tiling/tile-cache-zoomed-expected.txt:
* platform/mac-wk2/compositing/visible-rect/iframe-no-layers-expected.txt:
* platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants-expected.txt:
* platform/mac/compositing/overflow/clipping-behaviour-change-is-not-propagated-to-descendants2-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-clamped-expected.txt:
* platform/mac/compositing/tiling/rotated-tiled-preserve3d-clamped-expected.txt:
* platform/mac/compositing/tiling/tile-cache-zoomed-expected.txt:
* platform/mac/compositing/visible-rect/2d-transformed-expected.txt:
* platform/mac/compositing/visible-rect/3d-transform-style-expected.txt:
* platform/mac/compositing/visible-rect/3d-transformed-expected.txt:
* platform/mac/compositing/visible-rect/animated-expected.txt:
* platform/mac/compositing/visible-rect/animated-from-none-expected.txt:
* platform/mac/compositing/visible-rect/clipped-by-viewport-expected.txt:
* platform/mac/compositing/visible-rect/clipped-visible-rect-expected.txt:
* platform/mac/compositing/visible-rect/flipped-preserve-3d-expected.txt:
* platform/mac/compositing/visible-rect/iframe-and-layers-expected.txt:
* platform/mac/compositing/visible-rect/iframe-no-layers-expected.txt:
* platform/mac/compositing/visible-rect/nested-transform-expected.txt:
* platform/mac/compositing/visible-rect/scrolled-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@183300 268f45cc-cd09-0410-ab3c-d52691b4dbfc
36 files changed