diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-30 13:26:10 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-30 13:26:10 +0000 |
commit | a3264e53ee3f3c5d6a2c813df7e44b5b96d207f2 (patch) | |
tree | 5a95db31ba21ba5f0354b3e9e622a046fe6e04c4 /tests | |
parent | 16fdbd3141f23a348e4b9f706e77307a947bd5a2 (diff) |
Revert "Revert of setConfig -> setInfo (https://codereview.chromium.org/308683005/)"
This reverts commit eecaea4148805834f223681f70b6488ceba12d09.
R=robertphillips@google.com, scroggo@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/301283003
git-svn-id: http://skia.googlecode.com/svn/trunk@14989 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests')
-rw-r--r-- | tests/BitmapCopyTest.cpp | 5 | ||||
-rw-r--r-- | tests/BitmapTest.cpp | 12 | ||||
-rw-r--r-- | tests/CanvasTest.cpp | 2 | ||||
-rw-r--r-- | tests/ImageDecodingTest.cpp | 2 | ||||
-rw-r--r-- | tests/PictureTest.cpp | 4 | ||||
-rw-r--r-- | tests/PipeTest.cpp | 5 | ||||
-rw-r--r-- | tests/ReadPixelsTest.cpp | 2 | ||||
-rw-r--r-- | tests/SerializationTest.cpp | 4 | ||||
-rw-r--r-- | tests/ShaderOpacityTest.cpp | 2 | ||||
-rw-r--r-- | tests/WritePixelsTest.cpp | 2 |
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); |