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/CanvasStateTest.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/CanvasStateTest.cpp')
-rw-r--r-- | tests/CanvasStateTest.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp index f1c35929d6..7c441a40fe 100644 --- a/tests/CanvasStateTest.cpp +++ b/tests/CanvasStateTest.cpp @@ -24,10 +24,10 @@ static void test_complex_layers(skiatest::Reporter* reporter) { SkIntToScalar(WIDTH-(2*SPACER)), SkIntToScalar((HEIGHT-(2*SPACER)) / 7)); - const SkBitmap::Config configs[] = { SkBitmap::kRGB_565_Config, - SkBitmap::kARGB_8888_Config + const SkColorType colorTypes[] = { + kRGB_565_SkColorType, kPMColor_SkColorType }; - const int configCount = sizeof(configs) / sizeof(SkBitmap::Config); + const int configCount = sizeof(colorTypes) / sizeof(SkBitmap::Config); const int layerAlpha[] = { 255, 255, 0 }; const SkCanvas::SaveFlags flags[] = { SkCanvas::kARGB_NoClipLayer_SaveFlag, @@ -40,8 +40,9 @@ static void test_complex_layers(skiatest::Reporter* reporter) { for (int i = 0; i < configCount; ++i) { SkBitmap bitmaps[2]; for (int j = 0; j < 2; ++j) { - bitmaps[j].setConfig(configs[i], WIDTH, HEIGHT); - bitmaps[j].allocPixels(); + bitmaps[j].allocPixels(SkImageInfo::Make(WIDTH, HEIGHT, + colorTypes[i], + kPremul_SkAlphaType)); SkCanvas canvas(bitmaps[j]); @@ -127,8 +128,7 @@ static void test_complex_clips(skiatest::Reporter* reporter) { SkBitmap bitmaps[2]; for (int i = 0; i < 2; ++i) { - bitmaps[i].setConfig(SkBitmap::kARGB_8888_Config, WIDTH, HEIGHT); - bitmaps[i].allocPixels(); + bitmaps[i].allocN32Pixels(WIDTH, HEIGHT); SkCanvas canvas(bitmaps[i]); |