diff options
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp index 3979a8c..f45f256 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpaintdevice.cpp @@ -47,7 +47,8 @@ QDirectFBPaintDevice::QDirectFBPaintDevice(QDirectFBScreen *scr) : QCustomRasterPaintDevice(0), dfbSurface(0), lockedImage(0), screen(scr), - bpl(-1), lockFlgs(DFBSurfaceLockFlags(0)), mem(0), engine(0) + bpl(-1), lockFlgs(DFBSurfaceLockFlags(0)), mem(0), engine(0), + imageFormat(QImage::Format_Invalid) {} QDirectFBPaintDevice::~QDirectFBPaintDevice() @@ -56,13 +57,11 @@ QDirectFBPaintDevice::~QDirectFBPaintDevice() delete engine; } - IDirectFBSurface *QDirectFBPaintDevice::directFBSurface() const { return dfbSurface; } - void QDirectFBPaintDevice::lockDirectFB(DFBSurfaceLockFlags flags) { if (!(lockFlgs & flags)) { @@ -77,7 +76,6 @@ void QDirectFBPaintDevice::lockDirectFB(DFBSurfaceLockFlags flags) } } - void QDirectFBPaintDevice::unlockDirectFB() { if (!lockedImage || !QDirectFBScreen::instance()) @@ -90,19 +88,16 @@ void QDirectFBPaintDevice::unlockDirectFB() lockFlgs = DFBSurfaceLockFlags(0); } - void *QDirectFBPaintDevice::memory() const { return mem; } - QImage::Format QDirectFBPaintDevice::format() const { - return QDirectFBScreen::getImageFormat(dfbSurface); + return imageFormat; } - int QDirectFBPaintDevice::bytesPerLine() const { if (bpl == -1) { @@ -143,11 +138,9 @@ int QDirectFBPaintDevice::metric(QPaintDevice::PaintDeviceMetric metric) const case QPaintDevice::PdmDpiY: return (dotsPerMeterY() * 254) / 10000; // 0.0254 meters-per-inch case QPaintDevice::PdmDepth: - DFBSurfacePixelFormat format; - dfbSurface->GetPixelFormat(dfbSurface, &format); - return QDirectFBScreen::depth(format); + return QDirectFBScreen::depth(imageFormat); case QPaintDevice::PdmNumColors: { - if (lockedImage) + if (lockedImage) return lockedImage->numColors(); DFBResult result; |