Fix issues with filters and reflections
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2012 05:03:52 +0000 (05:03 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 Oct 2012 05:03:52 +0000 (05:03 +0000)
commit222e1cdf31423989f2c29a4457d69941f3933a06
tree6e965f7d4b363be7b48e823adcf955c2b3496ae8
parent5c1eb1e3d1b9c50a3b6b53d09b02a5525005c530
Fix issues with filters and reflections
https://bugs.webkit.org/show_bug.cgi?id=100308

Reviewed by Dirk Schulze.

Source/WebCore:

Composited filters were being applied to the wrong CALayer. The code used
primaryLayer(), which may be a CATransformLayer (which filters cannot apply
to; doing so causes console spew), or a CALayer that is used for reflection
flattening, which again is the wrong layer.

Test: css3/filters/composited-reflected.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateContentsVisibility): Replace .get()-> with ->
(WebCore::GraphicsLayerCA::updateContentsOpaque): Ditto.
(WebCore::GraphicsLayerCA::updateFilters): Apply filters to m_layer, not primaryLayer(),
and use m_layerClones, not primaryLayerClones().
(WebCore::GraphicsLayerCA::cloneLayer): When cloning a layer for reflections, copy filters
from the source layer.
* platform/graphics/ca/PlatformCALayer.h:
(PlatformCALayer): Add a member function to copy filters from a supplied layer.
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayer::setFilters): Remove blank line.
(PlatformCALayer::copyFiltersFrom): Copy CAFIlters from the given layer.
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayer::copyFiltersFrom): Stub; no filters on Windows.

LayoutTests:

Test composited filters inside a nested reflection.

* css3/filters/composited-reflected-expected.png: Added.
* css3/filters/composited-reflected-expected.txt: Added.
* css3/filters/composited-reflected.html: Added.
* platform/mac/css3/filters/composited-reflected-expected.png: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@132982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/css3/filters/composited-reflected-expected.png [new file with mode: 0644]
LayoutTests/css3/filters/composited-reflected-expected.txt [new file with mode: 0644]
LayoutTests/css3/filters/composited-reflected.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp