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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.cpp

Issue 1773403002: Update SVG text layout to use shaped glyph data & go fast (O(n^2)->O(n)) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1773353003
Patch Set: Fix TestExpectations collision Created 4 years, 9 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
Index: third_party/WebKit/Source/platform/fonts/Font.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index 8329e5022966cb22a5eed11045e765c0396b551b..e8e64d36e5f4c38ad424d40881db277279983de9 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -752,6 +752,19 @@ FloatRect Font::selectionRectForComplexText(const TextRun& run,
return FloatRect(point.x() + range.start, point.y(), range.width(), height);
}
+Vector<CharacterRange> Font::individualCharacterRanges(const TextRun& run,
+ int from, int to) const
+{
+ // TODO(pdr): Android is temporarily (crbug.com/577306) using the old simple
+ // shaper and using the complex shaper here can show differences between
+ // the two shapers. This function is currently only called through SVG
+ // which now exclusively uses the complex shaper, so the primary difference
+ // will be improved shaping in SVG when compared to HTML.
+ FontCachePurgePreventer purgePreventer;
+ CachingWordShaper shaper(m_fontFallbackList->shapeCache(m_fontDescription));
+ return shaper.individualCharacterRanges(this, run, from, to);
+}
+
float Font::floatWidthForSimpleText(const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts, FloatRect* glyphBounds) const
{
SimpleShaper shaper(this, run, nullptr, fallbackFonts, glyphBounds);
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/Font.h ('k') | third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698