12011-06-09 James Robinson <jamesr@chromium.org>
2
3 Reviewed by NOBODY (OOPS!).
4
5 [chromium] Scissor rect not set for clipping layers set offscreen
6 https://bugs.webkit.org/show_bug.cgi?id=62339
7
8 We set a scissorRect on each layer, but only layers with masksToBounds and their descendants should actually set
9 a scissor. Layers that didn't need to scissor had empty scissorRects. Unfortunately layers with masksToBounds
10 and their descendants that are scrolled offscreen also end up with an empty clipped scissor rect.
11
12 This patch sets an explicit bit on each layer that should scissor and then checks that bit instead of checking
13 for an empty scissor rect at draw time. RenderSurfaceChromiums have different requirements for
14 setScissorToRect, so the old behavior is still available with a flag. This can probably be cleaned up more.
15
16 Test: platform/chromium/compositing/scissor-out-of-viewport.html
17
18 * platform/graphics/chromium/LayerRendererChromium.cpp:
19 (WebCore::LayerRendererChromium::updatePropertiesAndRenderSurfaces):
20 (WebCore::LayerRendererChromium::drawLayer):
21 (WebCore::LayerRendererChromium::setScissorToRect):
22 * platform/graphics/chromium/LayerRendererChromium.h:
23 * platform/graphics/chromium/RenderSurfaceChromium.cpp:
24 (WebCore::RenderSurfaceChromium::draw):
25 * platform/graphics/chromium/cc/CCLayerImpl.cpp:
26 (WebCore::CCLayerImpl::CCLayerImpl):
27 * platform/graphics/chromium/cc/CCLayerImpl.h:
28 (WebCore::CCLayerImpl::setUsesLayerScissor):
29 (WebCore::CCLayerImpl::usesLayerScissor):
30