Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Unified Diff: dm/DMSrcSink.cpp

Issue 1577853004: Add CodecZeroInit test to DMSrcSink (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« dm/DMSrcSink.h ('K') | « dm/DMSrcSink.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« dm/DMSrcSink.h ('K') | « dm/DMSrcSink.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698