Fix CALayer hiearchy when combining tiling with preserve-3d
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 20:36:02 +0000 (20:36 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 24 Oct 2012 20:36:02 +0000 (20:36 +0000)
commitd66b3754ad3d870af23555bc6590c5acb62daec8
tree8d307a4872a983e21582e9bb657dd84c3911875e
parent1a0349a2d5a86963b92abc852c28c7ff2f1a2fa5
Fix CALayer hiearchy when combining tiling with preserve-3d
https://bugs.webkit.org/show_bug.cgi?id=100205

Reviewed by Dean Jackson.

Source/WebCore:

When an element has "transform-style: preserve-3d", its GraphicsLayerCA has a
m_structuralLayer which is a CATransformLayer. The primary CALayer which contains rendered
content becomes a sublayer of the CATransformLayer. If the element has backface-visibility:hidden,
it is the primary layer that is set to be single-sided.

In r131940 we started to use TileCaches in place of CATiledLayer. TileCaches work via
"customSublayers" returned from the PlatformCALayer, where the custom sublayer is
the tile cache container layer. However, the custom sublayers were being added as
children of the structural (CATransformLayer) layer, not of the primary (CALayer) layer,
thus they were not affected by the doubleSided property.

This change cleans up the confusing code in GraphicsLayerCA::updateSublayerList()
by maintaining two vectors of PlatformCALayers, one for sublayers of the structural
layer, and one for sublayers of the primary layer. It adds custom sublayers to
the latter list, so now the tile cache container layer becomes a sublayer of
the primary layer, so is affected by that layer's doubleSided property.

Test: compositing/tiling/backface-preserve-3d-tiled.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateSublayerList):

LayoutTests:

Pixel test that tests backface-visibility on a tile cache layer. Mark the test as
failing on Chromium.

* compositing/tiling/backface-preserve-3d-tiled-expected.png: Added.
* compositing/tiling/backface-preserve-3d-tiled-expected.txt: Added.
* compositing/tiling/backface-preserve-3d-tiled.html: Added.
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132394 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/compositing/tiling/backface-preserve-3d-tiled-expected.png [new file with mode: 0644]
LayoutTests/compositing/tiling/backface-preserve-3d-tiled-expected.txt [new file with mode: 0644]
LayoutTests/compositing/tiling/backface-preserve-3d-tiled.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp