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. |
(...skipping 18 matching lines...) Expand all Loading... |
29 SkSafeUnref(fProp); | 29 SkSafeUnref(fProp); |
30 SkSafeUnref(fMono); | 30 SkSafeUnref(fMono); |
31 } | 31 } |
32 | 32 |
33 protected: | 33 protected: |
34 virtual uint32_t onGetFlags() const SK_OVERRIDE { | 34 virtual uint32_t onGetFlags() const SK_OVERRIDE { |
35 return kSkipTiled_Flag; | 35 return kSkipTiled_Flag; |
36 } | 36 } |
37 | 37 |
38 | 38 |
39 SkString onShortName() { | 39 SkString onShortName() SK_OVERRIDE { |
40 return SkString("verttext2"); | 40 return SkString("verttext2"); |
41 } | 41 } |
42 | 42 |
43 SkISize onISize() { return SkISize::Make(640, 480); } | 43 SkISize onISize() SK_OVERRIDE { return SkISize::Make(640, 480); } |
44 | 44 |
45 virtual void onDraw(SkCanvas* canvas) { | 45 virtual void onDraw(SkCanvas* canvas) SK_OVERRIDE { |
46 | |
47 for (int i = 0; i < 3; ++i) { | 46 for (int i = 0; i < 3; ++i) { |
48 SkPaint paint; | 47 SkPaint paint; |
49 paint.setColor(SK_ColorRED); | 48 paint.setColor(SK_ColorRED); |
50 paint.setAntiAlias(true); | 49 paint.setAntiAlias(true); |
51 y = textHeight; | 50 y = textHeight; |
52 canvas->drawLine(0, SkIntToScalar(10), | 51 canvas->drawLine(0, SkIntToScalar(10), |
53 SkIntToScalar(110), SkIntToScalar(10), paint); | 52 SkIntToScalar(110), SkIntToScalar(10), paint); |
54 canvas->drawLine(0, SkIntToScalar(240), | 53 canvas->drawLine(0, SkIntToScalar(240), |
55 SkIntToScalar(110), SkIntToScalar(240), paint); | 54 SkIntToScalar(110), SkIntToScalar(240), paint); |
56 canvas->drawLine(0, SkIntToScalar(470), | 55 canvas->drawLine(0, SkIntToScalar(470), |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 SkTypeface* fProp; | 92 SkTypeface* fProp; |
94 SkTypeface* fMono; | 93 SkTypeface* fMono; |
95 }; | 94 }; |
96 | 95 |
97 /////////////////////////////////////////////////////////////////////////////// | 96 /////////////////////////////////////////////////////////////////////////////// |
98 | 97 |
99 static GM* MyFactory(void*) { return new VertText2GM; } | 98 static GM* MyFactory(void*) { return new VertText2GM; } |
100 static GMRegistry reg(MyFactory); | 99 static GMRegistry reg(MyFactory); |
101 | 100 |
102 } | 101 } |
OLD | NEW |