Revert "Add bench for skparagraph"
This reverts commit 1aa25c3217
.
Reason for revert: crashing on windows bots
Original change's description:
> Add bench for skparagraph
>
> Change-Id: Ib33e06527660b33984b9171f51026a935ef99f79
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385156
> Reviewed-by: Julia Lavrova <jlavrova@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
TBR=reed@google.com,jlavrova@google.com
Change-Id: I7b8524c449f3c484b777af31f83e1372a689de55
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/385163
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
parent
1aa25c3217
commit
ead52dc068
@ -1,80 +0,0 @@
|
||||
/*
|
||||
* Copyright 2012 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "bench/Benchmark.h"
|
||||
#include "include/core/SkCanvas.h"
|
||||
#include "include/core/SkFontMgr.h"
|
||||
#include "include/core/SkPaint.h"
|
||||
#include "include/core/SkString.h"
|
||||
#include "tools/Resources.h"
|
||||
|
||||
#include "modules/skparagraph/include/FontCollection.h"
|
||||
#include "modules/skparagraph/include/ParagraphBuilder.h"
|
||||
#include "modules/skparagraph/include/ParagraphStyle.h"
|
||||
|
||||
class ParagraphBench : public Benchmark {
|
||||
SkString fName;
|
||||
sk_sp<skia::textlayout::FontCollection> fFontCollection;
|
||||
skia::textlayout::TextStyle fTStyle;
|
||||
std::unique_ptr<skia::textlayout::Paragraph> fParagraph;
|
||||
|
||||
public:
|
||||
ParagraphBench() {
|
||||
fName.printf("skparagraph");
|
||||
}
|
||||
|
||||
protected:
|
||||
const char* onGetName() override {
|
||||
return fName.c_str();
|
||||
}
|
||||
|
||||
void onDelayedSetup() override {
|
||||
fFontCollection = sk_make_sp<skia::textlayout::FontCollection>();
|
||||
fFontCollection->setDefaultFontManager(SkFontMgr::RefDefault());
|
||||
|
||||
fTStyle.setFontFamilies({SkString("Roboto")});
|
||||
fTStyle.setColor(SK_ColorBLACK);
|
||||
|
||||
const char* text =
|
||||
"This is a very long sentence to test if the text will properly wrap "
|
||||
"around and go to the next line. Sometimes, short sentence. Longer "
|
||||
"sentences are okay too because they are necessary. Very short. "
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
|
||||
"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
|
||||
"veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea "
|
||||
"commodo consequat. Duis aute irure dolor in reprehenderit in voluptate "
|
||||
"velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint "
|
||||
"occaecat cupidatat non proident, sunt in culpa qui officia deserunt "
|
||||
"mollit anim id est laborum. "
|
||||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod "
|
||||
"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim "
|
||||
"veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea "
|
||||
"commodo consequat. Duis aute irure dolor in reprehenderit in voluptate "
|
||||
"velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint "
|
||||
"occaecat cupidatat non proident, sunt in culpa qui officia deserunt "
|
||||
"mollit anim id est laborum.";
|
||||
skia::textlayout::ParagraphStyle paragraph_style;
|
||||
auto builder =
|
||||
skia::textlayout::ParagraphBuilder::make(paragraph_style, fFontCollection);
|
||||
builder->pushStyle(fTStyle);
|
||||
builder->addText(text);
|
||||
builder->pop();
|
||||
fParagraph = builder->Build();
|
||||
}
|
||||
|
||||
void onDraw(int loops, SkCanvas* canvas) override {
|
||||
for (int i = 0; i < loops; ++i) {
|
||||
fParagraph->markDirty();
|
||||
fParagraph->layout(300);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
using INHERITED = Benchmark;
|
||||
};
|
||||
|
||||
DEF_BENCH( return new ParagraphBench; )
|
@ -78,7 +78,6 @@ bench_sources = [
|
||||
"$_bench/MorphologyBench.cpp",
|
||||
"$_bench/MutexBench.cpp",
|
||||
"$_bench/PDFBench.cpp",
|
||||
"$_bench/ParagraphBench.cpp",
|
||||
"$_bench/PatchBench.cpp",
|
||||
"$_bench/PathBench.cpp",
|
||||
"$_bench/PathIterBench.cpp",
|
||||
|
Loading…
Reference in New Issue
Block a user