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

Unified Diff: tests/DrawPathTest.cpp

Issue 183533004: add SkCanvas::NewRaster factory -- a very common use-case in chrome (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/CanvasTest.cpp ('k') | no next file » | 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 f7f7367983a8c7f57ed4beb2e47743c48ff2a265..fafef02a5231f0531124c22c39c58998865a0c30 100644
--- a/tests/DrawPathTest.cpp
+++ b/tests/DrawPathTest.cpp
@@ -11,14 +11,6 @@
#include "SkSurface.h"
#include "Test.h"
-static SkCanvas* new_canvas(int w, int h) {
- SkBitmap bm;
- bm.allocN32Pixels(w, h);
- return new SkCanvas(bm);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
// 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;
@@ -103,7 +95,7 @@ static void test_crbug131181() {
moveToH(&path, &data[0]);
cubicToH(&path, &data[2]);
- SkAutoTUnref<SkCanvas> canvas(new_canvas(640, 480));
+ SkAutoTUnref<SkCanvas> canvas(SkCanvas::NewRasterN32(640, 480));
SkPaint paint;
paint.setAntiAlias(true);
@@ -141,7 +133,7 @@ static void test_inversepathwithclip() {
SkPaint paint;
- SkAutoTUnref<SkCanvas> canvas(new_canvas(640, 480));
+ SkAutoTUnref<SkCanvas> canvas(SkCanvas::NewRasterN32(640, 480));
canvas.get()->save();
canvas.get()->clipRect(SkRect::MakeWH(SkIntToScalar(19), SkIntToScalar(11)));
@@ -181,7 +173,7 @@ static void test_bug533() {
SkPaint paint;
paint.setAntiAlias(true);
- SkAutoTUnref<SkCanvas> canvas(new_canvas(640, 480));
+ SkAutoTUnref<SkCanvas> canvas(SkCanvas::NewRasterN32(640, 480));
canvas.get()->drawPath(path, paint);
}
@@ -223,7 +215,7 @@ static void test_bigcubic() {
SkPaint paint;
paint.setAntiAlias(true);
- SkAutoTUnref<SkCanvas> canvas(new_canvas(640, 480));
+ SkAutoTUnref<SkCanvas> canvas(SkCanvas::NewRasterN32(640, 480));
canvas.get()->drawPath(path, paint);
}
@@ -233,8 +225,7 @@ static void test_bigcubic() {
static void test_giantaa() {
const int W = 400;
const int H = 400;
- SkAutoTUnref<SkCanvas> canvas(new_canvas(33000, 10));
- canvas.get()->clear(SK_ColorTRANSPARENT);
+ SkAutoTUnref<SkCanvas> canvas(SkCanvas::NewRasterN32(33000, 10));
SkPaint paint;
paint.setAntiAlias(true);
« no previous file with comments | « tests/CanvasTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698