[Qt][WK2] Clipping is broken
https://bugs.webkit.org/show_bug.cgi?id=78677
Reviewed by Simon Hausmann.
Rework the clipping stack in TextureMapperGL.
Instead of saving a stack of IntRect scissor clips, we save every clipping change in the
stack, and reapply it when we end the clip. Popping the stack is almost free, since we
don't reapply the stencil but simply change the stencil test index.
In addition, we don't use a special shader for clipping, and we don't apply clipping for
masked children, since they're already clipped because they're rendered into an intermediate
buffer.
This fixes exiting tests in LayoutTests/compositing/overflow.
It also fixes asserts in the leaves demo, as well as asserts in nytimes.com and other sites.
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
* platform/graphics/texmap/TextureMapperGL.cpp:
(ClipState):
(WebCore::TextureMapperGLData::SharedGLData::ClipState::ClipState):
(SharedGLData):
(WebCore::TextureMapperGLData::SharedGLData::pushClipState):
(WebCore::TextureMapperGLData::SharedGLData::popClipState):
(WebCore::TextureMapperGLData::SharedGLData::scissorClip):
(WebCore::TextureMapperGLData::SharedGLData::applyCurrentClip):
(TextureMapperGLData):
(BitmapTextureGL):
(WebCore::TextureMapperGLData::initStencil):
(WebCore):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::TextureMapperGL::endPainting):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::BitmapTextureGL::initStencil):
(WebCore::BitmapTextureGL::bind):
(WebCore::BitmapTextureGL::destroy):
(WebCore::TextureMapperGL::bindSurface):
(WebCore::TextureMapperGL::beginScissorClip):
(WebCore::TextureMapperGL::beginClip):
(WebCore::TextureMapperGL::endClip):
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildren):
* platform/graphics/texmap/TextureMapperShaderManager.cpp:
* platform/graphics/texmap/TextureMapperShaderManager.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@108696
268f45cc-cd09-0410-ab3c-
d52691b4dbfc