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

Unified Diff: src/codec/SkCodec_libpng.cpp

Issue 1321433002: Add subsetting to SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@gif-scan
Patch Set: Rebase - it compiles but I'm sure everything is broken 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_libpng.h ('k') | src/codec/SkCodec_wbmp.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_libpng.cpp
diff --git a/src/codec/SkCodec_libpng.cpp b/src/codec/SkCodec_libpng.cpp
index 0db425c3544d73e9fa986643ac09c9f90e7d9c47..4bde36a43191f0300e03c22fb5a7cb515ab97fd6 100644
--- a/src/codec/SkCodec_libpng.cpp
+++ b/src/codec/SkCodec_libpng.cpp
@@ -394,7 +394,9 @@ void SkPngCodec::destroyReadStruct() {
SkCodec::Result SkPngCodec::initializeSwizzler(const SkImageInfo& requestedInfo,
const Options& options,
SkPMColor ctable[],
- int* ctableCount) {
+ int* ctableCount,
+ int subsetLeft,
+ int subsetWidth) {
// FIXME: Could we use the return value of setjmp to specify the type of
// error?
if (setjmp(png_jmpbuf(fPng_ptr))) {
@@ -436,7 +438,7 @@ SkCodec::Result SkPngCodec::initializeSwizzler(const SkImageInfo& requestedInfo,
// Create the swizzler. SkPngCodec retains ownership of the color table.
const SkPMColor* colors = get_color_ptr(fColorTable.get());
fSwizzler.reset(SkSwizzler::CreateSwizzler(fSrcConfig, colors, requestedInfo,
- options.fZeroInitialized));
+ options.fZeroInitialized, subsetLeft, subsetWidth));
if (!fSwizzler) {
// FIXME: CreateSwizzler could fail for another reason.
return kUnimplemented;
@@ -477,8 +479,8 @@ SkCodec::Result SkPngCodec::onGetPixels(const SkImageInfo& requestedInfo, void*
}
// Note that ctable and ctableCount may be modified if there is a color table
- const Result result = this->initializeSwizzler(requestedInfo, options,
- ctable, ctableCount);
+ const Result result = this->initializeSwizzler(requestedInfo, options, ctable, ctableCount, 0,
+ requestedInfo.width());
if (result != kSuccess) {
return result;
}
@@ -611,13 +613,13 @@ public:
{}
Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options,
- SkPMColor ctable[], int* ctableCount) override {
+ SkPMColor ctable[], int* ctableCount, int subsetLeft, int subsetWidth) override {
if (!conversion_possible(dstInfo, this->getInfo())) {
return kInvalidConversion;
}
const Result result = this->initializeSwizzler(dstInfo, options, ctable,
- ctableCount);
+ ctableCount, subsetLeft, subsetWidth);
if (result != kSuccess) {
return result;
}
@@ -698,15 +700,14 @@ public:
}
Result onStartScanlineDecode(const SkImageInfo& dstInfo, const Options& options,
- SkPMColor ctable[], int* ctableCount) override
- {
+ SkPMColor ctable[], int* ctableCount, int subsetLeft, int subsetWidth) override {
if (!conversion_possible(dstInfo, this->getInfo())) {
return kInvalidConversion;
}
- const SkCodec::Result result = this->initializeSwizzler(dstInfo, options, ctable,
- ctableCount);
- if (result != SkCodec::kSuccess) {
+ const Result result = this->initializeSwizzler(dstInfo, options, ctable,
+ ctableCount, subsetLeft, subsetWidth);
+ if (result != kSuccess) {
return result;
}
« no previous file with comments | « src/codec/SkCodec_libpng.h ('k') | src/codec/SkCodec_wbmp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698