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

Unified Diff: src/codec/SkCodec_wbmp.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_wbmp.h ('k') | src/codec/SkJpegCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec_wbmp.cpp
diff --git a/src/codec/SkCodec_wbmp.cpp b/src/codec/SkCodec_wbmp.cpp
index ba4dc9af8995f2c9093889158a79b3a8990122d5..7d87123e63700c2160a7a5e9b2bddfc30768e0e5 100644
--- a/src/codec/SkCodec_wbmp.cpp
+++ b/src/codec/SkCodec_wbmp.cpp
@@ -70,8 +70,8 @@ bool SkWbmpCodec::onRewind() {
return read_header(this->stream(), nullptr);
}
-SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info,
- const SkPMColor* ctable, const Options& opts) {
+SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info, const SkPMColor* ctable,
+ const Options& opts, int subsetLeft, int subsetWidth) {
// Create the swizzler based on the desired color type
switch (info.colorType()) {
case kIndex_8_SkColorType:
@@ -82,8 +82,8 @@ SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info,
default:
return nullptr;
}
- return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info,
- opts.fZeroInitialized);
+ return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts.fZeroInitialized,
+ subsetLeft, subsetWidth);
}
bool SkWbmpCodec::readRow(uint8_t* row) {
@@ -121,7 +121,7 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
setup_color_table(info.colorType(), ctable, ctableCount);
// Initialize the swizzler
- fSwizzler.reset(this->initializeSwizzler(info, ctable, options));
+ fSwizzler.reset(this->initializeSwizzler(info, ctable, options, 0,info.width()));
if (nullptr == fSwizzler.get()) {
return kInvalidConversion;
}
@@ -169,7 +169,8 @@ int SkWbmpCodec::onGetScanlines(void* dst, int count, size_t dstRowBytes) {
}
SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
- const Options& options, SkPMColor inputColorTable[], int* inputColorCount) {
+ const Options& options, SkPMColor inputColorTable[], int* inputColorCount, int subsetLeft,
+ int subsetWidth) {
if (options.fSubset) {
// Subsets are not supported.
return kUnimplemented;
@@ -188,8 +189,8 @@ SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
}
// Initialize the swizzler
- fSwizzler.reset(this->initializeSwizzler(dstInfo,
- get_color_ptr(fColorTable.get()), options));
+ fSwizzler.reset(this->initializeSwizzler(dstInfo, get_color_ptr(fColorTable.get()), options,
+ subsetLeft, subsetWidth));
if (nullptr == fSwizzler.get()) {
return kInvalidConversion;
}
« no previous file with comments | « src/codec/SkCodec_wbmp.h ('k') | src/codec/SkJpegCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698