aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm
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 /dm
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 'dm')
-rw-r--r--dm/DMSrcSink.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index c169b23b38..4e3884e3c9 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -951,10 +951,7 @@ Error ImageGenSrc::draw(SkCanvas* canvas) const {
int bpp = SkColorTypeBytesPerPixel(decodeInfo.colorType());
size_t rowBytes = decodeInfo.width() * bpp;
SkAutoMalloc pixels(decodeInfo.height() * rowBytes);
- SkPMColor colorPtr[256];
- int colorCount = 256;
-
- if (!gen->getPixels(decodeInfo, pixels.get(), rowBytes, colorPtr, &colorCount)) {
+ if (!gen->getPixels(decodeInfo, pixels.get(), rowBytes)) {
SkString err =
SkStringPrintf("Image generator could not getPixels() for %s\n", fPath.c_str());
@@ -968,6 +965,8 @@ Error ImageGenSrc::draw(SkCanvas* canvas) const {
return err;
}
+ SkPMColor colorPtr[256];
+ int colorCount = 256;
draw_to_canvas(canvas, decodeInfo, pixels.get(), rowBytes, colorPtr, colorCount,
CodecSrc::kGetFromCanvas_DstColorType);
return "";