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

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

Issue 2835103002: Move blobalizer implementation to ShapeResultBloberizer (Closed)
Patch Set: Fix canvas tests 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 df1d2049344cb282b8b4f940da250396e43028e9..22416732a678ea7e25d4a31cbdcbd89a1be97cd5 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -142,7 +142,10 @@ bool Font::DrawText(PaintCanvas* canvas,
return false;
ShapeResultBloberizer bloberizer(*this, device_scale_factor);
- CachingWordShaper(*this).FillGlyphs(run_info, bloberizer);
+ CachingWordShaper word_shaper(*this);
+ ShapeResultBuffer buffer;
+ word_shaper.FillResultBuffer(run_info, &buffer);
+ bloberizer.FillGlyphs(run_info, buffer);
DrawBlobs(canvas, flags, bloberizer.Blobs(), point);
return true;
}
@@ -178,6 +181,7 @@ bool Font::DrawBidiText(PaintCanvas* canvas,
FloatPoint curr_point = point;
BidiCharacterRun* bidi_run = bidi_runs.FirstRun();
+ CachingWordShaper word_shaper(*this);
while (bidi_run) {
TextRun subrun =
run.SubRun(bidi_run->Start(), bidi_run->Stop() - bidi_run->Start());
@@ -189,8 +193,9 @@ bool Font::DrawBidiText(PaintCanvas* canvas,
subrun_info.bounds = run_info.bounds;
ShapeResultBloberizer bloberizer(*this, device_scale_factor);
- float run_width =
- CachingWordShaper(*this).FillGlyphs(subrun_info, bloberizer);
+ ShapeResultBuffer buffer;
+ word_shaper.FillResultBuffer(subrun_info, &buffer);
+ float run_width = bloberizer.FillGlyphs(subrun_info, buffer);
DrawBlobs(canvas, flags, bloberizer.Blobs(), curr_point);
bidi_run = bidi_run->Next();
@@ -217,8 +222,10 @@ void Font::DrawEmphasisMarks(PaintCanvas* canvas,
return;
ShapeResultBloberizer bloberizer(*this, device_scale_factor);
- CachingWordShaper(*this).FillTextEmphasisGlyphs(run_info, emphasis_glyph_data,
- bloberizer);
+ CachingWordShaper word_shaper(*this);
+ ShapeResultBuffer buffer;
+ word_shaper.FillResultBuffer(run_info, &buffer);
+ bloberizer.FillTextEmphasisGlyphs(run_info, emphasis_glyph_data, buffer);
DrawBlobs(canvas, flags, bloberizer.Blobs(), point);
}
@@ -267,7 +274,12 @@ void Font::GetTextIntercepts(const TextRunPaintInfo& run_info,
ShapeResultBloberizer bloberizer(
*this, device_scale_factor, ShapeResultBloberizer::Type::kTextIntercepts);
- CachingWordShaper(*this).FillGlyphs(run_info, bloberizer);
+
+ CachingWordShaper word_shaper(*this);
+ ShapeResultBuffer buffer;
+ word_shaper.FillResultBuffer(run_info, &buffer);
+ bloberizer.FillGlyphs(run_info, buffer);
+
const auto& blobs = bloberizer.Blobs();
// Get the number of intervals, without copying the actual values by
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/fonts/shaping/CachingWordShaper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698