summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qtextureglyphcache.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-03-20 13:46:57 +0100
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2013-03-20 13:49:28 +0100
commit76c0be34cd4ff4564693162fa7528463e23ce9d8 (patch)
treef165b7bc319548fb0082365411a871028f92e89e /src/gui/painting/qtextureglyphcache.cpp
parent27b4fe96b59e9e63d1e570e802c072e9afdfb2d4 (diff)
parent36cb3f3f655a9090c82de609010cbfb88651a0f3 (diff)
Merge branch 'dev' into stable
This starts Qt 5.1 release cycle Conflicts: src/gui/text/qfontdatabase.cpp src/gui/text/qharfbuzz_copy_p.h src/widgets/kernel/qapplication.cpp src/widgets/kernel/qcoreapplication.cpp Change-Id: I72fbf83ab3c2206aeea1b089428b0fc2a89bd62b
Diffstat (limited to 'src/gui/painting/qtextureglyphcache.cpp')
-rw-r--r--src/gui/painting/qtextureglyphcache.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp
index ed0473749e..6676d3daa6 100644
--- a/src/gui/painting/qtextureglyphcache.cpp
+++ b/src/gui/painting/qtextureglyphcache.cpp
@@ -135,6 +135,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
switch (m_type) {
case Raster_A8: format = QFontEngine::Format_A8; break;
case Raster_RGBMask: format = QFontEngine::Format_A32; break;
+ case Raster_ARGB: format = QFontEngine::Format_ARGB; break;
default: format = QFontEngine::Format_Mono; break;
}
@@ -163,7 +164,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const
metrics.yoff.toReal(),
metrics.x.toReal(),
metrics.y.toReal());
-#endif
+#endif
GlyphAndSubPixelPosition key(glyph, subPixelPosition);
int glyph_width = metrics.width.ceil().toInt();
int glyph_height = metrics.height.ceil().toInt();
@@ -281,6 +282,8 @@ QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition
{
if (m_type == QFontEngineGlyphCache::Raster_RGBMask)
return m_current_fontengine->alphaRGBMapForGlyph(g, subPixelPosition, m_transform);
+ else if (m_type == QFontEngineGlyphCache::Raster_ARGB)
+ return m_current_fontengine->bitmapForGlyph(g, subPixelPosition, m_transform);
return m_current_fontengine->alphaMapForGlyph(g, subPixelPosition, m_transform);
}
@@ -312,6 +315,7 @@ void QImageTextureGlyphCache::createTextureData(int width, int height)
m_image = QImage(width, height, QImage::Format_RGB32);
break;
case QFontEngineGlyphCache::Raster_ARGB:
+ m_image = QImage(width, height, QImage::Format_ARGB32_Premultiplied);
break;
}
}
@@ -328,7 +332,8 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP
}
#endif
- if (m_type == QFontEngineGlyphCache::Raster_RGBMask) {
+ if (m_type == QFontEngineGlyphCache::Raster_RGBMask
+ || m_type == QFontEngineGlyphCache::Raster_ARGB) {
QImage ref(m_image.bits() + (c.x * 4 + c.y * m_image.bytesPerLine()),
qMax(mask.width(), c.w), qMax(mask.height(), c.h), m_image.bytesPerLine(),
m_image.format());