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

Unified Diff: Source/platform/fonts/shaping/CachingWordShaper.cpp

Issue 1248453004: Change Font::offsetForPositionForComplexText to use CachingWordShapeIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: TestExpectations and rebase Created 5 years, 5 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: Source/platform/fonts/shaping/CachingWordShaper.cpp
diff --git a/Source/platform/fonts/shaping/CachingWordShaper.cpp b/Source/platform/fonts/shaping/CachingWordShaper.cpp
index b9b2d77c9bad48c9dcf3cb0b6bdb9bb6fc0b6e61..087f885a193ca239553ae833b4cf7237c163e99c 100644
--- a/Source/platform/fonts/shaping/CachingWordShaper.cpp
+++ b/Source/platform/fonts/shaping/CachingWordShaper.cpp
@@ -68,6 +68,13 @@ float CachingWordShaper::width(const Font* font, const TextRun& run,
return width;
}
+int CachingWordShaper::offsetForPosition(const Font* font, const TextRun& run, float targetX)
+{
+ HashSet<const SimpleFontData*> fallbackFonts;
+ CachingWordShapeIterator iterator(m_shapeCache, run, font, &fallbackFonts);
+ return ShapeResult::offsetForPosition(iterator, run, targetX);
+}
+
static inline float shapeResultsForRun(ShapeCache* shapeCache, const Font* font,
const TextRun& run, HashSet<const SimpleFontData*>* fallbackFonts,
Vector<RefPtr<ShapeResult>>* results)

Powered by Google App Engine
This is Rietveld 408576698