diff options
author | Mike Reed <reed@google.com> | 2018-02-07 16:05:29 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-02-08 16:50:59 +0000 |
commit | d4746984e51e18ba3d2e52e96305d72d0fd84c31 (patch) | |
tree | c27cbe22c5a42560e3afadf88e191f084d21b8f9 /tools | |
parent | 30ff2ac47e2c0fc9a2f51b761948a2237b8c5815 (diff) |
ensure that what is valid for a surface is also valid for an image
Note, this change will cause some previously succeeding surfaces to fail to build (since they could not snap their image)
Bug: skia:7598
Change-Id: I012ca752ba1351a904625d216429eab646ca4a85
Reviewed-on: https://skia-review.googlesource.com/105421
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sk_tool_utils.cpp | 22 | ||||
-rw-r--r-- | tools/sk_tool_utils.h | 1 |
2 files changed, 19 insertions, 4 deletions
diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp index 9d1b4df56c..4c4474cc57 100644 --- a/tools/sk_tool_utils.cpp +++ b/tools/sk_tool_utils.cpp @@ -93,19 +93,33 @@ const char* platform_font_manager() { } +const char* alphatype_name(SkAlphaType at) { + switch (at) { + case kUnknown_SkAlphaType: return "Unknown"; + case kOpaque_SkAlphaType: return "Opaque"; + case kPremul_SkAlphaType: return "Premul"; + case kUnpremul_SkAlphaType: return "Unpremul"; + } + SkASSERT(false); + return "unexpected alphatype"; +} + const char* colortype_name(SkColorType ct) { switch (ct) { case kUnknown_SkColorType: return "Unknown"; case kAlpha_8_SkColorType: return "Alpha_8"; - case kARGB_4444_SkColorType: return "ARGB_4444"; case kRGB_565_SkColorType: return "RGB_565"; + case kARGB_4444_SkColorType: return "ARGB_4444"; case kRGBA_8888_SkColorType: return "RGBA_8888"; + case kRGB_888x_SkColorType: return "RGB_888x"; case kBGRA_8888_SkColorType: return "BGRA_8888"; + case kRGBA_1010102_SkColorType: return "RGBA_1010102"; + case kRGB_101010x_SkColorType: return "RGB_101010x"; + case kGray_8_SkColorType: return "Gray_8"; case kRGBA_F16_SkColorType: return "RGBA_F16"; - default: - SkASSERT(false); - return "unexpected colortype"; } + SkASSERT(false); + return "unexpected colortype"; } SkColor color_to_565(SkColor color) { diff --git a/tools/sk_tool_utils.h b/tools/sk_tool_utils.h index d27a14a068..a1b5b7fe37 100644 --- a/tools/sk_tool_utils.h +++ b/tools/sk_tool_utils.h @@ -32,6 +32,7 @@ class SkTextBlobBuilder; namespace sk_tool_utils { + const char* alphatype_name(SkAlphaType); const char* colortype_name(SkColorType); /** |