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

Unified Diff: tests/PipeTest.cpp

Issue 162643002: replace setConfig+allocPixels with single call (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/PictureTest.cpp ('k') | tests/PremulAlphaRoundTripTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PipeTest.cpp
diff --git a/tests/PipeTest.cpp b/tests/PipeTest.cpp
index 6ab4d8eb4b827d7804f034674f4876e799364b87..fd98fca7ef8afe3251b45392cf7a83ac268a153c 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.setConfig(SkBitmap::kNo_Config, 5, 5);
+ badBitmap.setConfig(SkImageInfo::Make(5, 5, kUnknown_SkColorType,
+ kPremul_SkAlphaType));
pipeCanvas->drawBitmap(badBitmap, 0, 0);
}
@@ -29,8 +30,7 @@ static void testDrawingAfterEndRecording(SkCanvas* canvas) {
writer.endRecording();
SkBitmap bm;
- bm.setConfig(SkBitmap::kARGB_8888_Config, 2, 2);
- bm.allocPixels();
+ bm.allocN32Pixels(2, 2);
bm.eraseColor(SK_ColorTRANSPARENT);
SkShader* shader = SkShader::CreateBitmapShader(bm, SkShader::kClamp_TileMode,
@@ -44,7 +44,7 @@ static void testDrawingAfterEndRecording(SkCanvas* canvas) {
DEF_TEST(Pipe, reporter) {
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, 64, 64);
+ bitmap.setConfig(SkImageInfo::MakeN32Premul(64, 64));
SkCanvas canvas(bitmap);
PipeController pipeController(&canvas);
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/PremulAlphaRoundTripTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698