summaryrefslogtreecommitdiffstats
path: root/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-08-28 03:37:40 (GMT)
committerAnders Bakken <anders.bakken@nokia.com>2009-09-01 22:25:51 (GMT)
commitadd57539ec7cd24346e26b22a5298da50d81e91b (patch)
treefda78f056d25bd876b7348bf732463939b9fe648 /src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
parent913a21aae513714217be233c6cecfb39212a4be8 (diff)
downloadQt-add57539ec7cd24346e26b22a5298da50d81e91b.zip
Qt-add57539ec7cd24346e26b22a5298da50d81e91b.tar.gz
Qt-add57539ec7cd24346e26b22a5298da50d81e91b.tar.bz2
Rewrite of DirectFB locking mechanism
DirectFB allows you to have a locked subSurface that remains valid while you paint on the unlocked "parent" surface. The only limitation is that when accessing the locked memory you might have to call DirectFB->WaitIdle() in case pending GPU operations aren't finished. After this we keep the locked surface around at all times (from the first time it's requested) until the surface dies. Previous calls to lock() will just call WaitIdle if necessary and previous calls to unlock now just mark the surface as dirty and in need of a WaitIdle if someone needs to access its pixel data. Reviewed-by: Donald Carr <donald.carr@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h')
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
index f5de44b..cdd2bea 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.h
@@ -62,8 +62,8 @@ public:
virtual IDirectFBSurface *directFBSurface() const;
- void lockDirectFB(DFBSurfaceLockFlags lock);
- void unlockDirectFB();
+ bool lockSurface(DFBSurfaceLockFlags lockFlags);
+ void unlockSurface();
// Reimplemented from QCustomRasterPaintDevice:
void *memory() const;
@@ -73,7 +73,6 @@ public:
int metric(QPaintDevice::PaintDeviceMetric metric) const;
DFBSurfaceLockFlags lockFlags() const { return lockFlgs; }
QPaintEngine *paintEngine() const;
-
protected:
QDirectFBPaintDevice(QDirectFBScreen *scr);
inline int dotsPerMeterX() const
@@ -84,17 +83,20 @@ protected:
{
return (screen->deviceHeight() * 1000) / screen->physicalHeight();
}
-protected:
+
IDirectFBSurface *dfbSurface;
- QImage *lockedImage;
+#ifdef QT_DIRECTFB_SUBSURFACE
+ IDirectFBSurface *subSurface;
+ friend class QDirectFBPaintEnginePrivate;
+ bool syncPending;
+#endif
+ QImage lockedImage;
QDirectFBScreen *screen;
int bpl;
DFBSurfaceLockFlags lockFlgs;
uchar *mem;
QDirectFBPaintEngine *engine;
QImage::Format imageFormat;
-private:
- Q_DISABLE_COPY(QDirectFBPaintDevice);
};
QT_END_NAMESPACE