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

Unified Diff: tests/ImageFilterTest.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/ImageDecodingTest.cpp ('k') | tests/MipMapTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ImageFilterTest.cpp
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 317a877d607abb750c8ac30103e8bfb7d0da3c22..59504cf702882168605b38bd667282fc361afab1 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -70,10 +70,8 @@ private:
}
static void make_small_bitmap(SkBitmap& bitmap) {
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, kBitmapSize, kBitmapSize);
- bitmap.allocPixels();
- SkBitmapDevice device(bitmap);
- SkCanvas canvas(&device);
+ bitmap.allocN32Pixels(kBitmapSize, kBitmapSize);
+ SkCanvas canvas(bitmap);
canvas.clear(0x00000000);
SkPaint darkPaint;
darkPaint.setColor(0xFF804020);
@@ -159,8 +157,7 @@ DEF_TEST(ImageFilter, reporter) {
// Tests pass by not asserting
SkBitmap bitmap, result;
make_small_bitmap(bitmap);
- result.setConfig(SkBitmap::kARGB_8888_Config, kBitmapSize, kBitmapSize);
- result.allocPixels();
+ result.allocN32Pixels(kBitmapSize, kBitmapSize);
{
// This tests for :
@@ -204,8 +201,7 @@ static void test_crop_rects(SkBaseDevice* device, skiatest::Reporter* reporter)
// unaffected by the input crop rect.
// Tests pass by not asserting.
SkBitmap bitmap;
- bitmap.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
- bitmap.allocPixels();
+ bitmap.allocN32Pixels(100, 100);
bitmap.eraseARGB(0, 0, 0, 0);
SkDeviceImageFilterProxy proxy(device);
@@ -260,16 +256,14 @@ static void test_crop_rects(SkBaseDevice* device, skiatest::Reporter* reporter)
DEF_TEST(ImageFilterCropRect, reporter) {
SkBitmap temp;
- temp.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
- temp.allocPixels();
+ temp.allocN32Pixels(100, 100);
SkBitmapDevice device(temp);
test_crop_rects(&device, reporter);
}
DEF_TEST(ImageFilterMatrixTest, reporter) {
SkBitmap temp;
- temp.setConfig(SkBitmap::kARGB_8888_Config, 100, 100);
- temp.allocPixels();
+ temp.allocN32Pixels(100, 100);
SkBitmapDevice device(temp);
SkCanvas canvas(&device);
canvas.scale(SkIntToScalar(2), SkIntToScalar(2));
« no previous file with comments | « tests/ImageDecodingTest.cpp ('k') | tests/MipMapTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698