summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorMichael Dominic K <mdk@codethink.co.uk>2010-10-13 09:38:39 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-10-13 09:38:39 (GMT)
commit1af2d09523e3808e4589f05a4b8d42c308eb0841 (patch)
treedb0b8e6a3f093585a17289ed650151b369136d45 /src/plugins
parentab3304c663a62acb26af139d120f27a49a9d22ff (diff)
downloadQt-1af2d09523e3808e4589f05a4b8d42c308eb0841.zip
Qt-1af2d09523e3808e4589f05a4b8d42c308eb0841.tar.gz
Qt-1af2d09523e3808e4589f05a4b8d42c308eb0841.tar.bz2
Proper dither & proper alpha checking.
Merge-request: 854 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp
index 799a28e..5473d09 100644
--- a/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp
+++ b/src/plugins/graphicssystems/meego/qmeegopixmapdata.cpp
@@ -169,7 +169,7 @@ void QMeeGoPixmapData::fromEGLSharedImage(Qt::HANDLE handle, const QImage &si)
if (textureIsBound) {
fromTexture(newTextureId, newWidth, newHeight,
- si.hasAlphaChannel());
+ (si.hasAlphaChannel() && const_cast<QImage &>(si).data_ptr()->checkForAlphaPixels()));
texture()->options &= ~QGLContext::InvertedYBindOption;
softImage = si;
QMeeGoPixmapData::registerSharedImage(handle, softImage);
@@ -191,12 +191,12 @@ Qt::HANDLE QMeeGoPixmapData::imageToEGLSharedImage(const QImage &image)
glGenTextures(1, &textureId);
glBindTexture(GL_TEXTURE_2D, textureId);
- if (image.hasAlphaChannel()) {
- QImage convertedImage = image.convertToFormat(QImage::Format_ARGB4444_Premultiplied, Qt::NoOpaqueDetection);
+ if (image.hasAlphaChannel() && (image.hasAlphaChannel() && const_cast<QImage &>(image).data_ptr()->checkForAlphaPixels())) {
+ QImage convertedImage = image.convertToFormat(QImage::Format_ARGB4444_Premultiplied, Qt::DiffuseAlphaDither | Qt::DiffuseDither | Qt::PreferDither);
qARGBA4ToRGBA4(&convertedImage);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image.width(), image.height(), 0, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, convertedImage.bits());
} else {
- QImage convertedImage = image.convertToFormat(QImage::Format_RGB16, Qt::NoOpaqueDetection);
+ QImage convertedImage = image.convertToFormat(QImage::Format_RGB16, Qt::DiffuseAlphaDither | Qt::DiffuseDither | Qt::PreferDither);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, image.width(), image.height(), 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, convertedImage.bits());
}