summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@nokia.com>2009-10-09 11:02:57 +1000
committerRhys Weatherley <rhys.weatherley@nokia.com>2009-10-09 11:02:57 +1000
commit85bb10256b2745499f04c32a5ed738889606f6c3 (patch)
tree5a232b4605bb624067ef51d48a3b949a80979cf6 /src
parent71b3a986a602e47a4d4ba433465d0cd9d1e5e168 (diff)
Back port fixes from PowerVR driver in 4.6 to 4.5
Pre-multiply fix: 01a671ff0bd380e5cff311cc233352c867a041a0 Painting performance: c3cfba7295c990d8135e1dd70b8cdbefd25615ab
Diffstat (limited to 'src')
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp2
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp21
-rw-r--r--src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.h2
3 files changed, 16 insertions, 9 deletions
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
index 25c52830d9..cb453d79b5 100644
--- a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
+++ b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglscreen.cpp
@@ -104,7 +104,7 @@ bool PvrEglScreen::connect(const QString &displaySpec)
break;
case PVR2D_ARGB8888:
d = 32;
- setPixelFormat(QImage::Format_ARGB32);
+ setPixelFormat(QImage::Format_ARGB32_Premultiplied);
break;
default:
pvrQwsDisplayClose();
diff --git a/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp b/src/plugins/gfxdrivers/powervr/pvreglscreen/pvreglwindowsurface.cpp
index afee77eae2..09c0acee32 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 80fc8f845e..0da36536ae 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();