Chromium Code Reviews| Index: dm/DMSrcSink.cpp |
| diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp |
| index c9bdcf6706771a6b253756ed7827d8d354eb3c56..42104b3e611bda145558f793c602b3f810f89ad1 100644 |
| --- a/dm/DMSrcSink.cpp |
| +++ b/dm/DMSrcSink.cpp |
| @@ -321,9 +321,14 @@ Error CodecSrc::draw(SkCanvas* canvas) const { |
| decodeInfo.width(), decodeInfo.height()); |
| } |
| + SkCodec::Options options; |
| switch (fMode) { |
| + case kCodecZeroInit_Mode: |
| + options.fZeroInitialized = SkCodec::kYes_ZeroInitialized; |
| + bitmap.eraseColor(0); |
|
scroggo
2016/01/12 22:27:46
This won't work for index8 bitmaps. Instead, we ca
mtklein
2016/01/12 22:51:22
e.g. SkMallocPixelRef::NewZeroed() / SkMallocPixel
msarett
2016/01/13 14:58:16
Done.
|
| + // Intentional fall through. |
| case kCodec_Mode: { |
| - switch (codec->getPixels(decodeInfo, bitmap.getPixels(), bitmap.rowBytes(), nullptr, |
| + switch (codec->getPixels(decodeInfo, bitmap.getPixels(), bitmap.rowBytes(), &options, |
| colorPtr, colorCountPtr)) { |
| case SkCodec::kSuccess: |
| // We consider incomplete to be valid, since we should still decode what is |