diff options
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 905fec3..86e92f7 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -56,20 +56,17 @@ IDirectFBSurface *QDirectFBPaintDevice::directFBSurface() const } -void QDirectFBPaintDevice::lockDirectFB(uint flags) +void QDirectFBPaintDevice::lockDirectFB(DFBSurfaceLockFlags flags) { if (!(lock & flags)) { if (lock) unlockDirectFB(); - if ((mem = QDirectFBScreen::lockSurface(dfbSurface, flags, &bpl))) { - const QSize s = size(); - lockedImage = new QImage(mem, s.width(), s.height(), bpl, - QDirectFBScreen::getImageFormat(dfbSurface)); - lock = flags; - Q_ASSERT(mem); - } else { - lock = 0; - } + mem = QDirectFBScreen::lockSurface(dfbSurface, flags, &bpl); + Q_ASSERT(mem); + const QSize s = size(); + lockedImage = new QImage(mem, s.width(), s.height(), bpl, + QDirectFBScreen::getImageFormat(dfbSurface)); + lock = flags; } } @@ -83,17 +80,12 @@ void QDirectFBPaintDevice::unlockDirectFB() delete lockedImage; lockedImage = 0; mem = 0; - lock = 0; + lock = DFBSurfaceLockFlags(0); } void *QDirectFBPaintDevice::memory() const { - if (lock != (DSLF_READ|DSLF_WRITE)) { - QDirectFBPaintDevice *that = const_cast<QDirectFBPaintDevice*>(this); - that->lockDirectFB(DSLF_READ|DSLF_WRITE); - Q_ASSERT(that->lockedImage); - } return mem; } |