summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-02-12 15:53:40 (GMT)
committerKim Motoyoshi Kalland <kim.kalland@nokia.com>2010-02-12 15:56:24 (GMT)
commit040151b51780084f3a2b764bab7e2359677eb0b1 (patch)
treec251bb56b21d1a42f0a41dbed4694ff06b6f084b /src/opengl/gl2paintengineex
parente5ee4c3c8a621c24117f004f4c137f8a531d7ea4 (diff)
downloadQt-040151b51780084f3a2b764bab7e2359677eb0b1.zip
Qt-040151b51780084f3a2b764bab7e2359677eb0b1.tar.gz
Qt-040151b51780084f3a2b764bab7e2359677eb0b1.tar.bz2
Moved 'hasAlpha' property from GL2 engine to GL paint device.
Got rid of an ugly switch statement. Reviewed-by: Tom
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp23
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
2 files changed, 1 insertions, 23 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 143b2e9..8235a5c 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1233,7 +1233,7 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem
if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) {
- if (d->deviceHasAlpha || txtype > QTransform::TxTranslate
+ if (d->device->alphaRequested() || txtype > QTransform::TxTranslate
|| (state()->composition_mode != QPainter::CompositionMode_Source
&& state()->composition_mode != QPainter::CompositionMode_SourceOver))
{
@@ -1529,27 +1529,6 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->dirtyStencilRegion = QRect(0, 0, d->width, d->height);
d->stencilClean = true;
- switch (pdev->devType()) {
- case QInternal::Pixmap:
- d->deviceHasAlpha = static_cast<QPixmap *>(pdev)->hasAlphaChannel();
- break;
- case QInternal::FramebufferObject:
- {
- GLenum f = static_cast<QGLFramebufferObject *>(pdev)->format().internalTextureFormat();
- d->deviceHasAlpha = (f != GL_RGB
-#ifndef QT_OPENGL_ES
- && f != GL_RGB5 && f != GL_RGB8
-#endif
- );
- }
- break;
- default:
- // widget, pbuffer
- d->deviceHasAlpha = d->ctx->d_func()->reqFormat.alpha();
- break;
- }
-
-
// Calling begin paint should make the correct context current. So, any
// code which calls into GL or otherwise needs a current context *must*
// go after beginPaint:
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index fe577be..8fa0eff 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -278,7 +278,6 @@ public:
bool needsSync;
bool multisamplingAlwaysEnabled;
- bool deviceHasAlpha;
GLfloat depthRange[2];