Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1631)

Unified Diff: tests/CanvasStateTest.cpp

Issue 164203003: replace setConfig+allocPixels with alloc-or-install-pixels (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/BlurTest.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasStateTest.cpp
diff --git a/tests/CanvasStateTest.cpp b/tests/CanvasStateTest.cpp
index f1c35929d60875186018003a2e57fe8d78cb60a4..7c441a40feb4c761e3145e9dca7f3a2a39f61e9f 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]);
« no previous file with comments | « tests/BlurTest.cpp ('k') | tests/CanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698