| 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 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 /** | 66 /** |
| 67 * Map serif, san-serif, and monospace to the platform-specific font name. | 67 * Map serif, san-serif, and monospace to the platform-specific font name. |
| 68 */ | 68 */ |
| 69 const char* platform_font_name(const char* name); | 69 const char* platform_font_name(const char* name); |
| 70 | 70 |
| 71 /** | 71 /** |
| 72 * Sets the paint to use a platform-independent text renderer | 72 * Sets the paint to use a platform-independent text renderer |
| 73 */ | 73 */ |
| 74 void set_portable_typeface(SkPaint* paint, const char* name = nullptr, | 74 void set_portable_typeface(SkPaint* paint, const char* name = nullptr, |
| 75 SkTypeface::Style style = SkTypeface::kNormal); | 75 SkFontStyle style = SkFontStyle()); |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * Returns a platform-independent text renderer. | 78 * Returns a platform-independent text renderer. |
| 79 */ | 79 */ |
| 80 sk_sp<SkTypeface> create_portable_typeface(const char* name, SkTypeface::Sty
le style); | 80 sk_sp<SkTypeface> create_portable_typeface(const char* name, SkFontStyle sty
le); |
| 81 | 81 |
| 82 /** Call to clean up portable font references. */ | 82 /** Call to clean up portable font references. */ |
| 83 void release_portable_typefaces(); | 83 void release_portable_typefaces(); |
| 84 | 84 |
| 85 /** | 85 /** |
| 86 * Call canvas->writePixels() by using the pixels from bitmap, but with an
info that claims | 86 * Call canvas->writePixels() by using the pixels from bitmap, but with an
info that claims |
| 87 * the pixels are colorType + alphaType | 87 * the pixels are colorType + alphaType |
| 88 */ | 88 */ |
| 89 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); | 89 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); |
| 90 | 90 |
| 91 // private to sk_tool_utils | 91 // private to sk_tool_utils |
| 92 sk_sp<SkTypeface> create_font(const char* name, SkTypeface::Style); | 92 sk_sp<SkTypeface> create_font(const char* name, SkFontStyle); |
| 93 | 93 |
| 94 /** Returns a newly created CheckerboardShader. */ | 94 /** Returns a newly created CheckerboardShader. */ |
| 95 sk_sp<SkShader> create_checkerboard_shader(SkColor c1, SkColor c2, int size)
; | 95 sk_sp<SkShader> create_checkerboard_shader(SkColor c1, SkColor c2, int size)
; |
| 96 | 96 |
| 97 /** Draw a checkerboard pattern in the current canvas, restricted to | 97 /** Draw a checkerboard pattern in the current canvas, restricted to |
| 98 the current clip, using SkXfermode::kSrc_Mode. */ | 98 the current clip, using SkXfermode::kSrc_Mode. */ |
| 99 void draw_checkerboard(SkCanvas* canvas, | 99 void draw_checkerboard(SkCanvas* canvas, |
| 100 SkColor color1, | 100 SkColor color1, |
| 101 SkColor color2, | 101 SkColor color2, |
| 102 int checkSize); | 102 int checkSize); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 int fID; | 216 int fID; |
| 217 int fOutputPos; | 217 int fOutputPos; |
| 218 bool fTempMark; | 218 bool fTempMark; |
| 219 | 219 |
| 220 SkTDArray<TopoTestNode*> fDependencies; | 220 SkTDArray<TopoTestNode*> fDependencies; |
| 221 }; | 221 }; |
| 222 | 222 |
| 223 } // namespace sk_tool_utils | 223 } // namespace sk_tool_utils |
| 224 | 224 |
| 225 #endif // sk_tool_utils_DEFINED | 225 #endif // sk_tool_utils_DEFINED |
| OLD | NEW |