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

Unified Diff: tests/DrawBitmapRectTest.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/DeviceLooperTest.cpp ('k') | tests/DrawPathTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/DrawBitmapRectTest.cpp
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index a1681461cb69bbf78b093d6e241b952d57c6b123..f51bf53cc8d1bf2623a8a0ff2c91126ffb349049 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);
« no previous file with comments | « tests/DeviceLooperTest.cpp ('k') | tests/DrawPathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698