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"; |
} |