Commit 262d289b authored by Emil A Eklund's avatar Emil A Eklund Committed by Commit Bot

Update ShapingLineBreaker performance test

Modify ShapingLineBreaker performance test to include the paragraph text
shaping operation in the timing rather than just the time for each line.

Change-Id: I3f23333e17251a9640c5337171c8883c964bb9c2
Reviewed-on: https://chromium-review.googlesource.com/1132822
Commit-Queue: Koji Ishii <kojii@chromium.org>
Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574088}
parent 5a461732
...@@ -125,15 +125,20 @@ TEST_F(ShapingLineBreakerPerfTest, ShapeLatinText) { ...@@ -125,15 +125,20 @@ TEST_F(ShapingLineBreakerPerfTest, ShapeLatinText) {
TextDirection direction = TextDirection::kLtr; TextDirection direction = TextDirection::kLtr;
HarfBuzzShaper shaper(string.Characters16(), len); HarfBuzzShaper shaper(string.Characters16(), len);
scoped_refptr<ShapeResult> result = shaper.Shape(&font, direction); scoped_refptr<ShapeResult> reference_result = shaper.Shape(&font, direction);
ShapingLineBreaker breaker(&shaper, &font, result.get(), &break_iterator); ShapingLineBreaker reference_breaker(&shaper, &font, reference_result.get(),
&break_iterator);
scoped_refptr<ShapeResult> line; scoped_refptr<ShapeResult> line;
LayoutUnit available_width_px(500); LayoutUnit available_width_px(500);
LayoutUnit expected_width =
ShapeText(&reference_breaker, available_width_px, len);
LayoutUnit expected_width = ShapeText(&breaker, available_width_px, len);
timer_.Reset(); timer_.Reset();
do { do {
scoped_refptr<ShapeResult> result = shaper.Shape(&font, direction);
ShapingLineBreaker breaker(&shaper, &font, result.get(), &break_iterator);
LayoutUnit width = ShapeText(&breaker, available_width_px, len); LayoutUnit width = ShapeText(&breaker, available_width_px, len);
EXPECT_EQ(expected_width, width); EXPECT_EQ(expected_width, width);
timer_.NextLap(); timer_.NextLap();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment