[Texmap] Use glScissors for clipping in TextureMapperGL when possible
authornoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 02:42:14 +0000 (02:42 +0000)
committernoam.rosenthal@nokia.com <noam.rosenthal@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 2 Feb 2012 02:42:14 +0000 (02:42 +0000)
commit47c557c3a4dcc52820dc298814193758baa5a011
tree2a96d200f9152246d242bbe3a1d2b99fa229d4f8
parent50decc358d64c1f8c74813a4d544ea172a79d748
[Texmap] Use glScissors for clipping in TextureMapperGL when possible
https://bugs.webkit.org/show_bug.cgi?id=77575

Reviewed by Martin Robinson.

Source/WebCore:

Maintain a clipping stack, that helps us use stencils in conjunction with scissors.
We apply scissors when the clip region is rectalinear, and stencil when it's not.

No behavior changes so no new tests.

* platform/graphics/opengl/TextureMapperGL.cpp:
(SharedGLData):
(WebCore::TextureMapperGLData::SharedGLData::SharedGLData):
(WebCore::TextureMapperGL::drawTexture):
(WebCore::TextureMapperGL::bindSurface):
(WebCore):
(WebCore::scissorClip):
(WebCore::TextureMapperGL::beginScissorClip):
(WebCore::TextureMapperGL::endScissorClip):
(WebCore::TextureMapperGL::beginClip):
(WebCore::TextureMapperGL::endClip):
* platform/graphics/opengl/TextureMapperGL.h:
(TextureMapperGL):

Source/WebKit2:

Instead of applying the scissor clip in QQuickWebPage, we trickle it down to
TextureMapperGL, and apply it there as part of beginClip(). All direct GL operations are
now cleaned out of QQuickWebPage.

* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPagePrivate::paintToCurrentGLContext):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::paintToCurrentGLContext):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::paintToCurrentGLContext):
* UIProcess/DrawingAreaProxyImpl.h:
(DrawingAreaProxyImpl):
* UIProcess/LayerTreeHostProxy.h:
(LayerTreeHostProxy):
* UIProcess/qt/LayerTreeHostProxyQt.cpp:
(WebKit::LayerTreeHostProxy::paintToCurrentGLContext):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/opengl/TextureMapperGL.cpp
Source/WebCore/platform/graphics/opengl/TextureMapperGL.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
Source/WebKit2/UIProcess/LayerTreeHostProxy.h
Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp