aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/Resources.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/Resources.cpp')
-rw-r--r--tools/Resources.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/Resources.cpp b/tools/Resources.cpp
index 224bf3f66e..d7f90189a6 100644
--- a/tools/Resources.cpp
+++ b/tools/Resources.cpp
@@ -34,10 +34,9 @@ bool GetResourceAsBitmap(const char* resource, SkBitmap* dst) {
return false;
}
SkPMColor ctStorage[256];
- auto ctable = SkColorTable::Make(ctStorage, 256);
+ sk_sp<SkColorTable> ctable(new SkColorTable(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(), nullptr, ctable.get()) &&
gen->getPixels(gen->getInfo().makeColorSpace(nullptr), dst->getPixels(), dst->rowBytes(),
const_cast<SkPMColor*>(ctable->readColors()), &count);
}