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 20:47:53 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-05-29 20:47:53 +0000
commit986d681f3e7a7eb6febd9df9fe21a8d277ba2296 (patch)
tree7139fd9e9448f5c2025ce10d0251b6eb15c1e7ef /tests
parent39e8d93337c7e37d2b09dc710a05a9beefef5c2c (diff)
setConfig -> setInfo
BUG=skia: R=robertphillips@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/308683005 git-svn-id: http://skia.googlecode.com/svn/trunk@14978 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r--tests/BitmapCopyTest.cpp5
-rw-r--r--tests/BitmapTest.cpp12
-rw-r--r--tests/CanvasTest.cpp2
-rw-r--r--tests/ImageDecodingTest.cpp2
-rw-r--r--tests/PictureTest.cpp4
-rw-r--r--tests/PipeTest.cpp5
-rw-r--r--tests/ReadPixelsTest.cpp2
-rw-r--r--tests/SerializationTest.cpp4
-rw-r--r--tests/ShaderOpacityTest.cpp2
-rw-r--r--tests/WritePixelsTest.cpp2
10 files changed, 18 insertions, 22 deletions
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 74f4ac9d34..40cfbe0d54 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -336,9 +336,8 @@ DEF_TEST(BitmapCopy, reporter) {
// Test with a very large configuration without pixel buffer
// attached.
SkBitmap tstSafeSize;
- tstSafeSize.setConfig(SkImageInfo::Make(100000000U, 100000000U,
- gPairs[i].fColorType,
- kPremul_SkAlphaType));
+ tstSafeSize.setInfo(SkImageInfo::Make(100000000U, 100000000U,
+ gPairs[i].fColorType, kPremul_SkAlphaType));
int64_t safeSize = tstSafeSize.computeSafeSize64();
if (safeSize < 0) {
ERRORF(reporter, "getSafeSize64() negative: %s",
diff --git a/tests/BitmapTest.cpp b/tests/BitmapTest.cpp
index dce1069542..ef560aa6d6 100644
--- a/tests/BitmapTest.cpp
+++ b/tests/BitmapTest.cpp
@@ -13,11 +13,10 @@ static void test_bigwidth(skiatest::Reporter* reporter) {
SkBitmap bm;
int width = 1 << 29; // *4 will be the high-bit of 32bit int
- SkImageInfo info = SkImageInfo::Make(width, 1, kAlpha_8_SkColorType,
- kPremul_SkAlphaType);
- REPORTER_ASSERT(reporter, bm.setConfig(info));
+ SkImageInfo info = SkImageInfo::MakeA8(width, 1);
+ REPORTER_ASSERT(reporter, bm.setInfo(info));
info.fColorType = kRGB_565_SkColorType;
- REPORTER_ASSERT(reporter, bm.setConfig(info));
+ REPORTER_ASSERT(reporter, bm.setInfo(info));
// for a 4-byte config, this width will compute a rowbytes of 0x80000000,
// which does not fit in a int32_t. setConfig should detect this, and fail.
@@ -26,7 +25,7 @@ static void test_bigwidth(skiatest::Reporter* reporter) {
// in a uint32_t (or larger), but for now this is the constraint.
info.fColorType = kN32_SkColorType;
- REPORTER_ASSERT(reporter, !bm.setConfig(info));
+ REPORTER_ASSERT(reporter, !bm.setInfo(info));
}
/**
@@ -37,8 +36,7 @@ DEF_TEST(Bitmap, reporter) {
for (int width = 0; width < 2; ++width) {
for (int height = 0; height < 2; ++height) {
SkBitmap bm;
- bool setConf = bm.setConfig(SkImageInfo::MakeN32Premul(width,
- height));
+ bool setConf = bm.setInfo(SkImageInfo::MakeN32Premul(width, height));
REPORTER_ASSERT(reporter, setConf);
if (setConf) {
REPORTER_ASSERT(reporter, bm.allocPixels(NULL));
diff --git a/tests/CanvasTest.cpp b/tests/CanvasTest.cpp
index a1c28ddbb4..7219c9e750 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -101,7 +101,7 @@ static void test_clipVisitor(skiatest::Reporter* reporter, SkCanvas* canvas) {
SkISize size = canvas->getDeviceSize();
SkBitmap bm;
- bm.setConfig(SkImageInfo::MakeN32Premul(size.width(), size.height()));
+ bm.setInfo(SkImageInfo::MakeN32Premul(size.width(), size.height()));
SkCanvas c(bm);
Canvas2CanvasClipVisitor visitor(&c);
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index 21c774727d..b30f551e0c 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -509,7 +509,7 @@ DEF_TEST(ImprovedBitmapFactory, reporter) {
SkStream::NewFromFile(path.c_str()));
if (sk_exists(path.c_str())) {
SkBitmap bm;
- SkAssertResult(bm.setConfig(SkImageInfo::MakeN32Premul(1, 1)));
+ SkAssertResult(bm.setInfo(SkImageInfo::MakeN32Premul(1, 1)));
REPORTER_ASSERT(reporter,
NULL != install_pixel_ref(&bm, stream.detach(), 1, true));
SkAutoLockPixels alp(bm);
diff --git a/tests/PictureTest.cpp b/tests/PictureTest.cpp
index 98cd90e950..1ef32abb95 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1185,7 +1185,7 @@ static void test_bad_bitmap() {
// This bitmap has a width and height but no pixels. As a result, attempting to record it will
// fail.
SkBitmap bm;
- bm.setConfig(SkImageInfo::MakeN32Premul(100, 100));
+ bm.setInfo(SkImageInfo::MakeN32Premul(100, 100));
SkPictureRecorder recorder;
SkCanvas* recordingCanvas = recorder.beginRecording(100, 100, NULL, 0);
recordingCanvas->drawBitmap(bm, 0, 0);
@@ -1616,7 +1616,7 @@ static void draw_bitmaps(const SkBitmap bitmap, SkCanvas* canvas) {
static void test_draw_bitmaps(SkCanvas* canvas) {
SkBitmap empty;
draw_bitmaps(empty, canvas);
- empty.setConfig(SkImageInfo::MakeN32Premul(10, 10));
+ empty.setInfo(SkImageInfo::MakeN32Premul(10, 10));
draw_bitmaps(empty, canvas);
}
diff --git a/tests/PipeTest.cpp b/tests/PipeTest.cpp
index fd98fca7ef..00a1a3f201 100644
--- a/tests/PipeTest.cpp
+++ b/tests/PipeTest.cpp
@@ -16,8 +16,7 @@
// Ensures that the pipe gracefully handles drawing an invalid bitmap.
static void testDrawingBadBitmap(SkCanvas* pipeCanvas) {
SkBitmap badBitmap;
- badBitmap.setConfig(SkImageInfo::Make(5, 5, kUnknown_SkColorType,
- kPremul_SkAlphaType));
+ badBitmap.setInfo(SkImageInfo::MakeUnknown(5, 5));
pipeCanvas->drawBitmap(badBitmap, 0, 0);
}
@@ -44,7 +43,7 @@ static void testDrawingAfterEndRecording(SkCanvas* canvas) {
DEF_TEST(Pipe, reporter) {
SkBitmap bitmap;
- bitmap.setConfig(SkImageInfo::MakeN32Premul(64, 64));
+ bitmap.setInfo(SkImageInfo::MakeN32Premul(64, 64));
SkCanvas canvas(bitmap);
PipeController pipeController(&canvas);
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 804a7c4abe..3e22f7c73c 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -238,7 +238,7 @@ static void init_bitmap(SkBitmap* bitmap, const SkIRect& rect, BitmapInit init,
if (alloc) {
bitmap->allocPixels(info);
} else {
- bitmap->setConfig(info, rowBytes);
+ bitmap->setInfo(info, rowBytes);
}
}
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index c8f8e4926e..ce91490f3e 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -390,12 +390,12 @@ DEF_TEST(Serialization, reporter) {
SkImageInfo info = SkImageInfo::MakeN32Premul(kBitmapSize, kBitmapSize);
SkBitmap validBitmap;
- validBitmap.setConfig(info);
+ validBitmap.setInfo(info);
// Create a bitmap with a really large height
info.fHeight = 1000000000;
SkBitmap invalidBitmap;
- invalidBitmap.setConfig(info);
+ invalidBitmap.setInfo(info);
// The deserialization should succeed, and the rendering shouldn't crash,
// even when the device fails to initialize, due to its size
diff --git a/tests/ShaderOpacityTest.cpp b/tests/ShaderOpacityTest.cpp
index 506c7cd36a..90d25d731a 100644
--- a/tests/ShaderOpacityTest.cpp
+++ b/tests/ShaderOpacityTest.cpp
@@ -14,7 +14,7 @@ static void test_bitmap(skiatest::Reporter* reporter) {
SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2);
SkBitmap bmp;
- bmp.setConfig(info);
+ bmp.setInfo(info);
// test 1: bitmap without pixel data
SkShader* shader = SkShader::CreateBitmapShader(bmp,
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index a0e3051680..1a527937de 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -290,7 +290,7 @@ static const CanvasConfig gCanvasConfigs[] = {
// sure that the two rowBytes match (and the infos match).
//
static bool allocRowBytes(SkBitmap* bm, const SkImageInfo& info, size_t rowBytes) {
- if (!bm->setConfig(info, rowBytes)) {
+ if (!bm->setInfo(info, rowBytes)) {
return false;
}
SkPixelRef* pr = SkMallocPixelRef::NewAllocate(info, rowBytes, NULL);