diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-29 21:10:32 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-05-29 21:10:32 +0000 |
commit | d0f824cfbd8951bb948b19d7ff5dce028ce557a5 (patch) | |
tree | 4698434f439e248887ed732ce445ca036edb16b3 /tests | |
parent | 986d681f3e7a7eb6febd9df9fe21a8d277ba2296 (diff) |
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
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, 22 insertions, 18 deletions
diff --git a/tests/BitmapCopyTest.cpp b/tests/BitmapCopyTest.cpp index 40cfbe0d54..74f4ac9d34 100644 --- a/tests/BitmapCopyTest.cpp +++ b/tests/BitmapCopyTest.cpp @@ -336,8 +336,9 @@ DEF_TEST(BitmapCopy, reporter) { // 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 ef560aa6d6..dce1069542 100644 --- a/tests/BitmapTest.cpp +++ b/tests/BitmapTest.cpp @@ -13,10 +13,11 @@ 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::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 @@ 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.setInfo(info)); + REPORTER_ASSERT(reporter, !bm.setConfig(info)); } /** @@ -36,7 +37,8 @@ DEF_TEST(Bitmap, reporter) { 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 7219c9e750..a1c28ddbb4 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.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 b30f551e0c..21c774727d 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.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 1ef32abb95..98cd90e950 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.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 draw_bitmaps(const SkBitmap bitmap, SkCanvas* canvas) { 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 00a1a3f201..fd98fca7ef 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 @@ static void testDrawingAfterEndRecording(SkCanvas* canvas) { 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 3e22f7c73c..804a7c4abe 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->setInfo(info, rowBytes); + bitmap->setConfig(info, rowBytes); } } diff --git a/tests/SerializationTest.cpp b/tests/SerializationTest.cpp index ce91490f3e..c8f8e4926e 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.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 90d25d731a..506c7cd36a 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.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 1a527937de..a0e3051680 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->setInfo(info, rowBytes)) { + if (!bm->setConfig(info, rowBytes)) { return false; } SkPixelRef* pr = SkMallocPixelRef::NewAllocate(info, rowBytes, NULL); |