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

Unified Diff: src/codec/SkCodec_libgif.cpp

Issue 1390213002: Add subsetting to SkScanlineDecoder (Closed) Base URL: https://skia.googlesource.com/skia.git@fill-refactor
Patch Set: Response to comments Created 5 years, 2 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
« no previous file with comments | « src/codec/SkCodec_libgif.h ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libgif.cpp
diff --git a/src/codec/SkCodec_libgif.cpp b/src/codec/SkCodec_libgif.cpp
index 856f69ba3c9d939e95e2803db3a67bb763db7c62..018789155879f6ee7c38a7140567bbc5a112516a 100644
--- a/src/codec/SkCodec_libgif.cpp
+++ b/src/codec/SkCodec_libgif.cpp
@@ -435,10 +435,6 @@ void SkGifCodec::initializeColorTable(const SkImageInfo& dstInfo, SkPMColor* inp
SkCodec::Result SkGifCodec::prepareToDecode(const SkImageInfo& dstInfo, SkPMColor* inputColorPtr,
int* inputColorCount, const Options& opts) {
// Check for valid input parameters
- if (opts.fSubset) {
- // Subsets are not supported.
- return kUnimplemented;
- }
if (!conversion_possible(dstInfo, this->getInfo())) {
return gif_error("Cannot convert input type to output type.\n",
kInvalidConversion);
@@ -449,11 +445,9 @@ SkCodec::Result SkGifCodec::prepareToDecode(const SkImageInfo& dstInfo, SkPMColo
return kSuccess;
}
-SkCodec::Result SkGifCodec::initializeSwizzler(const SkImageInfo& dstInfo,
- ZeroInitialized zeroInit) {
+SkCodec::Result SkGifCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& opts) {
const SkPMColor* colorPtr = get_color_ptr(fColorTable.get());
- fSwizzler.reset(SkSwizzler::CreateSwizzler(SkSwizzler::kIndex,
- colorPtr, dstInfo, zeroInit));
+ fSwizzler.reset(SkSwizzler::CreateSwizzler(SkSwizzler::kIndex, colorPtr, dstInfo, opts));
if (nullptr != fSwizzler.get()) {
return kSuccess;
}
@@ -485,7 +479,7 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
// Initialize the swizzler
if (fFrameIsSubset) {
const SkImageInfo subsetDstInfo = dstInfo.makeWH(fFrameRect.width(), fFrameRect.height());
- if (kSuccess != this->initializeSwizzler(subsetDstInfo, opts.fZeroInitialized)) {
+ if (kSuccess != this->initializeSwizzler(subsetDstInfo, opts)) {
return gif_error("Could not initialize swizzler.\n", kUnimplemented);
}
@@ -499,7 +493,7 @@ SkCodec::Result SkGifCodec::onGetPixels(const SkImageInfo& dstInfo,
dst = SkTAddOffset<void*>(dst, dstRowBytes * fFrameRect.top() +
dstBytesPerPixel * fFrameRect.left());
} else {
- if (kSuccess != this->initializeSwizzler(dstInfo, opts.fZeroInitialized)) {
+ if (kSuccess != this->initializeSwizzler(dstInfo, opts)) {
return gif_error("Could not initialize swizzler.\n", kUnimplemented);
}
}
@@ -535,11 +529,11 @@ SkCodec::Result SkGifCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
// Initialize the swizzler
if (fFrameIsSubset) {
const SkImageInfo subsetDstInfo = dstInfo.makeWH(fFrameRect.width(), fFrameRect.height());
- if (kSuccess != this->initializeSwizzler(subsetDstInfo, opts.fZeroInitialized)) {
+ if (kSuccess != this->initializeSwizzler(subsetDstInfo, opts)) {
return gif_error("Could not initialize swizzler.\n", kUnimplemented);
}
} else {
- if (kSuccess != this->initializeSwizzler(dstInfo, opts.fZeroInitialized)) {
+ if (kSuccess != this->initializeSwizzler(dstInfo, opts)) {
return gif_error("Could not initialize swizzler.\n", kUnimplemented);
}
}
« no previous file with comments | « src/codec/SkCodec_libgif.h ('k') | src/codec/SkCodec_libpng.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698