diff options
author | Mike Reed <reed@google.com> | 2017-07-12 15:10:28 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-07-12 20:25:44 +0000 |
commit | 304a07c6c93298c3481bc0d4852d08c22a539504 (patch) | |
tree | ac9b11aab296f645ea66e02cc9e91abad10cd6eb /tools | |
parent | 7da6ba2d63cfd5ae6add617f18ba4882e755642b (diff) |
remove references to kIndex_8_SkColorType from our tools/tests
Bug: skia:6828
Change-Id: Ib5049c28c11b7320bece20f5a0a886de8b2a4343
Reviewed-on: https://skia-review.googlesource.com/22728
Reviewed-by: Leon Scroggins <scroggo@google.com>
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/debugger/SkDrawCommand.cpp | 9 | ||||
-rw-r--r-- | tools/sk_tool_utils.cpp | 12 |
2 files changed, 2 insertions, 19 deletions
diff --git a/tools/debugger/SkDrawCommand.cpp b/tools/debugger/SkDrawCommand.cpp index a7c94ab6e3..5ae0307439 100644 --- a/tools/debugger/SkDrawCommand.cpp +++ b/tools/debugger/SkDrawCommand.cpp @@ -812,8 +812,6 @@ static const char* color_type_name(SkColorType colorType) { return SKDEBUGCANVAS_COLORTYPE_565; case kGray_8_SkColorType: return SKDEBUGCANVAS_COLORTYPE_GRAY8; - case kIndex_8_SkColorType: - return SKDEBUGCANVAS_COLORTYPE_INDEX8; case kAlpha_8_SkColorType: return SKDEBUGCANVAS_COLORTYPE_ALPHA8; default: @@ -887,9 +885,6 @@ static SkColorType colortype_from_name(const char* name) { else if (!strcmp(name, SKDEBUGCANVAS_COLORTYPE_GRAY8)) { return kGray_8_SkColorType; } - else if (!strcmp(name, SKDEBUGCANVAS_COLORTYPE_INDEX8)) { - return kIndex_8_SkColorType; - } else if (!strcmp(name, SKDEBUGCANVAS_COLORTYPE_ALPHA8)) { return kAlpha_8_SkColorType; } @@ -934,9 +929,7 @@ static SkBitmap* load_bitmap(const Json::Value& jsonBitmap, UrlDataManager& urlD if (jsonBitmap.isMember(SKDEBUGCANVAS_ATTRIBUTE_COLOR)) { const char* ctName = jsonBitmap[SKDEBUGCANVAS_ATTRIBUTE_COLOR].asCString(); SkColorType ct = colortype_from_name(ctName); - if (ct != kIndex_8_SkColorType) { - bitmap.reset(convert_colortype(bitmap.release(), ct)); - } + bitmap.reset(convert_colortype(bitmap.release(), ct)); } return bitmap.release(); } diff --git a/tools/sk_tool_utils.cpp b/tools/sk_tool_utils.cpp index dff5d70150..47f4aae397 100644 --- a/tools/sk_tool_utils.cpp +++ b/tools/sk_tool_utils.cpp @@ -164,7 +164,6 @@ const char* colortype_name(SkColorType ct) { switch (ct) { case kUnknown_SkColorType: return "Unknown"; case kAlpha_8_SkColorType: return "Alpha_8"; - case kIndex_8_SkColorType: return "Index_8"; case kARGB_4444_SkColorType: return "ARGB_4444"; case kRGB_565_SkColorType: return "RGB_565"; case kRGBA_8888_SkColorType: return "RGBA_8888"; @@ -566,16 +565,7 @@ bool copy_to(SkBitmap* dst, SkColorType dstColorType, const SkBitmap& src) { return false; } - // allocate colortable if srcConfig == kIndex8_Config - sk_sp<SkColorTable> ctable = nullptr; - if (dstColorType == kIndex_8_SkColorType) { - if (src.colorType() != kIndex_8_SkColorType) { - return false; - } - - ctable = sk_ref_sp(srcPM.ctable()); - } - if (!tmpDst.tryAllocPixels(ctable.get())) { + if (!tmpDst.tryAllocPixels()) { return false; } |