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

Unified Diff: src/codec/SkCodec_wbmp.cpp

Issue 1372973002: Move all knowledge of X sampling into SkScaledCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@codecSDmerge
Patch Set: Attempt to fix RLE overflow 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 1696dfb58515cd6ebf699bf1f2da54d16610b35c..d7f446bb5766558eb2f4e5f91f2f99071ec7f740 100644
--- a/src/codec/SkCodec_wbmp.cpp
+++ b/src/codec/SkCodec_wbmp.cpp
@@ -9,7 +9,6 @@
#include "SkCodecPriv.h"
#include "SkColorPriv.h"
#include "SkColorTable.h"
-#include "SkScaledCodec.h"
#include "SkStream.h"
#include "SkCodec_wbmp.h"
@@ -79,11 +78,12 @@ SkSwizzler* SkWbmpCodec::initializeSwizzler(const SkImageInfo& info,
case kN32_SkColorType:
case kRGB_565_SkColorType:
case kGray_8_SkColorType:
- return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info, opts.fZeroInitialized,
- this->getInfo());
+ break;
default:
return nullptr;
}
+ return SkSwizzler::CreateSwizzler(SkSwizzler::kBit, ctable, info,
+ opts.fZeroInitialized);
}
SkCodec::Result SkWbmpCodec::readRow(uint8_t* row) {
@@ -114,9 +114,6 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
// Subsets are not supported.
return kUnimplemented;
}
- if (info.dimensions() != this->getInfo().dimensions()) {
- return kInvalidScale;
- }
if (!valid_alpha(info.alphaType(), this->getInfo().alphaType())) {
return kInvalidConversion;
@@ -125,7 +122,6 @@ SkCodec::Result SkWbmpCodec::onGetPixels(const SkImageInfo& info,
// Prepare a color table if necessary
setup_color_table(info.colorType(), ctable, ctableCount);
-
// Initialize the swizzler
SkAutoTDelete<SkSwizzler> swizzler(this->initializeSwizzler(info, ctable, options));
if (nullptr == swizzler.get()) {
@@ -181,11 +177,6 @@ SkCodec::Result SkWbmpCodec::onStartScanlineDecode(const SkImageInfo& dstInfo,
// Subsets are not supported.
return kUnimplemented;
}
- if (dstInfo.dimensions() != this->getInfo().dimensions()) {
- if (!SkScaledCodec::DimensionsSupportedForSampling(this->getInfo(), dstInfo)) {
- return kInvalidScale;
- }
- }
if (!valid_alpha(dstInfo.alphaType(), this->getInfo().alphaType())) {
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