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

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

Issue 2845883002: [LayoutNG] Add NG-specific DrawText support to GraphicsContext (Closed)
Patch Set: Created 3 years, 8 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 7ee449ce36e1eb0193a68afc4900a710af7e1304..8184d896f2524c3aedd11c9bedff17912a1ae365 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -246,6 +246,27 @@ void Font::DrawEmphasisMarks(PaintCanvas* canvas,
DrawBlobs(canvas, flags, bloberizer.Blobs(), point);
}
+void Font::DrawEmphasisMarks(PaintCanvas* canvas,
+ const TextFragmentPaintInfo& text_info,
+ const AtomicString& mark,
+ const FloatPoint& point,
+ float device_scale_factor,
+ const PaintFlags& flags) const {
+ if (ShouldSkipDrawing())
+ return;
+
+ FontCachePurgePreventer purge_preventer;
+ const auto emphasis_glyph_data = GetEmphasisMarkGlyphData(mark);
+ if (!emphasis_glyph_data.font_data)
+ return;
+
+ ShapeResultBloberizer bloberizer(*this, device_scale_factor);
+ bloberizer.FillTextEmphasisGlyphs(
+ text_info.text, text_info.direction, text_info.from, text_info.to,
+ emphasis_glyph_data, text_info.shape_result);
+ DrawBlobs(canvas, flags, bloberizer.Blobs(), point);
+}
+
float Font::Width(const TextRun& run,
HashSet<const SimpleFontData*>* fallback_fonts,
FloatRect* glyph_bounds) const {

Powered by Google App Engine
This is Rietveld 408576698