OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkDisplacementMapEffect.h" | 9 #include "SkDisplacementMapEffect.h" |
10 #include "SkBitmapSource.h" | 10 #include "SkBitmapSource.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 make_checkerboard(&fLargeW, 96, 64); | 30 make_checkerboard(&fLargeW, 96, 64); |
31 make_checkerboard(&fLargeH, 64, 96); | 31 make_checkerboard(&fLargeH, 64, 96); |
32 } | 32 } |
33 | 33 |
34 void make_bitmap() { | 34 void make_bitmap() { |
35 fBitmap.allocN32Pixels(80, 80); | 35 fBitmap.allocN32Pixels(80, 80); |
36 SkCanvas canvas(fBitmap); | 36 SkCanvas canvas(fBitmap); |
37 canvas.clear(0x00000000); | 37 canvas.clear(0x00000000); |
38 SkPaint paint; | 38 SkPaint paint; |
39 paint.setAntiAlias(true); | 39 paint.setAntiAlias(true); |
| 40 sk_tool_utils::set_portable_typeface(&paint); |
40 paint.setColor(0xFF884422); | 41 paint.setColor(0xFF884422); |
41 paint.setTextSize(SkIntToScalar(96)); | 42 paint.setTextSize(SkIntToScalar(96)); |
42 const char* str = "g"; | 43 const char* str = "g"; |
43 canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(55),
paint); | 44 canvas.drawText(str, strlen(str), SkIntToScalar(15), SkIntToScalar(55),
paint); |
44 } | 45 } |
45 | 46 |
46 void make_checkerboard(SkBitmap* bitmap, int w, int h) { | 47 void make_checkerboard(SkBitmap* bitmap, int w, int h) { |
47 bitmap->allocN32Pixels(w, h); | 48 bitmap->allocN32Pixels(w, h); |
48 SkCanvas canvas(*bitmap); | 49 SkCanvas canvas(*bitmap); |
49 canvas.clear(0x00000000); | 50 canvas.clear(0x00000000); |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 SkBitmap fBitmap, fCheckerboard, fSmall, fLarge, fLargeW, fLargeH; | 221 SkBitmap fBitmap, fCheckerboard, fSmall, fLarge, fLargeW, fLargeH; |
221 bool fInitialized; | 222 bool fInitialized; |
222 }; | 223 }; |
223 | 224 |
224 ////////////////////////////////////////////////////////////////////////////// | 225 ////////////////////////////////////////////////////////////////////////////// |
225 | 226 |
226 static GM* MyFactory(void*) { return new DisplacementMapGM; } | 227 static GM* MyFactory(void*) { return new DisplacementMapGM; } |
227 static GMRegistry reg(MyFactory); | 228 static GMRegistry reg(MyFactory); |
228 | 229 |
229 } | 230 } |
OLD | NEW |