summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_gl.cpp
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-08-19 11:19:31 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-08-19 11:23:59 (GMT)
commitf30adf43b9331dbf0bb3768fb7694af5bce66c4a (patch)
tree6aa8e4b55a6b3c100963185cdc000b208120b118 /src/opengl/qpixmapdata_gl.cpp
parentacb18f598d96f4e193b85045a1e2d05272e4100b (diff)
downloadQt-f30adf43b9331dbf0bb3768fb7694af5bce66c4a.zip
Qt-f30adf43b9331dbf0bb3768fb7694af5bce66c4a.tar.gz
Qt-f30adf43b9331dbf0bb3768fb7694af5bce66c4a.tar.bz2
Made GL pixmap backend respect Qt::NoOpaqueDetection flag..
We don't want to do the opaque image scan when the Qt::NoOpaqueDetection flag is set. Reviewed-by: Trond
Diffstat (limited to 'src/opengl/qpixmapdata_gl.cpp')
-rw-r--r--src/opengl/qpixmapdata_gl.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp
index 653e805..1efd398 100644
--- a/src/opengl/qpixmapdata_gl.cpp
+++ b/src/opengl/qpixmapdata_gl.cpp
@@ -367,7 +367,7 @@ void QGLPixmapData::ensureCreated() const
}
void QGLPixmapData::fromImage(const QImage &image,
- Qt::ImageConversionFlags /*flags*/)
+ Qt::ImageConversionFlags flags)
{
if (image.size() == QSize(w, h))
setSerialNumber(++qt_gl_pixmap_serial);
@@ -381,7 +381,9 @@ void QGLPixmapData::fromImage(const QImage &image,
if (qApp->desktop()->depth() == 16)
format = QImage::Format_RGB16;
- if (image.hasAlphaChannel() && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels())
+ if (image.hasAlphaChannel()
+ && ((flags & Qt::NoOpaqueDetection)
+ || const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels()))
format = QImage::Format_ARGB32_Premultiplied;;
m_source = image.convertToFormat(format);