aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-29 15:57:20 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-29 15:57:20 +0000
commit00f8d6c75d22ce8f95f932c5b101354b196fa0df (patch)
tree7ff413f0df54836620b2ba58c524d62ce7d033ff /tests
parent2246e325b8710389d8f718843356e410f683dd25 (diff)
Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/304443003/)"
Fix is to add colortable param to installPixels() This reverts commit 924205aaf2e0c3c65dda13e0eaccde3e7b2a5c40. BUG=skia: R=scroggo@google.com, reed@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/300263005 git-svn-id: http://skia.googlecode.com/svn/trunk@14958 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/AAClipTest.cpp2
-rw-r--r--tests/BitmapGetColorTest.cpp2
-rw-r--r--tests/CachedDecodingPixelRefTest.cpp10
-rw-r--r--tests/DeferredCanvasTest.cpp2
-rw-r--r--tests/DrawBitmapRectTest.cpp12
-rw-r--r--tests/DrawPathTest.cpp3
-rw-r--r--tests/SurfaceTest.cpp2
7 files changed, 15 insertions, 18 deletions
diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp
index cadd1806cf..26c1ec1d0e 100644
--- a/tests/AAClipTest.cpp
+++ b/tests/AAClipTest.cpp
@@ -76,7 +76,7 @@ static void copyToMask(const SkRegion& rgn, SkMask* mask) {
kAlpha_8_SkColorType,
kPremul_SkAlphaType);
SkBitmap bitmap;
- bitmap.installPixels(info, mask->fImage, mask->fRowBytes, NULL, NULL);
+ bitmap.installPixels(info, mask->fImage, mask->fRowBytes);
// canvas expects its coordinate system to always be 0,0 in the top/left
// so we translate the rgn to match that before drawing into the mask.
diff --git a/tests/BitmapGetColorTest.cpp b/tests/BitmapGetColorTest.cpp
index bf6ebcb5cf..bf3ba67ecb 100644
--- a/tests/BitmapGetColorTest.cpp
+++ b/tests/BitmapGetColorTest.cpp
@@ -37,7 +37,7 @@ DEF_TEST(GetColor, reporter) {
kPremul_SkAlphaType);
SkBitmap bm;
uint32_t storage[4];
- bm.installPixels(info, storage, info.minRowBytes(), NULL, NULL);
+ bm.installPixels(info, storage, info.minRowBytes());
bm.eraseColor(initColor);
bm.eraseArea(area, gRec[i].fInColor);
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/DeferredCanvasTest.cpp b/tests/DeferredCanvasTest.cpp
index 9ffb790507..747b23b9ab 100644
--- a/tests/DeferredCanvasTest.cpp
+++ b/tests/DeferredCanvasTest.cpp
@@ -40,7 +40,7 @@ static SkSurface* createSurface(SkColor color) {
static SkPMColor read_pixel(SkSurface* surface, int x, int y) {
SkPMColor pixel = 0;
SkBitmap bitmap;
- bitmap.installPixels(SkImageInfo::MakeN32Premul(1, 1), &pixel, 4, NULL, NULL);
+ bitmap.installPixels(SkImageInfo::MakeN32Premul(1, 1), &pixel, 4);
SkCanvas canvas(bitmap);
SkPaint paint;
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
diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp
index dbafa40be2..2af4224c9c 100644
--- a/tests/DrawPathTest.cpp
+++ b/tests/DrawPathTest.cpp
@@ -15,8 +15,7 @@
static void test_big_aa_rect(skiatest::Reporter* reporter) {
SkBitmap output;
SkPMColor pixel[1];
- output.installPixels(SkImageInfo::MakeN32Premul(1, 1),
- pixel, 4, NULL, NULL);
+ output.installPixels(SkImageInfo::MakeN32Premul(1, 1), pixel, 4);
SkSurface* surf = SkSurface::NewRasterPMColor(300, 33300);
SkCanvas* canvas = surf->getCanvas();
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 7d5607ce43..3f61f89abe 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -101,7 +101,7 @@ static SkImage* createImage(ImageType imageType, GrContext* context,
return NULL; // TODO
case kCodec_ImageType: {
SkBitmap bitmap;
- bitmap.installPixels(info, addr, rowBytes, NULL, NULL);
+ bitmap.installPixels(info, addr, rowBytes);
SkAutoTUnref<SkData> src(
SkImageEncoder::EncodeData(bitmap, SkImageEncoder::kPNG_Type,
100));