OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 #ifndef sk_tool_utils_DEFINED | 8 #ifndef sk_tool_utils_DEFINED |
9 #define sk_tool_utils_DEFINED | 9 #define sk_tool_utils_DEFINED |
10 | 10 |
| 11 #include "SkBitmap.h" |
| 12 #include "SkCanvas.h" |
11 #include "SkImageInfo.h" | 13 #include "SkImageInfo.h" |
12 | 14 #include "SkPaint.h" |
13 class SkBitmap; | 15 #include "SkTypeface.h" |
14 class SkCanvas; | |
15 | 16 |
16 namespace sk_tool_utils { | 17 namespace sk_tool_utils { |
17 | 18 |
| 19 extern bool gEnablePortableTypeface; |
| 20 |
18 const char* colortype_name(SkColorType); | 21 const char* colortype_name(SkColorType); |
19 | 22 |
20 /** | 23 /** |
| 24 * Sets the paint to use a platform-independent text renderer. |
| 25 */ |
| 26 void set_portable_typeface(SkPaint* paint, SkTypeface::Style style = SkTypef
ace::kNormal); |
| 27 |
| 28 /** |
21 * Call canvas->writePixels() by using the pixels from bitmap, but with an
info that claims | 29 * Call canvas->writePixels() by using the pixels from bitmap, but with an
info that claims |
22 * the pixels are colorType + alphaType | 30 * the pixels are colorType + alphaType |
23 */ | 31 */ |
24 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); | 32 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); |
25 | 33 |
26 } // namespace sk_tool_utils | 34 } // namespace sk_tool_utils |
27 | 35 |
28 #endif // sk_tool_utils_DEFINED | 36 #endif // sk_tool_utils_DEFINED |
OLD | NEW |