aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PremulAlphaRoundTripTest.cpp
diff options
context:
space:
mode:
authorGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-13 14:41:43 +0000
committerGravatar mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-13 14:41:43 +0000
commitdeee496cd30070e52556dcb538c2e5eb39b66b81 (patch)
tree80f0326a191c966bc34057e4011bdb3233bc2a50 /tests/PremulAlphaRoundTripTest.cpp
parentb720ffd20829953c9595980422969520f5e33c76 (diff)
replace setConfig+allocPixels with single call
BUG=skia: Review URL: https://codereview.chromium.org/162643002 git-svn-id: http://skia.googlecode.com/svn/trunk@13426 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tests/PremulAlphaRoundTripTest.cpp')
-rw-r--r--tests/PremulAlphaRoundTripTest.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/tests/PremulAlphaRoundTripTest.cpp b/tests/PremulAlphaRoundTripTest.cpp
index 77f62dcecd..5e8e8bf1dd 100644
--- a/tests/PremulAlphaRoundTripTest.cpp
+++ b/tests/PremulAlphaRoundTripTest.cpp
@@ -17,8 +17,7 @@
static void fillCanvas(SkCanvas* canvas, SkCanvas::Config8888 unpremulConfig) {
SkBitmap bmp;
- bmp.setConfig(SkBitmap::kARGB_8888_Config, 256, 256);
- bmp.allocPixels();
+ bmp.allocN32Pixels(256, 256);
SkAutoLockPixels alp(bmp);
uint32_t* pixels = reinterpret_cast<uint32_t*>(bmp.getPixels());
@@ -72,11 +71,9 @@ DEF_GPUTEST(PremulAlphaRoundTrip, reporter, factory) {
SkCanvas canvas(device);
SkBitmap readBmp1;
- readBmp1.setConfig(SkBitmap::kARGB_8888_Config, 256, 256);
- readBmp1.allocPixels();
+ readBmp1.allocN32Pixels(256, 256);
SkBitmap readBmp2;
- readBmp2.setConfig(SkBitmap::kARGB_8888_Config, 256, 256);
- readBmp2.allocPixels();
+ readBmp2.allocN32Pixels(256, 256);
for (size_t upmaIdx = 0;
upmaIdx < SK_ARRAY_COUNT(gUnpremulConfigs);