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 #include "SkOffsetImageFilter.h" | 10 #include "SkOffsetImageFilter.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 SkString onShortName() override { | 26 SkString onShortName() override { |
27 return SkString("lighting"); | 27 return SkString("lighting"); |
28 } | 28 } |
29 | 29 |
30 void make_bitmap() { | 30 void make_bitmap() { |
31 fBitmap.allocN32Pixels(100, 100); | 31 fBitmap.allocN32Pixels(100, 100); |
32 SkCanvas canvas(fBitmap); | 32 SkCanvas canvas(fBitmap); |
33 canvas.clear(0x00000000); | 33 canvas.clear(0x00000000); |
34 SkPaint paint; | 34 SkPaint paint; |
35 paint.setAntiAlias(true); | 35 paint.setAntiAlias(true); |
36 sk_tool_utils::set_portable_typeface(&paint); | 36 sk_tool_utils::set_portable_typeface_always(&paint); |
37 paint.setColor(0xFFFFFFFF); | 37 paint.setColor(0xFFFFFFFF); |
38 paint.setTextSize(SkIntToScalar(96)); | 38 paint.setTextSize(SkIntToScalar(96)); |
39 const char* str = "e"; | 39 const char* str = "e"; |
40 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); | 40 canvas.drawText(str, strlen(str), SkIntToScalar(20), SkIntToScalar(70),
paint); |
41 } | 41 } |
42 | 42 |
43 SkISize onISize() override { | 43 SkISize onISize() override { |
44 return SkISize::Make(WIDTH, HEIGHT); | 44 return SkISize::Make(WIDTH, HEIGHT); |
45 } | 45 } |
46 | 46 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 SkBitmap fBitmap; | 167 SkBitmap fBitmap; |
168 bool fInitialized; | 168 bool fInitialized; |
169 }; | 169 }; |
170 | 170 |
171 ////////////////////////////////////////////////////////////////////////////// | 171 ////////////////////////////////////////////////////////////////////////////// |
172 | 172 |
173 static GM* MyFactory(void*) { return new ImageLightingGM; } | 173 static GM* MyFactory(void*) { return new ImageLightingGM; } |
174 static GMRegistry reg(MyFactory); | 174 static GMRegistry reg(MyFactory); |
175 | 175 |
176 } | 176 } |
OLD | NEW |