diff options
author | Tor Arne Vestbø <tor.arne.vestbo@digia.com> | 2014-02-10 13:59:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-19 19:36:25 +0100 |
commit | 4de3c5db238f45404feb6c6ce60810a3e11eae84 (patch) | |
tree | bc0a4d7af2f757fed94c1b52ca6bcd0e74bae25f /src/plugins/platforms | |
parent | 30fd22b9574def54726e7b193127cc0c901c1b4c (diff) |
Unify glyph format between QFontEngine and QFontEngineGlyphCache
Instead of the glyph cache having its own cache type that always mapped
one to one to a font engine glyph format, causing confusion and needless
conversions, the glyph caches now use QFontEngine's glyph format enum.
This also removes the iffy use of an int for the glyphFormat in the font
engines.
Change-Id: I529bad5c179e004f63e152f7dcc311d298c3db98
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/plugins/platforms')
3 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp index 96659c505f..854444b254 100644 --- a/src/plugins/platforms/windows/qwindowsfontdatabase.cpp +++ b/src/plugins/platforms/windows/qwindowsfontdatabase.cpp @@ -1745,7 +1745,7 @@ QFontEngine *QWindowsFontDatabase::createEngine(int script, const QFontDef &requ if (!useDirectWrite) { QWindowsFontEngine *few = new QWindowsFontEngine(request.family, hfont, stockFont, lf, data); if (preferClearTypeAA) - few->glyphFormat = QFontEngineGlyphCache::Raster_RGBMask; + few->glyphFormat = QFontEngine::Format_A32; few->initFontInfo(request, fontHdc, dpi); fe = few; } diff --git a/src/plugins/platforms/windows/qwindowsfontengine.cpp b/src/plugins/platforms/windows/qwindowsfontengine.cpp index 1676b73658..86fcb666b0 100644 --- a/src/plugins/platforms/windows/qwindowsfontengine.cpp +++ b/src/plugins/platforms/windows/qwindowsfontengine.cpp @@ -1148,7 +1148,7 @@ glyph_metrics_t QWindowsFontEngine::alphaMapBoundingBox(glyph_t glyph, QFixed, c { int margin = 0; if (format == QFontEngine::Format_A32 || format == QFontEngine::Format_ARGB) - margin = glyphMargin(QFontEngineGlyphCache::Raster_RGBMask); + margin = glyphMargin(QFontEngine::Format_A32); glyph_metrics_t gm = boundingBox(glyph, matrix); gm.width += margin * 2; gm.height += margin * 2; @@ -1221,7 +1221,7 @@ QImage QWindowsFontEngine::alphaRGBMapForGlyph(glyph_t glyph, QFixed, const QTra SystemParametersInfo(SPI_GETFONTSMOOTHINGCONTRAST, 0, &contrast, 0); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) 1000, 0); - int margin = glyphMargin(QFontEngineGlyphCache::Raster_RGBMask); + int margin = glyphMargin(QFontEngine::Format_A32); QWindowsNativeImage *mask = drawGDIGlyph(font, glyph, margin, t, QImage::Format_RGB32); SystemParametersInfo(SPI_SETFONTSMOOTHINGCONTRAST, 0, (void *) quintptr(contrast), 0); diff --git a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp index ce5ea8167f..1c5e4508ac 100644 --- a/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp +++ b/src/plugins/platforms/windows/qwindowsfontenginedirectwrite.cpp @@ -620,7 +620,7 @@ QImage QWindowsFontEngineDirectWrite::alphaRGBMapForGlyph(glyph_t t, { QImage mask = imageForGlyph(t, subPixelPosition, - glyphMargin(QFontEngineGlyphCache::Raster_RGBMask), + glyphMargin(QFontEngine::Format_A32), xform); return mask.depth() == 32 |