commit-bot@chromium.org | 4cd9e21 | 2014-03-07 03:25:16 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
| 8 | #ifndef sk_tool_utils_DEFINED |
| 9 | #define sk_tool_utils_DEFINED |
| 10 | |
tfarina | 2010891 | 2014-06-21 10:54:17 -0700 | [diff] [blame] | 11 | #include "SkImageInfo.h" |
caryclark | 5fb6bd4 | 2014-06-23 11:25:00 -0700 | [diff] [blame] | 12 | #include "SkTypeface.h" |
commit-bot@chromium.org | 4cd9e21 | 2014-03-07 03:25:16 +0000 | [diff] [blame] | 13 | |
Cary Clark | 992c7b0 | 2014-07-31 08:58:44 -0400 | [diff] [blame] | 14 | class SkBitmap; |
| 15 | class SkCanvas; |
| 16 | class SkPaint; |
| 17 | class SkTestFont; |
skia.committer@gmail.com | db0c875 | 2014-03-18 03:02:11 +0000 | [diff] [blame] | 18 | |
Cary Clark | 992c7b0 | 2014-07-31 08:58:44 -0400 | [diff] [blame] | 19 | namespace sk_tool_utils { |
caryclark | 5fb6bd4 | 2014-06-23 11:25:00 -0700 | [diff] [blame] | 20 | |
commit-bot@chromium.org | a713f9c | 2014-03-17 21:31:26 +0000 | [diff] [blame] | 21 | const char* colortype_name(SkColorType); |
commit-bot@chromium.org | 4cd9e21 | 2014-03-07 03:25:16 +0000 | [diff] [blame] | 22 | |
| 23 | /** |
caryclark | 5fb6bd4 | 2014-06-23 11:25:00 -0700 | [diff] [blame] | 24 | * Sets the paint to use a platform-independent text renderer. |
| 25 | */ |
Cary Clark | 992c7b0 | 2014-07-31 08:58:44 -0400 | [diff] [blame] | 26 | void set_portable_typeface(SkPaint* paint, const char* name = NULL, |
| 27 | SkTypeface::Style style = SkTypeface::kNormal); |
| 28 | SkTypeface* create_portable_typeface(const char* name, SkTypeface::Style style); |
| 29 | void report_used_chars(); |
caryclark | 5fb6bd4 | 2014-06-23 11:25:00 -0700 | [diff] [blame] | 30 | |
| 31 | /** |
commit-bot@chromium.org | 4cd9e21 | 2014-03-07 03:25:16 +0000 | [diff] [blame] | 32 | * Call canvas->writePixels() by using the pixels from bitmap, but with an info that claims |
| 33 | * the pixels are colorType + alphaType |
| 34 | */ |
| 35 | void write_pixels(SkCanvas*, const SkBitmap&, int x, int y, SkColorType, SkAlphaType); |
commit-bot@chromium.org | 4cd9e21 | 2014-03-07 03:25:16 +0000 | [diff] [blame] | 36 | |
Cary Clark | 992c7b0 | 2014-07-31 08:58:44 -0400 | [diff] [blame] | 37 | // private to sk_tool_utils |
| 38 | SkTypeface* create_font(const char* name, SkTypeface::Style ); |
| 39 | SkTypeface* resource_font(const char* name, SkTypeface::Style ); |
| 40 | |
tfarina | 2010891 | 2014-06-21 10:54:17 -0700 | [diff] [blame] | 41 | } // namespace sk_tool_utils |
| 42 | |
| 43 | #endif // sk_tool_utils_DEFINED |