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

Unified Diff: src/codec/SkCodec_libpng.cpp

Issue 980903002: Option for SkCodec to treat dst as all zeroes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pass ZeroInitialized to getPixels in Options. Created 5 years, 9 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
Index: src/codec/SkCodec_libpng.cpp
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index 8e7ee33a9554bce341cf8681b2db86d334bfae1b..b9e1ccffbb767f9fdfd063efef13336c871ca29b 100644
--- a/src/codec/SkCodec_libpng.cpp
+++ b/src/codec/SkCodec_libpng.cpp
@@ -366,8 +366,8 @@ static bool conversion_possible(const SkImageInfo& A, const SkImageInfo& B) {
}
SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void* dst,
- size_t rowBytes, SkPMColor ctable[],
- int* ctableCount) {
+ size_t rowBytes, const Options& options,
+ SkPMColor ctable[], int* ctableCount) {
if (!this->rewindIfNeeded()) {
return kCouldNotRewind;
}
@@ -433,9 +433,9 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
sc = SkSwizzler::kRGBA;
}
const SkPMColor* colors = colorTable ? colorTable->readColors() : NULL;
- // TODO: Support skipZeroes.
swizzler.reset(SkSwizzler::CreateSwizzler(sc, colors, requestedInfo,
- dst, rowBytes, false));
+ dst, rowBytes,
+ options.fZeroInitialized));
if (!swizzler) {
// FIXME: CreateSwizzler could fail for another reason.
return kUnimplemented;

Powered by Google App Engine
This is Rietveld 408576698