aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/images
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@chromium.org>2015-07-30 07:47:45 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-30 07:47:45 -0700
commitef004e1b49ce6ad488ea4444c0eb896ef37c1242 (patch)
treecc06764b4fc7d508c2a1a13a0cba8ed334aa010b /src/images
parent6cb3cbe8e67db5fb94ba7d98f60833229b008544 (diff)
Remove SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
Now that Chrome no longer depends on it, remove dead code. Review URL: https://codereview.chromium.org/1263013002
Diffstat (limited to 'src/images')
-rw-r--r--src/images/SkDecodingImageGenerator.cpp46
1 files changed, 0 insertions, 46 deletions
diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp
index 6b2f73b2e4..b4af220d71 100644
--- a/src/images/SkDecodingImageGenerator.cpp
+++ b/src/images/SkDecodingImageGenerator.cpp
@@ -38,14 +38,8 @@ public:
protected:
SkData* onRefEncodedData() override;
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- Result onGetPixels(const SkImageInfo& info,
- void* pixels, size_t rowBytes, const Options&,
- SkPMColor ctable[], int* ctableCount) override;
-#else
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctable[], int* ctableCount) override;
-#endif
bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
SkYUVColorSpace* colorSpace) override;
@@ -149,36 +143,19 @@ SkData* DecodingImageGenerator::onRefEncodedData() {
return SkSafeRef(fData);
}
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
-SkImageGenerator::Result DecodingImageGenerator::onGetPixels(const SkImageInfo& info,
- void* pixels, size_t rowBytes, const Options& options, SkPMColor ctableEntries[],
- int* ctableCount) {
-#else
bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctableEntries[], int* ctableCount) {
-#endif
if (fInfo != info) {
// The caller has specified a different info. This is an
// error for this kind of SkImageGenerator. Use the Options
// to change the settings.
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- if (info.dimensions() != fInfo.dimensions()) {
- return kInvalidScale;
- }
- return kInvalidConversion;
-#else
return false;
-#endif
}
SkAssertResult(fStream->rewind());
SkAutoTDelete<SkImageDecoder> decoder(SkImageDecoder::Factory(fStream));
if (NULL == decoder.get()) {
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- return kInvalidInput;
-#else
return false;
-#endif
}
decoder->setDitherImage(fDitherImage);
decoder->setSampleSize(fSampleSize);
@@ -191,11 +168,7 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels,
SkImageDecoder::kDecodePixels_Mode);
decoder->setAllocator(NULL);
if (SkImageDecoder::kFailure == decodeResult) {
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- return kInvalidInput;
-#else
return false;
-#endif
}
if (allocator.isReady()) { // Did not use pixels!
SkBitmap bm;
@@ -204,11 +177,7 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels,
if (!copySuccess || allocator.isReady()) {
SkDEBUGFAIL("bitmap.copyTo(requestedConfig) failed.");
// Earlier we checked canCopyto(); we expect consistency.
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- return kInvalidConversion;
-#else
return false;
-#endif
}
SkASSERT(check_alpha(info.alphaType(), bm.alphaType()));
} else {
@@ -218,32 +187,17 @@ bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels,
if (kIndex_8_SkColorType == info.colorType()) {
if (kIndex_8_SkColorType != bitmap.colorType()) {
// they asked for Index8, but we didn't receive that from decoder
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- return kInvalidConversion;
-#else
return false;
-#endif
}
SkColorTable* ctable = bitmap.getColorTable();
if (NULL == ctable) {
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- return kInvalidConversion;
-#else
return false;
-#endif
}
const int count = ctable->count();
memcpy(ctableEntries, ctable->readColors(), count * sizeof(SkPMColor));
*ctableCount = count;
}
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- if (SkImageDecoder::kPartialSuccess == decodeResult) {
- return kIncompleteInput;
- }
- return kSuccess;
-#else
return true;
-#endif
}
bool DecodingImageGenerator::onGetYUV8Planes(SkISize sizes[3], void* planes[3],