From 01b72952c38b9193138eabdab6bdab632cd75ebd Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Tue, 28 Jun 2011 15:08:12 +0200 Subject: Remove QPainter::UniteClip Change-Id: I5413cb5e2cbb53998bb40f27b9bbc16342caafe6 Reviewed-on: http://codereview.qt.nokia.com/837 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- .../gl2paintengineex/qpaintengineex_opengl2.cpp | 35 ---------------------- 1 file changed, 35 deletions(-) (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp') diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 3ac759c7ec..a07b8b0b07 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -2319,41 +2319,6 @@ void QGL2PaintEngineEx::clip(const QVectorPath &path, Qt::ClipOperation op) state()->currentClip = d->maxClip; state()->clipTestEnabled = true; break; - case Qt::UniteClip: { - d->resetClipIfNeeded(); - ++d->maxClip; - if (state()->rectangleClip.isValid()) { - QPainterPath path; - path.addRect(state()->rectangleClip); - - // flush the existing clip rectangle to the depth buffer - d->writeClip(qtVectorPathForPath(state()->matrix.inverted().map(path)), d->maxClip); - } - - state()->clipTestEnabled = false; -#ifndef QT_GL_NO_SCISSOR_TEST - QRect oldRectangleClip = state()->rectangleClip; - - state()->rectangleClip = state()->rectangleClip.united(pathRect); - d->updateClipScissorTest(); - - QRegion extendRegion = QRegion(state()->rectangleClip) - oldRectangleClip; - - if (!extendRegion.isEmpty()) { - QPainterPath extendPath; - extendPath.addRegion(extendRegion); - - // first clear the depth buffer in the extended region - d->writeClip(qtVectorPathForPath(state()->matrix.inverted().map(extendPath)), 0); - } -#endif - // now write the clip path - d->writeClip(path, d->maxClip); - state()->canRestoreClip = false; - state()->currentClip = d->maxClip; - state()->clipTestEnabled = true; - break; - } default: break; } -- cgit v1.2.3 From d010d0893a8796e2973327a06f71988ea5fde14d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 5 Jul 2011 10:33:59 +0200 Subject: Don't issue GL calls when the geometry is empty This works as a band-aid and optimization for QT-5104, because in the text in the example, which contains latin text and has a latin default font set, will think of all spaces between the cyrillic characters as latin characters, hence it will make separate text items for them and issue separate glDrawElements() calls. By cutting off if there are no glyphs to draw, we can avoid hitting the actual bug for this and several other use cases, making it less likely to happen. Task-number: QT-5104 Reviewed-by: Samuel (cherry picked from commit f51b5fe09c63e4b3c2ab5a4d06e162c43d38207d) Change-Id: Id80f55ce403a7aa112c3abb314d080aa43c0078b Reviewed-on: http://codereview.qt.nokia.com/1158 Reviewed-by: Qt Sanity Bot Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp') diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index a07b8b0b07..cf5fddbf84 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -1692,6 +1692,8 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QFontEngineGlyphCache::Type glyp } int numGlyphs = vertexCoordinates->vertexCount() / 4; + if (numGlyphs == 0) + return; if (elementIndices.size() < numGlyphs*6) { Q_ASSERT(elementIndices.size() % 6 == 0); -- cgit v1.2.3