| 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 18 matching lines...) Expand all Loading... |
| 29 /** | 29 /** |
| 30 * Sets the paint to use a platform-independent text renderer if FLAGS_porta
bleFonts is set. | 30 * Sets the paint to use a platform-independent text renderer if FLAGS_porta
bleFonts is set. |
| 31 * FIXME: will become obsolete as GMs migrate to set portable typeface alway
s. | 31 * FIXME: will become obsolete as GMs migrate to set portable typeface alway
s. |
| 32 */ | 32 */ |
| 33 void set_portable_typeface(SkPaint* paint, const char* name = NULL, | 33 void set_portable_typeface(SkPaint* paint, const char* name = NULL, |
| 34 SkTypeface::Style style = SkTypeface::kNormal); | 34 SkTypeface::Style style = SkTypeface::kNormal); |
| 35 void set_portable_typeface_always(SkPaint* paint, const char* name = NULL, | 35 void set_portable_typeface_always(SkPaint* paint, const char* name = NULL, |
| 36 SkTypeface::Style style = SkTypeface::kNormal); | 36 SkTypeface::Style style = SkTypeface::kNormal); |
| 37 SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style sty
le); | 37 SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style sty
le); |
| 38 SkTypeface* create_portable_typeface_always(const char* name, SkTypeface::St
yle style); | 38 SkTypeface* create_portable_typeface_always(const char* name, SkTypeface::St
yle style); |
| 39 /** Call to clean up portable font references. */ |
| 40 void release_portable_typefaces(); |
| 39 void report_used_chars(); | 41 void report_used_chars(); |
| 40 | 42 |
| 41 /** | 43 /** |
| 42 * Call canvas->writePixels() by using the pixels from bitmap, but with an
info that claims | 44 * Call canvas->writePixels() by using the pixels from bitmap, but with an
info that claims |
| 43 * the pixels are colorType + alphaType | 45 * the pixels are colorType + alphaType |
| 44 */ | 46 */ |
| 45 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); | 47 void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkA
lphaType); |
| 46 | 48 |
| 47 // private to sk_tool_utils | 49 // private to sk_tool_utils |
| 48 SkTypeface* create_font(const char* name, SkTypeface::Style ); | 50 SkTypeface* create_font(const char* name, SkTypeface::Style ); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 75 } | 77 } |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 // A helper for inserting a drawtext call into a SkTextBlobBuilder | 80 // A helper for inserting a drawtext call into a SkTextBlobBuilder |
| 79 void add_to_text_blob(SkTextBlobBuilder* builder, const char* text, const Sk
Paint& origPaint, | 81 void add_to_text_blob(SkTextBlobBuilder* builder, const char* text, const Sk
Paint& origPaint, |
| 80 SkScalar x, SkScalar y); | 82 SkScalar x, SkScalar y); |
| 81 | 83 |
| 82 } // namespace sk_tool_utils | 84 } // namespace sk_tool_utils |
| 83 | 85 |
| 84 #endif // sk_tool_utils_DEFINED | 86 #endif // sk_tool_utils_DEFINED |
| OLD | NEW |