diff options
author | Alan Alpert <alan.alpert@nokia.com> | 2010-02-12 18:39:45 (GMT) |
---|---|---|
committer | Alan Alpert <alan.alpert@nokia.com> | 2010-02-12 18:39:45 (GMT) |
commit | 749f11d49306b0ee9e3258117b5753d6c4a43d6b (patch) | |
tree | 1d2ea590139c374d670af2e4f7abd99de071bdee /src | |
parent | ba1d67e35a8493a5a035f4f26970799e50661a36 (diff) | |
parent | 30ea8c49a50e7088c58c6c569450ec8673001962 (diff) | |
download | Qt-749f11d49306b0ee9e3258117b5753d6c4a43d6b.zip Qt-749f11d49306b0ee9e3258117b5753d6c4a43d6b.tar.gz Qt-749f11d49306b0ee9e3258117b5753d6c4a43d6b.tar.bz2 |
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/text/qtextdocument_p.cpp | 5 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 31 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 1 | ||||
-rw-r--r-- | src/opengl/qglextensions_p.h | 4 |
4 files changed, 29 insertions, 12 deletions
diff --git a/src/gui/text/qtextdocument_p.cpp b/src/gui/text/qtextdocument_p.cpp index e2fdf0e..969d5b4 100644 --- a/src/gui/text/qtextdocument_p.cpp +++ b/src/gui/text/qtextdocument_p.cpp @@ -259,8 +259,7 @@ void QTextDocumentPrivate::clear() objects.clear(); title.clear(); - undoState = 0; - clearUndoRedoStacks(QTextDocument::RedoStack); + clearUndoRedoStacks(QTextDocument::UndoAndRedoStacks); text = QString(); unreachableCharacterCount = 0; modifiedState = 0; @@ -1077,7 +1076,7 @@ void QTextDocumentPrivate::clearUndoRedoStacks(QTextDocument::Stacks stacksToCle if (emitSignals) emitRedoAvailable(false); } else if (stacksToClear == QTextDocument::UndoAndRedoStacks - && (undoCommandsAvailable || redoCommandsAvailable)) { + && !undoStack.isEmpty()) { for (int i = 0; i < undoStack.size(); ++i) { QTextUndoCommand c = undoStack[i]; if (c.command & QTextUndoCommand::Custom) diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index b17e3a1..d2fb925 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1332,14 +1332,14 @@ void QGL2PaintEngineEx::drawTextItem(const QPointF &p, const QTextItem &textItem ? QFontEngineGlyphCache::Type(ti.fontEngine->glyphFormat) : d->glyphCacheType; - if (txtype > QTransform::TxTranslate) - glyphType = QFontEngineGlyphCache::Raster_A8; - if (glyphType == QFontEngineGlyphCache::Raster_RGBMask - && state()->composition_mode != QPainter::CompositionMode_Source - && state()->composition_mode != QPainter::CompositionMode_SourceOver) - { - drawCached = false; + if (glyphType == QFontEngineGlyphCache::Raster_RGBMask) { + if (d->deviceHasAlpha || txtype > QTransform::TxTranslate + || (state()->composition_mode != QPainter::CompositionMode_Source + && state()->composition_mode != QPainter::CompositionMode_SourceOver)) + { + glyphType = QFontEngineGlyphCache::Raster_A8; + } } if (drawCached) { @@ -1630,6 +1630,23 @@ 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 && f != GL_RGB5 && f != GL_RGB8); + } + 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 35c88f4..e816e17 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -278,6 +278,7 @@ public: bool needsSync; bool multisamplingAlwaysEnabled; + bool deviceHasAlpha; GLfloat depthRange[2]; diff --git a/src/opengl/qglextensions_p.h b/src/opengl/qglextensions_p.h index f6613fd..4edd5f7 100644 --- a/src/opengl/qglextensions_p.h +++ b/src/opengl/qglextensions_p.h @@ -465,11 +465,11 @@ struct QGLExtensionFuncs #endif #ifndef GL_RGB16 -#define GL_RGB16 32852 +#define GL_RGB16 0x8054 #endif #ifndef GL_UNSIGNED_SHORT_5_6_5 -#define GL_UNSIGNED_SHORT_5_6_5 33635 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 #endif #ifndef GL_UNSIGNED_INT_8_8_8_8_REV |