summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/WebCoreSupport/PageClientQt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/qt/WebCoreSupport/PageClientQt.cpp')
-rw-r--r--WebKit/qt/WebCoreSupport/PageClientQt.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/WebKit/qt/WebCoreSupport/PageClientQt.cpp b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
index 4d42c39..9fa5bf7 100644
--- a/WebKit/qt/WebCoreSupport/PageClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/PageClientQt.cpp
@@ -21,15 +21,19 @@
#include "config.h"
#include "PageClientQt.h"
+#include "TextureMapperQt.h"
#include "texmap/TextureMapperPlatformLayer.h"
-
+#include <QGraphicsScene>
+#include <QGraphicsView>
#if defined(Q_WS_X11)
#include <QX11Info>
#endif
#ifdef QT_OPENGL_LIB
+#include "opengl/TextureMapperGL.h"
#include <QGLWidget>
#endif
+
namespace WebCore {
#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER)
@@ -45,6 +49,11 @@ public:
m_frame->d->rootGraphicsLayer = m_layer;
}
+ void setTextureMapper(PassOwnPtr<TextureMapper> textureMapper)
+ {
+ m_frame->d->textureMapper = textureMapper;
+ }
+
virtual ~PlatformLayerProxyQt()
{
if (m_layer)
@@ -53,6 +62,11 @@ public:
m_frame->d->rootGraphicsLayer = 0;
}
+ virtual TextureMapper* textureMapper()
+ {
+ return m_frame->d->textureMapper.get();
+ }
+
// Since we just paint the composited tree and never create a special item for it, we don't have to handle its size changes.
void setSizeChanged(const IntSize&) { }
@@ -69,6 +83,11 @@ public:
{
if (m_widget)
m_widget->installEventFilter(this);
+
+ if (textureMapper())
+ return;
+
+ setTextureMapper(TextureMapperQt::create());
}
// We don't want a huge region-clip on the compositing layers; instead we unite the rectangles together
@@ -103,6 +122,17 @@ public:
: PlatformLayerProxyQt(frame, layer, object)
, m_graphicsItem(object)
{
+ if (textureMapper())
+ return;
+
+#ifdef QT_OPENGL_LIB
+ QGraphicsView* view = object->scene()->views()[0];
+ if (view && view->viewport() && view->viewport()->inherits("QGLWidget")) {
+ setTextureMapper(TextureMapperGL::create());
+ return;
+ }
+#endif
+ setTextureMapper(TextureMapperQt::create());
}
void setNeedsDisplay()