diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-04-30 12:23:34 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-07-14 21:50:46 +0000 |
commit | f222206e8d20649cf349d541dc90c37b6a00c780 (patch) | |
tree | c3c5e96a39fe77d8a84a1cb53b858c34f2e7158e /src/gui/image/qpixmap_raster.cpp | |
parent | 39da34853f8a835ebdb2df3cf52b69496a37731a (diff) |
Remove unused NativeImage
Only the static method systemFormat of NativeImage was used, and only
from raster pixmaps for default formats.
This patch moves the method to qpixmap_raster.cpp.
Change-Id: Ic3cb673775693ea0595bad5e5f267a8dd1e8b0ec
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/image/qpixmap_raster.cpp')
-rw-r--r-- | src/gui/image/qpixmap_raster.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp index 45047f556c..741f7713da 100644 --- a/src/gui/image/qpixmap_raster.cpp +++ b/src/gui/image/qpixmap_raster.cpp @@ -42,7 +42,6 @@ #include <private/qfont_p.h> #include "qpixmap_raster_p.h" -#include "qnativeimage_p.h" #include "qimage_p.h" #include "qpaintengine.h" @@ -50,9 +49,12 @@ #include "qimage.h" #include <QBuffer> #include <QImageReader> +#include <QGuiApplication> +#include <QScreen> #include <private/qimage_p.h> #include <private/qsimd_p.h> #include <private/qdrawhelper_p.h> +#include <qpa/qplatformscreen.h> QT_BEGIN_NAMESPACE @@ -88,6 +90,13 @@ QRasterPlatformPixmap::~QRasterPlatformPixmap() { } +QImage::Format QRasterPlatformPixmap::systemOpaqueFormat() +{ + if (!QGuiApplication::primaryScreen()) + return QImage::Format_RGB32; + return QGuiApplication::primaryScreen()->handle()->format(); +} + QPlatformPixmap *QRasterPlatformPixmap::createCompatiblePlatformPixmap() const { return new QRasterPlatformPixmap(pixelType()); @@ -99,7 +108,7 @@ void QRasterPlatformPixmap::resize(int width, int height) if (pixelType() == BitmapType) format = QImage::Format_MonoLSB; else - format = QNativeImage::systemFormat(); + format = systemOpaqueFormat(); image = QImage(width, height, format); w = width; @@ -306,13 +315,13 @@ void QRasterPlatformPixmap::createPixmapForImage(QImage &sourceImage, Qt::ImageC ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32; } else { - QImage::Format opaqueFormat = QNativeImage::systemFormat(); + QImage::Format opaqueFormat = systemOpaqueFormat(); QImage::Format alphaFormat = qt_alphaVersionForPainting(opaqueFormat); if (!sourceImage.hasAlphaChannel()) { format = opaqueFormat; } else if ((flags & Qt::NoOpaqueDetection) == 0 - && !const_cast<QImage &>(sourceImage).data_ptr()->checkForAlphaPixels()) + && !sourceImage.data_ptr()->checkForAlphaPixels()) { format = opaqueFormat; } else { |