Title: [212274] trunk/Source/WebCore
- Revision
- 212274
- Author
- [email protected]
- Date
- 2017-02-13 19:27:17 -0800 (Mon, 13 Feb 2017)
Log Message
FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
https://bugs.webkit.org/show_bug.cgi?id=168251
<rdar://problem/30498102>
Reviewed by Antti Koivisto.
Covered by existing (perf)tests.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::widthForSimpleText):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (212273 => 212274)
--- trunk/Source/WebCore/ChangeLog 2017-02-14 02:29:38 UTC (rev 212273)
+++ trunk/Source/WebCore/ChangeLog 2017-02-14 03:27:17 UTC (rev 212274)
@@ -1,3 +1,16 @@
+2017-02-13 Zalan Bujtas <[email protected]>
+
+ FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
+ https://bugs.webkit.org/show_bug.cgi?id=168251
+ <rdar://problem/30498102>
+
+ Reviewed by Antti Koivisto.
+
+ Covered by existing (perf)tests.
+
+ * platform/graphics/FontCascade.cpp:
+ (WebCore::FontCascade::widthForSimpleText):
+
2017-02-12 Brian Burg <[email protected]>
Web Inspector: expose system user interface layout direction through InspectorFrontendHost
Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (212273 => 212274)
--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2017-02-14 02:29:38 UTC (rev 212273)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp 2017-02-14 03:27:17 UTC (rev 212274)
@@ -389,9 +389,15 @@
Vector<GlyphBufferGlyph, 16> glyphs;
Vector<GlyphBufferAdvance, 16> advances;
+ bool hasKerningOrLigatures = enableKerning() || requiresShaping();
+ float runWidth = 0;
auto& font = primaryFont();
for (unsigned i = 0; i < text.length(); ++i) {
auto glyph = glyphDataForCharacter(text[i], false).glyph;
+ auto glyphWidth = font.widthForGlyph(glyph);
+ runWidth += glyphWidth;
+ if (!hasKerningOrLigatures)
+ continue;
#if USE(CAIRO)
cairo_glyph_t cairoGlyph;
cairoGlyph.index = glyph;
@@ -399,12 +405,14 @@
#else
glyphs.append(glyph);
#endif
- advances.append(FloatSize(font.widthForGlyph(glyph), 0));
+ advances.append(FloatSize(glyphWidth, 0));
}
- font.applyTransforms(&glyphs[0], &advances[0], glyphs.size(), enableKerning(), requiresShaping());
- float runWidth = 0;
- for (auto& advance : advances)
- runWidth += advance.width();
+ if (hasKerningOrLigatures) {
+ font.applyTransforms(&glyphs[0], &advances[0], glyphs.size(), enableKerning(), requiresShaping());
+ runWidth = 0;
+ for (auto& advance : advances)
+ runWidth += advance.width();
+ }
if (cacheEntry)
*cacheEntry = runWidth;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes