Merge pull request #15586 from Snuffleupagus/rm-matchesForCache
Remove the `Glyph.matchesForCache` method (PR 13494 follow-up)
This commit is contained in:
commit
36967fcedb
@ -218,30 +218,6 @@ class Glyph {
|
||||
this.isZeroWidthDiacritic = category.isZeroWidthDiacritic;
|
||||
this.isInvisibleFormatMark = category.isInvisibleFormatMark;
|
||||
}
|
||||
|
||||
matchesForCache(
|
||||
originalCharCode,
|
||||
fontChar,
|
||||
unicode,
|
||||
accent,
|
||||
width,
|
||||
vmetric,
|
||||
operatorListId,
|
||||
isSpace,
|
||||
isInFont
|
||||
) {
|
||||
return (
|
||||
this.originalCharCode === originalCharCode &&
|
||||
this.fontChar === fontChar &&
|
||||
this.unicode === unicode &&
|
||||
this.accent === accent &&
|
||||
this.width === width &&
|
||||
this.vmetric === vmetric &&
|
||||
this.operatorListId === operatorListId &&
|
||||
this.isSpace === isSpace &&
|
||||
this.isInFont === isInFont
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
function int16(b0, b1) {
|
||||
@ -3249,6 +3225,12 @@ class Font {
|
||||
* @private
|
||||
*/
|
||||
_charToGlyph(charcode, isSpace = false) {
|
||||
let glyph = this._glyphCache[charcode];
|
||||
// All `Glyph`-properties, except `isSpace` in multi-byte strings,
|
||||
// depend indirectly on the `charcode`.
|
||||
if (glyph && glyph.isSpace === isSpace) {
|
||||
return glyph;
|
||||
}
|
||||
let fontCharCode, width, operatorListId;
|
||||
|
||||
let widthCode = charcode;
|
||||
@ -3313,35 +3295,18 @@ class Font {
|
||||
}
|
||||
}
|
||||
|
||||
let glyph = this._glyphCache[charcode];
|
||||
if (
|
||||
!glyph ||
|
||||
!glyph.matchesForCache(
|
||||
charcode,
|
||||
fontChar,
|
||||
unicode,
|
||||
accent,
|
||||
width,
|
||||
vmetric,
|
||||
operatorListId,
|
||||
isSpace,
|
||||
isInFont
|
||||
)
|
||||
) {
|
||||
glyph = new Glyph(
|
||||
charcode,
|
||||
fontChar,
|
||||
unicode,
|
||||
accent,
|
||||
width,
|
||||
vmetric,
|
||||
operatorListId,
|
||||
isSpace,
|
||||
isInFont
|
||||
);
|
||||
this._glyphCache[charcode] = glyph;
|
||||
}
|
||||
return glyph;
|
||||
glyph = new Glyph(
|
||||
charcode,
|
||||
fontChar,
|
||||
unicode,
|
||||
accent,
|
||||
width,
|
||||
vmetric,
|
||||
operatorListId,
|
||||
isSpace,
|
||||
isInFont
|
||||
);
|
||||
return (this._glyphCache[charcode] = glyph);
|
||||
}
|
||||
|
||||
charsToGlyphs(chars) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user