summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-08 04:02:09 (GMT)
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-08 04:02:09 (GMT)
commitc3cfba7295c990d8135e1dd70b8cdbefd25615ab (patch)
tree33348525257ec277525990e970ab3d0a808f22cc /src/plugins
parentf85ad9872913887d0e12033517ddc989dec68005 (diff)
downloadQt-c3cfba7295c990d8135e1dd70b8cdbefd25615ab.zip
Qt-c3cfba7295c990d8135e1dd70b8cdbefd25615ab.tar.gz
Qt-c3cfba7295c990d8135e1dd70b8cdbefd25615ab.tar.bz2
Stub out flush() in the PowerVR GL window surface class
When QGLWidget was used as a viewport for QGraphicsView on PowerVR/MBX systems, it was double-flushing every frame because the window surface flush() implementation was still trying to do a raster blit after painting. This change suppresses the raster blit, leaving it up to the GL swapBuffers() call to get the painted contents onto the screen. Reviewed-by: Sarah Smith
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp21
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h2
2 files changed, 15 insertions, 8 deletions
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
index afee77e..09c0ace 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
@@ -149,6 +149,18 @@ void PvrEglWindowSurface::setPermanentState(const QByteArray &state)
Q_UNUSED(state);
}
+void PvrEglWindowSurface::flush
+ (QWidget *widget, const QRegion &region, const QPoint &offset)
+{
+ // The GL paint engine is responsible for the swapBuffers() call.
+ // If we were to call the base class's implementation of flush()
+ // then it would fetch the image() and manually blit it to the
+ // screeen instead of using the fast PVR2D blit.
+ Q_UNUSED(widget);
+ Q_UNUSED(region);
+ Q_UNUSED(offset);
+}
+
QImage PvrEglWindowSurface::image() const
{
if (drawable) {
@@ -165,14 +177,7 @@ QImage PvrEglWindowSurface::image() const
QPaintDevice *PvrEglWindowSurface::paintDevice()
{
- QGLWidget *glWidget = qobject_cast<QGLWidget *>(window());
- if (glWidget)
- return glWidget;
-
- // Should be a QGLWidget, but if not return a dummy paint device.
- if (!pdevice)
- pdevice = new QImage(50, 50, screen->pixelFormat());
- return pdevice;
+ return widget;
}
void PvrEglWindowSurface::setDirectRegion(const QRegion &r, int id)
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
index 80fc8f8..0da3653 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h
@@ -65,6 +65,8 @@ public:
QByteArray permanentState() const;
void setPermanentState(const QByteArray &state);
+ void flush(QWidget *widget, const QRegion &region, const QPoint &offset);
+
QImage image() const;
QPaintDevice *paintDevice();