Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(753)

Unified Diff: Source/core/svg/SVGFontElement.h

Issue 181443002: Use glyph-ids for lookups of SVG font kerning-pairs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Vector<...>::append -> Vector<...>::appendVector. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGFontData.cpp ('k') | Source/core/svg/SVGFontElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFontElement.h
diff --git a/Source/core/svg/SVGFontElement.h b/Source/core/svg/SVGFontElement.h
index c0cea8c9cd1d8554077fd91d42618c6c083541f5..5644c6ebcea2225566fd59ff1cf4741c36a0f602 100644
--- a/Source/core/svg/SVGFontElement.h
+++ b/Source/core/svg/SVGFontElement.h
@@ -47,7 +47,9 @@ struct SVGKerningPair {
}
};
+typedef unsigned KerningPairKey;
typedef Vector<SVGKerningPair> KerningPairVector;
+typedef HashMap<KerningPairKey, float> KerningTable;
class SVGMissingGlyphElement;
@@ -57,10 +59,10 @@ public:
void invalidateGlyphCache();
void collectGlyphsForString(const String&, Vector<SVGGlyph>&);
- void collectGlyphsForGlyphName(const String&, Vector<SVGGlyph>&);
+ void collectGlyphsForAltGlyphReference(const String&, Vector<SVGGlyph>&);
- float horizontalKerningForPairOfStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2) const;
- float verticalKerningForPairOfStringsAndGlyphs(const String& u1, const String& g1, const String& u2, const String& g2) const;
+ float horizontalKerningForPairOfGlyphs(Glyph, Glyph) const;
+ float verticalKerningForPairOfGlyphs(Glyph, Glyph) const;
// Used by SimpleFontData/WidthIterator.
SVGGlyph svgGlyphForGlyph(Glyph);
@@ -75,12 +77,15 @@ private:
void ensureGlyphCache();
void registerLigaturesInGlyphCache(Vector<String>&);
+ Vector<SVGGlyph> buildGlyphList(const UnicodeRanges&, const HashSet<String>& unicodeNames, const HashSet<String>& glyphNames) const;
+ void addPairsToKerningTable(const SVGKerningPair&, KerningTable&);
+ void buildKerningTable(const KerningPairVector&, KerningTable&);
BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGFontElement)
END_DECLARE_ANIMATED_PROPERTIES
- KerningPairVector m_horizontalKerningPairs;
- KerningPairVector m_verticalKerningPairs;
+ KerningTable m_horizontalKerningTable;
+ KerningTable m_verticalKerningTable;
SVGGlyphMap m_glyphMap;
Glyph m_missingGlyph;
bool m_isGlyphCacheValid;
« no previous file with comments | « Source/core/svg/SVGFontData.cpp ('k') | Source/core/svg/SVGFontElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698