aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/Resources.cpp
diff options
context:
space:
mode:
authorGravatar Matt Sarett <msarett@google.com>2017-05-12 11:41:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-12 16:48:17 +0000
commitebb1b5c297e394ab19f99d807095672b7f5d8aef (patch)
tree5f2fcd7f15da445df1efd5861b708df8f35c5ba0 /tools/Resources.cpp
parent7c8460e10135c05a42d0744b84838bbc24398ac2 (diff)
Add new SkImageGenerator::getPixels() API, deprecate the old
This is fairly aggressive in that it will break any client that is currently using SkImageGenerator with kIndex8. I'm guessing that we don't have any clients doing that. Bug: skia:6620 Change-Id: Ifd16f5232bb3a9f759c225315c57492d917ed9ca Reviewed-on: https://skia-review.googlesource.com/16601 Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'tools/Resources.cpp')
-rw-r--r--tools/Resources.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/Resources.cpp b/tools/Resources.cpp
index 224bf3f66e..f93cf24381 100644
--- a/tools/Resources.cpp
+++ b/tools/Resources.cpp
@@ -33,13 +33,9 @@ bool GetResourceAsBitmap(const char* resource, SkBitmap* dst) {
if (!gen) {
return false;
}
- SkPMColor ctStorage[256];
- auto ctable = SkColorTable::Make(ctStorage, 256);
- int count = ctable->count();
- // ICK -- gotta clean up this pattern of writing to the ctable
- return dst->tryAllocPixels(gen->getInfo(), ctable) &&
+ return dst->tryAllocPixels(gen->getInfo()) &&
gen->getPixels(gen->getInfo().makeColorSpace(nullptr), dst->getPixels(), dst->rowBytes(),
- const_cast<SkPMColor*>(ctable->readColors()), &count);
+ nullptr);
}
sk_sp<SkImage> GetResourceAsImage(const char* resource) {