diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-13 22:00:04 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-13 22:00:04 +0000 |
commit | fa9e5fa42a555712fb7a29d08d2ae2bdef0ed68e (patch) | |
tree | 3b697b22d1fa371f6e1a0420cc19f5c093aa9fa0 /tests/DrawBitmapRectTest.cpp | |
parent | a7692a9ac6cb8a0bbe6bbdfc83f86014a7dc265e (diff) |
replace setConfig+allocPixels with alloc-or-install-pixels
BUG=skia:
R=scroggo@google.com, halcanary@google.com, reed@google.com
Author: reed@chromium.org
Review URL: https://codereview.chromium.org/164203003
git-svn-id: http://skia.googlecode.com/svn/trunk@13442 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/DrawBitmapRectTest.cpp')
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index a1681461cb..f51bf53cc8 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -178,8 +178,7 @@ static void assert_ifDrawnTo(skiatest::Reporter* reporter, static void test_wacky_bitmapshader(skiatest::Reporter* reporter, int width, int height, bool shouldBeDrawn) { SkBitmap dev; - dev.setConfig(SkBitmap::kARGB_8888_Config, 0x56F, 0x4f6); - dev.allocPixels(); + dev.allocN32Pixels(0x56F, 0x4f6); dev.eraseColor(SK_ColorTRANSPARENT); // necessary, so we know if we draw to it SkMatrix matrix; @@ -195,8 +194,7 @@ static void test_wacky_bitmapshader(skiatest::Reporter* reporter, c.concat(matrix); SkBitmap bm; - bm.setConfig(SkBitmap::kARGB_8888_Config, width, height); - bm.allocPixels(); + bm.allocN32Pixels(width, height); bm.eraseColor(SK_ColorRED); SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode, @@ -260,8 +258,7 @@ static void test_giantrepeat_crbug118018(skiatest::Reporter* reporter) { static void test_nan_antihair() { SkBitmap bm; - bm.setConfig(SkBitmap::kARGB_8888_Config, 20, 20); - bm.allocPixels(); + bm.allocN32Pixels(20, 20); SkCanvas canvas(bm); @@ -298,17 +295,16 @@ static bool check_for_all_zeros(const SkBitmap& bm) { static const int gWidth = 256; static const int gHeight = 256; -static void create(SkBitmap* bm, SkBitmap::Config config, SkColor color) { - bm->setConfig(config, gWidth, gHeight); - bm->allocPixels(); +static void create(SkBitmap* bm, SkColor color) { + bm->allocN32Pixels(gWidth, gHeight); bm->eraseColor(color); } DEF_TEST(DrawBitmapRect, reporter) { SkBitmap src, dst; - create(&src, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF); - create(&dst, SkBitmap::kARGB_8888_Config, 0); + create(&src, 0xFFFFFFFF); + create(&dst, 0); SkCanvas canvas(dst); |