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 10 matching lines...) Expand all Loading... |
21 } | 21 } |
22 | 22 |
23 protected: | 23 protected: |
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.setConfig(SkBitmap::kARGB_8888_Config, 135, 135); | 29 fBitmap.setConfig(SkBitmap::kARGB_8888_Config, 135, 135); |
30 fBitmap.allocPixels(); | 30 fBitmap.allocPixels(); |
31 SkDevice device(fBitmap); | 31 SkBitmapDevice device(fBitmap); |
32 SkCanvas canvas(&device); | 32 SkCanvas canvas(&device); |
33 canvas.clear(0x0); | 33 canvas.clear(0x0); |
34 SkPaint paint; | 34 SkPaint paint; |
35 paint.setAntiAlias(true); | 35 paint.setAntiAlias(true); |
36 const char* str1 = "ABC"; | 36 const char* str1 = "ABC"; |
37 const char* str2 = "XYZ"; | 37 const char* str2 = "XYZ"; |
38 paint.setColor(0xFFFFFFFF); | 38 paint.setColor(0xFFFFFFFF); |
39 paint.setTextSize(64); | 39 paint.setTextSize(64); |
40 canvas.drawText(str1, strlen(str1), 10, 55, paint); | 40 canvas.drawText(str1, strlen(str1), 10, 55, paint); |
41 canvas.drawText(str2, strlen(str2), 10, 110, paint); | 41 canvas.drawText(str2, strlen(str2), 10, 110, paint); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 SkBitmap fBitmap; | 89 SkBitmap fBitmap; |
90 bool fOnce; | 90 bool fOnce; |
91 }; | 91 }; |
92 | 92 |
93 ////////////////////////////////////////////////////////////////////////////// | 93 ////////////////////////////////////////////////////////////////////////////// |
94 | 94 |
95 static GM* MyFactory(void*) { return new MorphologyGM; } | 95 static GM* MyFactory(void*) { return new MorphologyGM; } |
96 static GMRegistry reg(MyFactory); | 96 static GMRegistry reg(MyFactory); |
97 | 97 |
98 } | 98 } |
OLD | NEW |