summaryrefslogtreecommitdiffstats
path: root/src/platformsupport
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@qt.io>2016-06-30 16:21:59 -0700
committerGabriel de Dietrich <gabriel.dedietrich@qt.io>2016-07-06 17:37:24 +0000
commit16fefc258ec022b0c6828c70741c2c8c43a01f12 (patch)
tree6e67fedb306c24308e84c06e69f9f120f2b0e1b6 /src/platformsupport
parent9d620483c6b9ac0ba15bb3c8ea2482a09202f1a1 (diff)
Remove QCoreTextFontEngine::supportsColorGlyphs
This is always true on the versions we currently support. Change-Id: I1aecbbd1f41e0f4f03b380358cd762ca00bb1e97 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/platformsupport')
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm3
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm9
-rw-r--r--src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h15
3 files changed, 3 insertions, 24 deletions
diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
index 0b9e7a7fe0..566abf2126 100644
--- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
+++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
@@ -588,8 +588,7 @@ QStringList QCoreTextFontDatabase::fallbacksForFamily(const QString &family, QFo
fallbackList.append(familyNameFromPostScriptName(item));
}
- if (QCoreTextFontEngine::supportsColorGlyphs())
- fallbackList.append(QLatin1String("Apple Color Emoji"));
+ fallbackList.append(QLatin1String("Apple Color Emoji"));
// Since we are only returning a list of default fonts for the current language, we do not
// cover all unicode completely. This was especially an issue for some of the common script
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
index 703ec3a8b8..7b459584ea 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -218,11 +218,9 @@ void QCoreTextFontEngine::init()
synthesisFlags = 0;
CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ctfont);
-#if defined(Q_OS_IOS) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
- if (supportsColorGlyphs() && (traits & kCTFontColorGlyphsTrait))
+ if (traits & kCTFontColorGlyphsTrait)
glyphFormat = QFontEngine::Format_ARGB;
else
-#endif
glyphFormat = defaultGlyphFormat;
if (traits & kCTFontItalicTrait)
@@ -648,9 +646,7 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
CGContextSetTextPosition(ctx, pos_x + 0.5 * lineThickness().toReal(), pos_y);
CGContextShowGlyphsWithAdvances(ctx, &cgGlyph, &CGSizeZero, 1);
}
- }
-#if defined(Q_OS_IOS) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
- else if (supportsColorGlyphs()) {
+ } else {
// CGContextSetTextMatrix does not work with color glyphs, so we use
// the CTM instead. This means we must translate the CTM as well, to
// set the glyph position, instead of using CGContextSetTextPosition.
@@ -661,7 +657,6 @@ QImage QCoreTextFontEngine::imageForGlyph(glyph_t glyph, QFixed subPixelPosition
// glyphs in the Apple Color Emoji font, so we use CTFontDrawGlyphs instead.
CTFontDrawGlyphs(ctfont, &cgGlyph, &CGPointZero, 1, ctx);
}
-#endif
CGContextRelease(ctx);
CGColorSpaceRelease(colorspace);
diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
index 746c9051a0..0cfa6ed6d3 100644
--- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -106,21 +106,6 @@ public:
QFontEngine::Properties properties() const Q_DECL_OVERRIDE;
- static bool supportsColorGlyphs()
- {
-#if defined(Q_OS_IOS)
- return true;
-#elif MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
- #if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
- return &CTFontDrawGlyphs;
- #else
- return true;
- #endif
-#else
- return false;
-#endif
- }
-
static bool ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length);
static QFont::Weight qtWeightFromCFWeight(float value);