Chromium Code Reviews| Index: tests/CachedDecodingPixelRefTest.cpp |
| diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp |
| index e8fea2fdf2a71b792486a37ab35799a8c50ba63b..2bbb99596b4fae6bf376ef1fd1d7a07b1478f0ab 100644 |
| --- a/tests/CachedDecodingPixelRefTest.cpp |
| +++ b/tests/CachedDecodingPixelRefTest.cpp |
| @@ -189,15 +189,16 @@ protected: |
| return true; |
| } |
| - virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
| - SkPMColor ctable[], int* ctableCount) SK_OVERRIDE { |
| + virtual Result onGetPixels(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()); |
| + const size_t minRowBytes = info.minRowBytes(); |
|
djsollen
2015/02/12 14:22:15
remove this and have >= info.minRowBytes on next l
scroggo
2015/02/12 15:28:36
I originally wrote that, but then I thought I saw
|
| REPORTER_ASSERT(fReporter, rowBytes >= minRowBytes); |
| - if ((NULL == pixels) |
| - || (fType != kSucceedGetPixels_TestType) |
| - || (info.colorType() != kN32_SkColorType)) { |
| - return false; |
| + 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 +206,7 @@ protected: |
| TestImageGenerator::Color(), info.width()); |
| bytePtr += rowBytes; |
| } |
| - return true; |
| + return kSuccess; |
| } |
| private: |