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 "SkLightingImageFilter.h" | 9 #include "SkLightingImageFilter.h" |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 virtual SkString onShortName() { | 27 virtual SkString onShortName() { |
28 return SkString("lighting"); | 28 return SkString("lighting"); |
29 } | 29 } |
30 | 30 |
31 void make_bitmap() { | 31 void make_bitmap() { |
32 fBitmap.allocN32Pixels(100, 100); | 32 fBitmap.allocN32Pixels(100, 100); |
33 SkCanvas canvas(fBitmap); | 33 SkCanvas canvas(fBitmap); |
34 canvas.clear(0x00000000); | 34 canvas.clear(0x00000000); |
35 SkPaint paint; | 35 SkPaint paint; |
36 paint.setAntiAlias(true); | 36 paint.setAntiAlias(true); |
| 37 sk_tool_utils::set_portable_typeface(&paint); |
37 paint.setColor(0xFFFFFFFF); | 38 paint.setColor(0xFFFFFFFF); |
38 paint.setTextSize(SkIntToScalar(96)); | 39 paint.setTextSize(SkIntToScalar(96)); |
39 const char* str = "e"; | 40 const char* str = "e"; |
40 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); | 41 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); |
41 } | 42 } |
42 | 43 |
43 virtual SkISize onISize() { | 44 virtual SkISize onISize() { |
44 return SkISize::Make(WIDTH, HEIGHT); | 45 return SkISize::Make(WIDTH, HEIGHT); |
45 } | 46 } |
46 | 47 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 SkBitmap fBitmap; | 122 SkBitmap fBitmap; |
122 bool fInitialized; | 123 bool fInitialized; |
123 }; | 124 }; |
124 | 125 |
125 ////////////////////////////////////////////////////////////////////////////// | 126 ////////////////////////////////////////////////////////////////////////////// |
126 | 127 |
127 static GM* MyFactory(void*) { return new ImageLightingGM; } | 128 static GM* MyFactory(void*) { return new ImageLightingGM; } |
128 static GMRegistry reg(MyFactory); | 129 static GMRegistry reg(MyFactory); |
129 | 130 |
130 } | 131 } |
OLD | NEW |