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

Unified Diff: src/ports/SkImageGenerator_skia.cpp

Issue 1263013002: Remove SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 5 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/images/SkDecodingImageGenerator.cpp ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkImageGenerator_skia.cpp
diff --git a/src/ports/SkImageGenerator_skia.cpp b/src/ports/SkImageGenerator_skia.cpp
index 1dbc9a5f33e491cecc3fbde18f7e60e1e8331194..72480b8f6849be1fe5b3607efd7f5c40f22b20aa 100644
--- a/src/ports/SkImageGenerator_skia.cpp
+++ b/src/ports/SkImageGenerator_skia.cpp
@@ -46,14 +46,8 @@ protected:
SkData* onRefEncodedData() override {
return SkRef(fData.get());
}
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- Result onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
- const Options&,
- SkPMColor ctableEntries[], int* ctableCount) override {
-#else
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctableEntries[], int* ctableCount) override {
-#endif
SkMemoryStream stream(fData->data(), fData->size(), false);
SkAutoTUnref<BareMemoryAllocator> allocator(SkNEW_ARGS(BareMemoryAllocator,
(info, pixels, rowBytes)));
@@ -64,11 +58,7 @@ protected:
const SkImageDecoder::Result result = fDecoder->decode(&stream, &bm, info.colorType(),
SkImageDecoder::kDecodePixels_Mode);
if (SkImageDecoder::kFailure == result) {
-#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
- return kInvalidInput;
-#else
return false;
-#endif
}
SkASSERT(info.colorType() == bm.info().colorType());
@@ -78,24 +68,13 @@ protected:
SkColorTable* ctable = bm.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 == result) {
- return kIncompleteInput;
- }
- return kSuccess;
-#else
return true;
-#endif
}
bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3],
« no previous file with comments | « src/images/SkDecodingImageGenerator.cpp ('k') | tests/CachedDecodingPixelRefTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698