summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-11-24 09:09:15 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-01-14 13:06:48 (GMT)
commit378c08e56110b2a57c0112e5bfb189e28cc8e88f (patch)
treeb1b9c96bf9676c8a23d688827cd34499de5342b3 /src/opengl
parentbf919e06127962836a6b566bf119cf248c6a999b (diff)
downloadQt-378c08e56110b2a57c0112e5bfb189e28cc8e88f.zip
Qt-378c08e56110b2a57c0112e5bfb189e28cc8e88f.tar.gz
Qt-378c08e56110b2a57c0112e5bfb189e28cc8e88f.tar.bz2
Compile
Update the code to compile with merged changes.
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp17
-rw-r--r--src/opengl/qpaintengine_opengl.cpp2
2 files changed, 17 insertions, 2 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 35087d2..638e4d3 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -1194,6 +1194,21 @@ void QGL2PaintEngineEx::drawImage(const QRectF& dest, const QImage& image, const
d->drawTexture(dest, src, image.size(), !image.hasAlphaChannel());
}
+void QGL2PaintEngineEx::drawStaticTextItem(QStaticTextItem *textItem)
+{
+ Q_D(QGL2PaintEngineEx);
+
+ ensureActive();
+
+ QFontEngineGlyphCache::Type glyphType = textItem->fontEngine->glyphFormat >= 0
+ ? QFontEngineGlyphCache::Type(textItem->fontEngine->glyphFormat)
+ : d->glyphCacheType;
+
+ // ### What about transformations and huge fonts? These are not passed through cache
+ // in drawTextItem().
+ d->drawCachedGlyphs(glyphType, textItem);
+}
+
void QGL2PaintEngineEx::drawTexture(const QRectF &dest, GLuint textureId, const QSize &size, const QRectF &src)
{
Q_D(QGL2PaintEngineEx);
@@ -1389,7 +1404,7 @@ void QGL2PaintEngineExPrivate::drawCachedGlyphs(QStaticTextItem *staticTextItem)
updateTextureFilter(GL_TEXTURE_2D, GL_REPEAT, false);
shaderManager->currentProgram()->setUniformValue(location(QGLEngineShaderManager::MaskTexture), QT_MASK_TEXTURE_UNIT);
- glDrawArrays(GL_TRIANGLES, 0, 6 * glyphs.size());
+ glDrawArrays(GL_TRIANGLES, 0, 6 * staticTextItem->numGlyphs);
shaderManager->setMaskType(QGLEngineShaderManager::SubPixelMaskPass2);
diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp
index d6175e9..fecbc45 100644
--- a/src/opengl/qpaintengine_opengl.cpp
+++ b/src/opengl/qpaintengine_opengl.cpp
@@ -4828,7 +4828,7 @@ void QGLGlyphCache::cacheGlyphs(QGLContext *context, QFontEngine *fontEngine,
}
QImage glyph_im(fontEngine->alphaMapForGlyph(glyphs[i]));
- glyph_im = glyph_im.convertToFormat(QImage::Format_Indexed8);
+ glyph_im = glyph_im.convertToFormat(QImage::Format_Indexed8);
glyph_width = glyph_im.width();
Q_ASSERT(glyph_width >= 0);
// pad the glyph width to an even number