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

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
Index: tests/DrawPathTest.cpp
diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp
index 2cf1bc5c412c875f55a7b8e2a42c33c67518e3e7..ead3f5e860b8c06a8f6bced07e9d732f30dc6ac7 100644
--- a/tests/DrawPathTest.cpp
+++ b/tests/DrawPathTest.cpp
@@ -11,20 +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* create(int w, int h, int rb, void* addr = NULL) {
scroggo 2014/02/13 20:26:03 It looks like create can be merged into new_canvas
reed1 2014/02/13 20:48:37 Done.
+ const SkImageInfo info = SkImageInfo::MakeN32Premul(w, h);
+
SkBitmap bm;
- bm.setConfig(config, w, h, rb);
if (addr) {
- bm.setPixels(addr);
+ bm.installPixels(info, addr, rb, NULL, NULL);
} else {
- bm.allocPixels();
+ bm.allocPixels(info);
}
return new SkCanvas(bm);
}
static SkCanvas* new_canvas(int w, int h) {
- return create(SkBitmap::kARGB_8888_Config, w, h, 0, NULL);
+ return create(w, h, 0, NULL);
}
///////////////////////////////////////////////////////////////////////////////
@@ -33,8 +33,8 @@ static SkCanvas* new_canvas(int w, int h) {
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 +125,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;

Powered by Google App Engine
This is Rietveld 408576698