OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 /* Tests text vertical text rendering with different fonts and centering. | 10 /* Tests text vertical text rendering with different fonts and centering. |
11 */ | 11 */ |
12 | 12 |
13 #include "gm.h" | 13 #include "gm.h" |
14 #include "SkCanvas.h" | 14 #include "SkCanvas.h" |
15 #include "SkTypeface.h" | 15 #include "SkTypeface.h" |
16 | 16 |
17 namespace skiagm { | 17 namespace skiagm { |
18 | 18 |
19 class VertText2GM : public GM { | 19 class VertText2GM : public GM { |
20 public: | 20 public: |
21 VertText2GM() | 21 VertText2GM() |
22 : fProp(NULL) | 22 : fProp(nullptr) |
23 , fMono(NULL) { | 23 , fMono(nullptr) { |
24 } | 24 } |
25 | 25 |
26 virtual ~VertText2GM() { | 26 virtual ~VertText2GM() { |
27 SkSafeUnref(fProp); | 27 SkSafeUnref(fProp); |
28 SkSafeUnref(fMono); | 28 SkSafeUnref(fMono); |
29 } | 29 } |
30 | 30 |
31 protected: | 31 protected: |
32 void onOnceBeforeDraw() override { | 32 void onOnceBeforeDraw() override { |
33 const int pointSize = 24; | 33 const int pointSize = 24; |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 SkTypeface* fProp; | 96 SkTypeface* fProp; |
97 SkTypeface* fMono; | 97 SkTypeface* fMono; |
98 }; | 98 }; |
99 | 99 |
100 /////////////////////////////////////////////////////////////////////////////// | 100 /////////////////////////////////////////////////////////////////////////////// |
101 | 101 |
102 static GM* MyFactory(void*) { return new VertText2GM; } | 102 static GM* MyFactory(void*) { return new VertText2GM; } |
103 static GMRegistry reg(MyFactory); | 103 static GMRegistry reg(MyFactory); |
104 | 104 |
105 } | 105 } |
OLD | NEW |