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

Unified Diff: bench/TextBlobBench.cpp

Issue 1144023002: Move font loading in gm tests and benches out of constructors (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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: bench/TextBlobBench.cpp
diff --git a/bench/TextBlobBench.cpp b/bench/TextBlobBench.cpp
index 1f4b2b7120d5d7ca076da3f184f3d1665a11a784..ae71a1e41ab8d63a9d9e04995d2bac389a19880d 100644
--- a/bench/TextBlobBench.cpp
+++ b/bench/TextBlobBench.cpp
@@ -25,7 +25,12 @@
class TextBlobBench : public Benchmark {
public:
TextBlobBench()
- : fTypeface(sk_tool_utils::create_portable_typeface("Times", SkTypeface::kNormal)) {
+ : fTypeface(NULL) {
+ }
+
+protected:
+ void onPreDraw() override {
+ fTypeface.reset(sk_tool_utils::create_portable_typeface("Times", SkTypeface::kNormal));
// make textblob
SkPaint paint;
paint.setTypeface(fTypeface);
@@ -45,7 +50,6 @@ public:
fBlob.reset(builder.build());
}
-protected:
const char* onGetName() {
return "TextBlobBench";
}

Powered by Google App Engine
This is Rietveld 408576698