diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-28 16:01:55 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-28 16:01:55 +0000 |
commit | b263985850a7a74ccd5fda2abb057b04f7254e41 (patch) | |
tree | 79baa0c9e6de4128af01cbfa297a1c6da7a72789 /tests | |
parent | 7c18351d1f9f8fe4c5cbebf1852cd4f7bb5e026f (diff) |
add colortable support to imagegenerator
BUG=skia:
R=halcanary@google.com, scroggo@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/304443003
git-svn-id: http://skia.googlecode.com/svn/trunk@14916 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/CachedDecodingPixelRefTest.cpp | 10 | ||||
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 12 |
2 files changed, 10 insertions, 12 deletions
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp index 10e33ba841..eff77e215d 100644 --- a/tests/CachedDecodingPixelRefTest.cpp +++ b/tests/CachedDecodingPixelRefTest.cpp @@ -183,7 +183,9 @@ public: SkASSERT((fType <= kLast_TestType) && (fType >= 0)); } virtual ~TestImageGenerator() { } - virtual bool getInfo(SkImageInfo* info) SK_OVERRIDE { + +protected: + virtual bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { REPORTER_ASSERT(fReporter, NULL != info); if ((NULL == info) || (kFailGetInfo_TestType == fType)) { return false; @@ -194,9 +196,9 @@ public: info->fAlphaType = kOpaque_SkAlphaType; return true; } - virtual bool getPixels(const SkImageInfo& info, - void* pixels, - size_t rowBytes) SK_OVERRIDE { + + virtual bool 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.fWidth * info.bytesPerPixel()); diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index f294ae7e6e..aa69de4bd4 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -22,20 +22,16 @@ class FailureImageGenerator : public SkImageGenerator { public: FailureImageGenerator() { } virtual ~FailureImageGenerator() { } - virtual bool getInfo(SkImageInfo* info) SK_OVERRIDE { + +protected: + virtual bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { info->fWidth = 100; info->fHeight = 100; info->fColorType = kN32_SkColorType; info->fAlphaType = kPremul_SkAlphaType; return true; } - virtual bool getPixels(const SkImageInfo& info, - void* pixels, - size_t rowBytes) SK_OVERRIDE { - // this will deliberately return false if they are asking us - // to decode into pixels. - return false; - } + // default onGetPixels() returns false, which is what we want. }; // crbug.com/295895 |