Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)
Reason for revert:
broke all Windows bots
Original issue's description:
> setConfig -> setInfo
>
> BUG=skia:
>
> Committed: http://code.google.com/p/skia/source/detail?r=14978
R=robertphillips@google.com, reed@google.com
TBR=reed@google.com, robertphillips@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Author: epoger@google.com
Review URL: https://codereview.chromium.org/302053002
git-svn-id: http://skia.googlecode.com/svn/trunk@14979 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp
index 40cfbe0..74f4ac9 100644
--- a/tests/BitmapCopyTest.cpp
+++ b/tests/BitmapCopyTest.cpp
@@ -336,8 +336,9 @@
// Test with a very large configuration without pixel buffer
// attached.
SkBitmap tstSafeSize;
- tstSafeSize.setInfo(SkImageInfo::Make(100000000U, 100000000U,
- gPairs[i].fColorType, kPremul_SkAlphaType));
+ tstSafeSize.setConfig(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 ef560aa..dce1069 100644
--- a/tests/BitmapTest.cpp
+++ b/tests/BitmapTest.cpp
@@ -13,10 +13,11 @@
SkBitmap bm;
int width = 1 << 29; // *4 will be the high-bit of 32bit int
- SkImageInfo info = SkImageInfo::MakeA8(width, 1);
- REPORTER_ASSERT(reporter, bm.setInfo(info));
+ SkImageInfo info = SkImageInfo::Make(width, 1, kAlpha_8_SkColorType,
+ kPremul_SkAlphaType);
+ REPORTER_ASSERT(reporter, bm.setConfig(info));
info.fColorType = kRGB_565_SkColorType;
- REPORTER_ASSERT(reporter, bm.setInfo(info));
+ REPORTER_ASSERT(reporter, bm.setConfig(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.
@@ -25,7 +26,7 @@
// in a uint32_t (or larger), but for now this is the constraint.
info.fColorType = kN32_SkColorType;
- REPORTER_ASSERT(reporter, !bm.setInfo(info));
+ REPORTER_ASSERT(reporter, !bm.setConfig(info));
}
/**
@@ -36,7 +37,8 @@
for (int width = 0; width < 2; ++width) {
for (int height = 0; height < 2; ++height) {
SkBitmap bm;
- bool setConf = bm.setInfo(SkImageInfo::MakeN32Premul(width, height));
+ bool setConf = bm.setConfig(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 7219c9e..a1c28dd 100644
--- a/tests/CanvasTest.cpp
+++ b/tests/CanvasTest.cpp
@@ -101,7 +101,7 @@
SkISize size = canvas->getDeviceSize();
SkBitmap bm;
- bm.setInfo(SkImageInfo::MakeN32Premul(size.width(), size.height()));
+ bm.setConfig(SkImageInfo::MakeN32Premul(size.width(), size.height()));
SkCanvas c(bm);
Canvas2CanvasClipVisitor visitor(&c);
diff --git a/tests/ImageDecodingTest.cpp b/tests/ImageDecodingTest.cpp
index b30f551..21c7747 100644
--- a/tests/ImageDecodingTest.cpp
+++ b/tests/ImageDecodingTest.cpp
@@ -509,7 +509,7 @@
SkStream::NewFromFile(path.c_str()));
if (sk_exists(path.c_str())) {
SkBitmap bm;
- SkAssertResult(bm.setInfo(SkImageInfo::MakeN32Premul(1, 1)));
+ SkAssertResult(bm.setConfig(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 1ef32ab..98cd90e 100644
--- a/tests/PictureTest.cpp
+++ b/tests/PictureTest.cpp
@@ -1185,7 +1185,7 @@
// This bitmap has a width and height but no pixels. As a result, attempting to record it will
// fail.
SkBitmap bm;
- bm.setInfo(SkImageInfo::MakeN32Premul(100, 100));
+ bm.setConfig(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 test_draw_bitmaps(SkCanvas* canvas) {
SkBitmap empty;
draw_bitmaps(empty, canvas);
- empty.setInfo(SkImageInfo::MakeN32Premul(10, 10));
+ empty.setConfig(SkImageInfo::MakeN32Premul(10, 10));
draw_bitmaps(empty, canvas);
}
diff --git a/tests/PipeTest.cpp b/tests/PipeTest.cpp
index 00a1a3f..fd98fca 100644
--- a/tests/PipeTest.cpp
+++ b/tests/PipeTest.cpp
@@ -16,7 +16,8 @@
// Ensures that the pipe gracefully handles drawing an invalid bitmap.
static void testDrawingBadBitmap(SkCanvas* pipeCanvas) {
SkBitmap badBitmap;
- badBitmap.setInfo(SkImageInfo::MakeUnknown(5, 5));
+ badBitmap.setConfig(SkImageInfo::Make(5, 5, kUnknown_SkColorType,
+ kPremul_SkAlphaType));
pipeCanvas->drawBitmap(badBitmap, 0, 0);
}
@@ -43,7 +44,7 @@
DEF_TEST(Pipe, reporter) {
SkBitmap bitmap;
- bitmap.setInfo(SkImageInfo::MakeN32Premul(64, 64));
+ bitmap.setConfig(SkImageInfo::MakeN32Premul(64, 64));
SkCanvas canvas(bitmap);
PipeController pipeController(&canvas);
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 3e22f7c..804a7c4 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -238,7 +238,7 @@
if (alloc) {
bitmap->allocPixels(info);
} else {
- bitmap->setInfo(info, rowBytes);
+ bitmap->setConfig(info, rowBytes);
}
}
diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp
index ce91490..c8f8e49 100644
--- a/tests/SerializationTest.cpp
+++ b/tests/SerializationTest.cpp
@@ -390,12 +390,12 @@
SkImageInfo info = SkImageInfo::MakeN32Premul(kBitmapSize, kBitmapSize);
SkBitmap validBitmap;
- validBitmap.setInfo(info);
+ validBitmap.setConfig(info);
// Create a bitmap with a really large height
info.fHeight = 1000000000;
SkBitmap invalidBitmap;
- invalidBitmap.setInfo(info);
+ invalidBitmap.setConfig(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 90d25d7..506c7cd 100644
--- a/tests/ShaderOpacityTest.cpp
+++ b/tests/ShaderOpacityTest.cpp
@@ -14,7 +14,7 @@
SkImageInfo info = SkImageInfo::MakeN32Premul(2, 2);
SkBitmap bmp;
- bmp.setInfo(info);
+ bmp.setConfig(info);
// test 1: bitmap without pixel data
SkShader* shader = SkShader::CreateBitmapShader(bmp,
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 1a52793..a0e3051 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -290,7 +290,7 @@
// sure that the two rowBytes match (and the infos match).
//
static bool allocRowBytes(SkBitmap* bm, const SkImageInfo& info, size_t rowBytes) {
- if (!bm->setInfo(info, rowBytes)) {
+ if (!bm->setConfig(info, rowBytes)) {
return false;
}
SkPixelRef* pr = SkMallocPixelRef::NewAllocate(info, rowBytes, NULL);