aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar scroggo <scroggo@chromium.org>2015-07-09 09:08:00 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-07-09 09:08:00 -0700
commit5315fd4761a3c510dfff834a84e71e4c471951f9 (patch)
treea0fab94359f53b4c7e9411e06efffd4a801fe6af /tests
parentd17a32966afb2f7fdebfb58d37fa1b2d3e2d474b (diff)
Remove SkImageGenerator pieces only for SkCodec.
Follow up to the split between SkImageGenerator and SkCodec. Now that SkCodec does not inherit from SkImageGenerator, SkImageGenerator no longer needs Options or Result, which were added for SkCodec. Remove them, but keep them behind a flag, since Chromium has its own subclasses of SkImageGenerator which assume the old signature for onGetPixels. Review URL: https://codereview.chromium.org/1226023003
Diffstat (limited to 'tests')
-rw-r--r--tests/CachedDecodingPixelRefTest.cpp23
1 files changed, 20 insertions, 3 deletions
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index 465b69b856..a2032ba1de 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -182,16 +182,29 @@ protected:
kOpaque_SkAlphaType);
}
- virtual Result onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
- const Options&,
- SkPMColor ctable[], int* ctableCount) 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
REPORTER_ASSERT(fReporter, pixels != NULL);
REPORTER_ASSERT(fReporter, rowBytes >= info.minRowBytes());
if (fType != kSucceedGetPixels_TestType) {
+#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
return kUnimplemented;
+#else
+ return false;
+#endif
}
if (info.colorType() != kN32_SkColorType) {
+#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
return kInvalidConversion;
+#else
+ return false;
+#endif
}
char* bytePtr = static_cast<char*>(pixels);
for (int y = 0; y < info.height(); ++y) {
@@ -199,7 +212,11 @@ protected:
TestImageGenerator::Color(), info.width());
bytePtr += rowBytes;
}
+#ifdef SK_LEGACY_IMAGE_GENERATOR_ENUMS_AND_OPTIONS
return kSuccess;
+#else
+ return true;
+#endif
}
private: