CoreText: Remove handling of QFontEngineMulti's highByte

It's a leftover from when the Cocoa plugin used QFontEngineMulti
exclusively. Nowadays QFontEngineMulti will strip out the highByte
before calling into the real engine. Left an assert just in case..

Change-Id: I6cb26d20a908d7c3aaf096297fca160805fdb85b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Tor Arne Vestbø 2018-11-26 23:01:50 +01:00
parent eab84914f1
commit b926d5f919
3 changed files with 8 additions and 13 deletions

View File

@ -1755,7 +1755,7 @@ QImage QFontEngineBox::alphaMapForGlyph(glyph_t)
// Multi engine
// ------------------------------------------------------------------
static inline uchar highByte(glyph_t glyph)
uchar QFontEngineMulti::highByte(glyph_t glyph)
{ return glyph >> 24; }
// strip high byte from glyph

View File

@ -485,6 +485,8 @@ public:
void setFallbackFamiliesList(const QStringList &fallbackFamilies);
static uchar highByte(glyph_t glyph); // Used for determining engine
inline QFontEngine *engine(int at) const
{ Q_ASSERT(at < m_engines.size()); return m_engines.at(at); }

View File

@ -885,10 +885,8 @@ void QCoreTextFontEngine::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::Shap
QVarLengthArray<CGGlyph> cgGlyphs(numGlyphs);
for (int i = 0; i < numGlyphs; ++i) {
if (glyphs->glyphs[i] & 0xff000000)
cgGlyphs[i] = 0;
else
cgGlyphs[i] = glyphs->glyphs[i];
Q_ASSERT(!QFontEngineMulti::highByte(glyphs->glyphs[i]));
cgGlyphs[i] = glyphs->glyphs[i];
}
loadAdvancesForGlyphs(cgGlyphs, glyphs);
@ -901,14 +899,9 @@ void QCoreTextFontEngine::loadAdvancesForGlyphs(QVarLengthArray<CGGlyph> &cgGlyp
CTFontGetAdvancesForGlyphs(ctfont, kCTFontOrientationHorizontal, cgGlyphs.data(), advances.data(), numGlyphs);
for (int i = 0; i < numGlyphs; ++i) {
if (glyphs->glyphs[i] & 0xff000000)
continue;
glyphs->advances[i] = QFixed::fromReal(advances[i].width);
}
if (fontDef.styleStrategy & QFont::ForceIntegerMetrics) {
for (int i = 0; i < numGlyphs; ++i)
glyphs->advances[i] = glyphs->advances[i].round();
QFixed advance = QFixed::fromReal(advances[i].width);
glyphs->advances[i] = fontDef.styleStrategy & QFont::ForceIntegerMetrics
? advance.round() : advance;
}
}