Do not pass full buffer to minikin for big performance improvements.
Change-Id: I411d6168e45204774d4776aa241feeaf19dad818
This commit is contained in:
@@ -270,9 +270,13 @@ static void BM_ParagraphSkTextBlobAlloc(benchmark::State& state) {
|
||||
|
||||
while (state.KeepRunning()) {
|
||||
SkTextBlobBuilder builder;
|
||||
builder.allocRunPos(paint, 100);
|
||||
builder.allocRunPos(paint, state.range(0));
|
||||
}
|
||||
state.SetComplexityN(state.range(0));
|
||||
}
|
||||
BENCHMARK(BM_ParagraphSkTextBlobAlloc);
|
||||
BENCHMARK(BM_ParagraphSkTextBlobAlloc)
|
||||
->RangeMultiplier(4)
|
||||
->Range(1 << 7, 1 << 14)
|
||||
->Complexity(benchmark::oN);
|
||||
|
||||
} // namespace txt
|
||||
|
||||
@@ -300,8 +300,8 @@ void Paragraph::Layout(double width, bool force) {
|
||||
const size_t layout_end = std::min(run.end, next_break);
|
||||
|
||||
bool bidiFlags = paragraph_style_.rtl;
|
||||
layout.doLayout(text_.data(), layout_start, layout_end - layout_start,
|
||||
text_.size(), bidiFlags, font, minikin_paint,
|
||||
layout.doLayout(text_.data() + layout_start, 0, layout_end - layout_start,
|
||||
layout_end - layout_start, bidiFlags, font, minikin_paint,
|
||||
font_collection_->GetMinikinFontCollectionForFamily(
|
||||
run.style.font_family));
|
||||
FillWhitespaceSet(layout_start, layout_end,
|
||||
|
||||
Reference in New Issue
Block a user