[Qt] Fix issues when using the WebView as ShaderEffectSource
authorjocelyn.turcotte@nokia.com <jocelyn.turcotte@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Apr 2012 14:50:42 +0000 (14:50 +0000)
committerjocelyn.turcotte@nokia.com <jocelyn.turcotte@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Apr 2012 14:50:42 +0000 (14:50 +0000)
commit6b65ac506b91ec796985cf51ddc02f3016876853
tree7c688c2059c9b324c1f9a50f0afa40ec904b2b78
parente1cfa4e01796d374c91323b70d52a4b786418813
[Qt] Fix issues when using the WebView as ShaderEffectSource
https://bugs.webkit.org/show_bug.cgi?id=83587

Reviewed by Noam Rosenthal.

Source/WebCore:

- Make sure that the bound frame buffer is preserved instead of binding
  to the default one
- Accept a "mirrored" flag in beginPainting that we're applying on the
  projection matrix just as with internal FBOs

The "flip" logic in createProjectionMatrix has been reversed and renamed to
mirrored so that FBO rendering is considered the special case and not the
other way around just like within Qt.

* platform/graphics/texmap/TextureMapper.h:
(WebCore::TextureMapper::beginPainting):
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGLData::TextureMapperGLData):
(TextureMapperGLData):
(WebCore::TextureMapperGL::beginPainting):
(WebCore::createProjectionMatrix):
(WebCore::BitmapTextureGL::bind):
(WebCore::TextureMapperGL::bindSurface):
* platform/graphics/texmap/TextureMapperGL.h:

Source/WebKit2:

Qt is going to mirror the projection matrix when the shader effect source
is grabbed. Detect that the matrix is mirrored and pass on this information
to TextureMapper so that it can do the same.

* UIProcess/WebLayerTreeRenderer.cpp:
(WebKit::WebLayerTreeRenderer::paintToCurrentGLContext):
* UIProcess/WebLayerTreeRenderer.h:
(WebLayerTreeRenderer):
* UIProcess/qt/QtWebPageSGNode.cpp:
(WebKit::ContentsSGNode::render):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@113859 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapper.h
Source/WebCore/platform/graphics/texmap/TextureMapperGL.cpp
Source/WebCore/platform/graphics/texmap/TextureMapperGL.h
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebLayerTreeRenderer.cpp
Source/WebKit2/UIProcess/WebLayerTreeRenderer.h
Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp