aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2017-03-31 09:20:50 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-31 15:39:31 +0000
commit2e491a6a113c5e16a3b7bede5fa6f588deeb928d (patch)
treee8540e14d4ca1dd12ca3b2df5d9ef0b6f48b3a7f /tools
parentf3333c89bf05fc602d9bf8e1e24547668c660383 (diff)
clean up (partially) colortable api
Needs this to land: https://codereview.chromium.org/2789853002/ Bug: skia: Change-Id: I38d916a546b7fa64d000d973e695ddda24a589e7 Reviewed-on: https://skia-review.googlesource.com/10600 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/Resources.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/Resources.cpp b/tools/Resources.cpp
index d7f90189a6..224bf3f66e 100644
--- a/tools/Resources.cpp
+++ b/tools/Resources.cpp
@@ -34,9 +34,10 @@ bool GetResourceAsBitmap(const char* resource, SkBitmap* dst) {
return false;
}
SkPMColor ctStorage[256];
- sk_sp<SkColorTable> ctable(new SkColorTable(ctStorage, 256));
+ auto ctable = SkColorTable::Make(ctStorage, 256);
int count = ctable->count();
- return dst->tryAllocPixels(gen->getInfo(), nullptr, ctable.get()) &&
+ // ICK -- gotta clean up this pattern of writing to the ctable
+ return dst->tryAllocPixels(gen->getInfo(), ctable) &&
gen->getPixels(gen->getInfo().makeColorSpace(nullptr), dst->getPixels(), dst->rowBytes(),
const_cast<SkPMColor*>(ctable->readColors()), &count);
}