From 79adaaf479bfe2e5c252c7aad20db7d04d315444 Mon Sep 17 00:00:00 2001 From: Anders Bakken Date: Mon, 6 Apr 2009 22:55:22 -0700 Subject: Code cleanup. QDirectFBPaintDevice's know their screen. No need to use instance() in these cases. Reviewed-by: TrustMe --- src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp | 10 +++++----- src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp index c4144bd..35ab859 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbpixmap.cpp @@ -71,9 +71,9 @@ void QDirectFBPixmapData::resize(int width, int height) return; } - dfbSurface = QDirectFBScreen::instance()->createDFBSurface(QSize(width, height), - screen->pixelFormat(), - QDirectFBScreen::TrackSurface); + dfbSurface = screen->createDFBSurface(QSize(width, height), + screen->pixelFormat(), + QDirectFBScreen::TrackSurface); forceRaster = (screen->pixelFormat() == QImage::Format_RGB32); if (!dfbSurface) { setSerialNumber(0); @@ -111,8 +111,8 @@ void QDirectFBPixmapData::copy(const QPixmapData *data, const QRect &rect) IDirectFBSurface *src = static_cast(data)->directFBSurface(); const bool hasAlpha = data->hasAlphaChannel(); const QImage::Format format = (hasAlpha - ? QDirectFBScreen::instance()->alphaPixmapFormat() - : QDirectFBScreen::instance()->pixelFormat()); + ? screen->alphaPixmapFormat() + : screen->pixelFormat()); dfbSurface = screen->createDFBSurface(rect.size(), format, QDirectFBScreen::TrackSurface); diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp index 592ad47..28b1e52 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp @@ -105,9 +105,9 @@ void QDirectFBSurface::createWindow() |DWDESC_PIXELFORMAT); description.surface_caps = DSCAPS_NONE; - if (QDirectFBScreen::instance()->preferVideoOnly()) + if (screen->preferVideoOnly()) description.surface_caps = DFBSurfaceCapabilities(description.surface_caps|DSCAPS_VIDEOONLY); - const QImage::Format format = QDirectFBScreen::instance()->pixelFormat(); + const QImage::Format format = screen->pixelFormat(); description.pixelformat = QDirectFBScreen::getSurfacePixelFormat(format); if (QDirectFBScreen::isPremultiplied(format)) description.surface_caps = DFBSurfaceCapabilities(DSCAPS_PREMULTIPLIED|description.caps); @@ -173,8 +173,8 @@ void QDirectFBSurface::setGeometry(const QRect &rect, const QRegion &mask) description.width = rect.width(); description.height = rect.height(); QDirectFBScreen::initSurfaceDescriptionPixelFormat(&description, - QDirectFBScreen::instance()->pixelFormat()); - dfbSurface = QDirectFBScreen::instance()->createDFBSurface(&description, false); + screen->pixelFormat()); + dfbSurface = screen->createDFBSurface(&description, false); forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32); } else { Q_ASSERT(dfbSurface); -- cgit v0.12