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

Unified Diff: tests/CachedDecodingPixelRefTest.cpp

Issue 919693002: Make SkImageGenerator::getPixels() return an enum. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Stage the change for chromium Created 5 years, 10 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/ports/SkImageGenerator_skia.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CachedDecodingPixelRefTest.cpp
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index e8fea2fdf2a71b792486a37ab35799a8c50ba63b..51cb7ba38d70166754f2697e800b442fc794c8e8 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -189,15 +189,15 @@ protected:
return true;
}
- virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
- SkPMColor ctable[], int* ctableCount) SK_OVERRIDE {
+ virtual Result onGetPixelsEnum(const SkImageInfo& info, void* pixels, size_t rowBytes,
+ SkPMColor ctable[], int* ctableCount) SK_OVERRIDE {
REPORTER_ASSERT(fReporter, pixels != NULL);
- size_t minRowBytes = static_cast<size_t>(info.width() * info.bytesPerPixel());
- REPORTER_ASSERT(fReporter, rowBytes >= minRowBytes);
- if ((NULL == pixels)
- || (fType != kSucceedGetPixels_TestType)
- || (info.colorType() != kN32_SkColorType)) {
- return false;
+ REPORTER_ASSERT(fReporter, rowBytes >= info.minRowBytes());
+ if (fType != kSucceedGetPixels_TestType) {
+ return kUnimplemented;
+ }
+ if (info.colorType() != kN32_SkColorType) {
+ return kInvalidConversion;
}
char* bytePtr = static_cast<char*>(pixels);
for (int y = 0; y < info.height(); ++y) {
@@ -205,7 +205,7 @@ protected:
TestImageGenerator::Color(), info.width());
bytePtr += rowBytes;
}
- return true;
+ return kSuccess;
}
private:
« no previous file with comments | « src/ports/SkImageGenerator_skia.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698