aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/verttext2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gm/verttext2.cpp')
-rw-r--r--gm/verttext2.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/gm/verttext2.cpp b/gm/verttext2.cpp
index 77bdc92dd1..9918049f10 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");