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

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: Rebase Created 5 years, 4 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 79cd286b0a6f9c96bf9ded2cf1911cadcc313c6f..2c1d072e7beb001fddfe7f7c04c270e5fcbdb665 100644
--- a/Source/platform/fonts/shaping/CachingWordShaper.cpp
+++ b/Source/platform/fonts/shaping/CachingWordShaper.cpp
@@ -86,6 +86,14 @@ static inline float shapeResultsForRun(ShapeCache* shapeCache, const Font* font,
return totalWidth;
}
+int CachingWordShaper::offsetForPosition(const Font* font, const TextRun& run, float targetX)
+{
+ Vector<RefPtr<ShapeResult>> results;
+ shapeResultsForRun(m_shapeCache.get(), font, run, nullptr, &results);
+
+ return ShapeResult::offsetForPosition(results, run, targetX);
+}
+
float CachingWordShaper::fillGlyphBuffer(const Font* font, const TextRun& run,
HashSet<const SimpleFontData*>* fallbackFonts,
GlyphBuffer* glyphBuffer, unsigned from, unsigned to)

Powered by Google App Engine
This is Rietveld 408576698