[Qt][WK2] Clipping is broken
authornoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 00:24:40 +0000 (00:24 +0000)
committernoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Feb 2012 00:24:40 +0000 (00:24 +0000)
commit9817ea25891b8b667570233b6b405654f580f0d2
tree18f932cdcdacc135923a54f9db0ce01872cdbbf7
parent9628c06923d269300d3da8ce0f7a75a916a27c84
[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
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
Source/WebCore/platform/graphics/texmap/TextureMapperLayer.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperShaderManager.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperShaderManager.h