OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkMorphologyImageFilter.h" | 9 #include "SkMorphologyImageFilter.h" |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 virtual SkString onShortName() { | 24 virtual SkString onShortName() { |
25 return SkString("morphology"); | 25 return SkString("morphology"); |
26 } | 26 } |
27 | 27 |
28 void make_bitmap() { | 28 void make_bitmap() { |
29 fBitmap.allocN32Pixels(135, 135); | 29 fBitmap.allocN32Pixels(135, 135); |
30 SkCanvas canvas(fBitmap); | 30 SkCanvas canvas(fBitmap); |
31 canvas.clear(0x0); | 31 canvas.clear(0x0); |
32 SkPaint paint; | 32 SkPaint paint; |
33 paint.setAntiAlias(true); | 33 paint.setAntiAlias(true); |
| 34 sk_tool_utils::set_portable_typeface(&paint); |
34 const char* str1 = "ABC"; | 35 const char* str1 = "ABC"; |
35 const char* str2 = "XYZ"; | 36 const char* str2 = "XYZ"; |
36 paint.setColor(0xFFFFFFFF); | 37 paint.setColor(0xFFFFFFFF); |
37 paint.setTextSize(64); | 38 paint.setTextSize(64); |
38 canvas.drawText(str1, strlen(str1), 10, 55, paint); | 39 canvas.drawText(str1, strlen(str1), 10, 55, paint); |
39 canvas.drawText(str2, strlen(str2), 10, 110, paint); | 40 canvas.drawText(str2, strlen(str2), 10, 110, paint); |
40 } | 41 } |
41 | 42 |
42 virtual SkISize onISize() { | 43 virtual SkISize onISize() { |
43 return SkISize::Make(WIDTH, HEIGHT); | 44 return SkISize::Make(WIDTH, HEIGHT); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 SkBitmap fBitmap; | 97 SkBitmap fBitmap; |
97 bool fOnce; | 98 bool fOnce; |
98 }; | 99 }; |
99 | 100 |
100 ////////////////////////////////////////////////////////////////////////////// | 101 ////////////////////////////////////////////////////////////////////////////// |
101 | 102 |
102 static GM* MyFactory(void*) { return new MorphologyGM; } | 103 static GM* MyFactory(void*) { return new MorphologyGM; } |
103 static GMRegistry reg(MyFactory); | 104 static GMRegistry reg(MyFactory); |
104 | 105 |
105 } | 106 } |
OLD | NEW |