summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-02-09 14:16:12 +0100
commit03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch)
tree52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
parentcd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff)
downloadqtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp')
-rw-r--r--Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp b/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
index 8969bbbe3..c7ca7f116 100644
--- a/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
+++ b/Source/WebKit2/UIProcess/qt/LayerTreeHostProxyQt.cpp
@@ -26,8 +26,7 @@
#include "MainThread.h"
#include "MessageID.h"
#include "ShareableBitmap.h"
-#include "TextureMapperGL.h"
-#include "TextureMapperQt.h"
+#include "TextureMapper.h"
#include "UpdateInfo.h"
#include "WebCoreArgumentCoders.h"
#include "WebLayerTreeInfo.h"
@@ -171,8 +170,8 @@ LayerTreeHostProxy::~LayerTreeHostProxy()
void LayerTreeHostProxy::paintToCurrentGLContext(const TransformationMatrix& matrix, float opacity, const FloatRect& clipRect)
{
if (!m_textureMapper)
- m_textureMapper = TextureMapperGL::create();
- ASSERT(dynamic_cast<TextureMapperGL*>(m_textureMapper.get()));
+ m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
+ ASSERT(m_textureMapper->accelerationMode() == TextureMapper::OpenGLMode);
syncRemoteContent();
GraphicsLayer* currentRootLayer = rootLayer();
@@ -184,9 +183,6 @@ void LayerTreeHostProxy::paintToCurrentGLContext(const TransformationMatrix& mat
if (!node)
return;
- GLint viewport[4];
- glGetIntegerv(GL_VIEWPORT, viewport);
- m_textureMapper->setViewportSize(IntSize(viewport[2], viewport[3]));
node->setTextureMapper(m_textureMapper.get());
m_textureMapper->beginPainting();
m_textureMapper->bindSurface(0);
@@ -211,9 +207,8 @@ void LayerTreeHostProxy::paintToCurrentGLContext(const TransformationMatrix& mat
void LayerTreeHostProxy::paintToGraphicsContext(QPainter* painter)
{
if (!m_textureMapper)
- m_textureMapper = TextureMapperQt::create();
- ASSERT(dynamic_cast<TextureMapperQt*>(m_textureMapper.get()));
-
+ m_textureMapper = TextureMapper::create();
+ ASSERT(m_textureMapper->accelerationMode() == TextureMapper::SoftwareMode);
syncRemoteContent();
TextureMapperNode* node = toTextureMapperNode(rootLayer());
@@ -410,7 +405,7 @@ void LayerTreeHostProxy::createImage(int64_t imageID, ShareableBitmap* bitmap)
subImage = image.copy(rect);
RefPtr<BitmapTexture> texture = m_textureMapper->createTexture();
texture->reset(rect.size(), !imageHasAlpha);
- texture->updateRawContents(IntRect(IntPoint::zero(), rect.size()), subImage.constBits());
+ texture->updateContents(subImage.constBits(), IntRect(IntPoint::zero(), rect.size()));
tiledImage.add(rect.location(), texture);
}
}
@@ -473,7 +468,7 @@ void LayerTreeHostProxy::ensureRootLayer()
// The root layer should not have zero size, or it would be optimized out.
m_rootLayer->setSize(FloatSize(1.0, 1.0));
if (!m_textureMapper)
- m_textureMapper = TextureMapperGL::create();
+ m_textureMapper = TextureMapper::create(TextureMapper::OpenGLMode);
toTextureMapperNode(m_rootLayer.get())->setTextureMapper(m_textureMapper.get());
}