Fix occlusion culling logic to handle css background layer clipping
authorjunov@google.com <junov@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Dec 2012 10:55:24 +0000 (10:55 +0000)
committerjunov@google.com <junov@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 2 Dec 2012 10:55:24 +0000 (10:55 +0000)
commitee2078648fa26f8a7c1df6aa913ad835f25f42d4
tree246515ae57117e7a7fff84301924cd27a705a044
parent6a4f5ee1dd21dd5dab4c164ec5cb6595c9ccac7a
Fix occlusion culling logic to handle css background layer clipping
https://bugs.webkit.org/show_bug.cgi?id=103276

Reviewed by Simon Fraser.

Source/WebCore:

Bug was introduced by r135629
This patch fixes it by verifying layer clip.  A fill layer must
not be treated as if it occludes the layers under it unless it has
a larger or equal clip setting than the layers under it.

Test: fast/backgrounds/background-opaque-clipped-gradients.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::paintFillLayers):
* rendering/style/FillLayer.cpp:
(WebCore::clipMax):
(WebCore::FillLayer::computeClipMax):
(WebCore::FillLayer::clipOccludesNextLayers):
* rendering/style/FillLayer.h:
(FillLayer):

LayoutTests:

New ref test that verifies the superposition of background layers with
the layers having smaller clip regions than the layers beneath them.
This test ensures the bottom layers are not removed by culling
optimizations.

* fast/backgrounds/background-opaque-clipped-gradients-expected.html: Added.
* fast/backgrounds/background-opaque-clipped-gradients.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136326 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/backgrounds/background-opaque-clipped-gradients-expected.html [new file with mode: 0644]
LayoutTests/fast/backgrounds/background-opaque-clipped-gradients.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/style/FillLayer.cpp
Source/WebCore/rendering/style/FillLayer.h