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

Unified Diff: gm/verttext2.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
« gm/typeface.cpp ('K') | « gm/typeface.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/verttext2.cpp
diff --git a/gm/verttext2.cpp b/gm/verttext2.cpp
index 77bdc92dd15f70b0d1cc555a8eb49433f0e12ed2..9918049f10c8403daf2f44d5f4196287bcd79364 100644
--- a/gm/verttext2.cpp
+++ b/gm/verttext2.cpp
@@ -18,11 +18,9 @@ namespace skiagm {
class VertText2GM : public GM {
public:
- VertText2GM() {
- const int pointSize = 24;
- textHeight = SkIntToScalar(pointSize);
- fProp = sk_tool_utils::create_portable_typeface("Helvetica", SkTypeface::kNormal);
- fMono = sk_tool_utils::create_portable_typeface("Courier New", SkTypeface::kNormal);
+ VertText2GM()
+ : fProp(NULL)
+ , fMono(NULL) {
}
virtual ~VertText2GM() {
@@ -31,7 +29,12 @@ public:
}
protected:
-
+ void onOnceBeforeDraw() override {
+ const int pointSize = 24;
+ textHeight = SkIntToScalar(pointSize);
+ fProp = sk_tool_utils::create_portable_typeface("Helvetica", SkTypeface::kNormal);
+ fMono = sk_tool_utils::create_portable_typeface("Courier New", SkTypeface::kNormal);
+ }
SkString onShortName() override {
return SkString("verttext2");
« gm/typeface.cpp ('K') | « gm/typeface.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698