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

Unified Diff: tests/DrawPathTest.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/DrawBitmapRectTest.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/DrawPathTest.cpp
diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp
index 2cf1bc5c412c875f55a7b8e2a42c33c67518e3e7..e7f70057b9a8be01aa2b48afdd5bc0e615996d16 100644
--- a/tests/DrawPathTest.cpp
+++ b/tests/DrawPathTest.cpp
@@ -11,30 +11,20 @@
#include "SkSurface.h"
#include "Test.h"
-static SkCanvas* create(SkBitmap::Config config, int w, int h, int rb,
- void* addr = NULL) {
+static SkCanvas* new_canvas(int w, int h) {
SkBitmap bm;
- bm.setConfig(config, w, h, rb);
- if (addr) {
- bm.setPixels(addr);
- } else {
- bm.allocPixels();
- }
+ bm.allocN32Pixels(w, h);
return new SkCanvas(bm);
}
-static SkCanvas* new_canvas(int w, int h) {
- return create(SkBitmap::kARGB_8888_Config, w, h, 0, NULL);
-}
-
///////////////////////////////////////////////////////////////////////////////
// test that we can draw an aa-rect at coordinates > 32K (bigger than fixedpoint)
static void test_big_aa_rect(skiatest::Reporter* reporter) {
SkBitmap output;
SkPMColor pixel[1];
- output.setConfig(SkBitmap::kARGB_8888_Config, 1, 1, 4);
- output.setPixels(pixel);
+ output.installPixels(SkImageInfo::MakeN32Premul(1, 1),
+ pixel, 4, NULL, NULL);
SkSurface* surf = SkSurface::NewRasterPMColor(300, 33300);
SkCanvas* canvas = surf->getCanvas();
@@ -125,8 +115,7 @@ static void test_crbug131181() {
// stepper for the quadratic. Now we bias that value by 1/2 so we don't overflow
static void test_crbug_140803() {
SkBitmap bm;
- bm.setConfig(SkBitmap::kARGB_8888_Config, 2700, 30*1024);
- bm.allocPixels();
+ bm.allocN32Pixels(2700, 30*1024);
SkCanvas canvas(bm);
SkPath path;
« no previous file with comments | « tests/DrawBitmapRectTest.cpp ('k') | tests/ReadPixelsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698