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

Unified Diff: gm/gmmain.cpp

Issue 16040002: Changing SkDeferredCanvas to use factories for creation (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 7 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 | « bench/benchmain.cpp ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
===================================================================
--- gm/gmmain.cpp (revision 9282)
+++ gm/gmmain.cpp (working copy)
@@ -490,11 +490,15 @@
SkAutoTUnref<SkCanvas> canvas;
if (gRec.fBackend == kRaster_Backend) {
- SkAutoTUnref<SkDevice> device(new SkDevice(*bitmap));
+ SkAutoTUnref<SkDevice> device(SkNEW_ARGS(SkDevice, (*bitmap)));
if (deferred) {
- canvas.reset(new SkDeferredCanvas(device));
+#if SK_DEFERRED_CANVAS_USES_FACTORIES
+ canvas.reset(SkDeferredCanvas::Create(device));
+#else
+ canvas.reset(SkNEW_ARGS(SkDeferredCanvas, (device)));
+#endif
} else {
- canvas.reset(new SkCanvas(device));
+ canvas.reset(SkNEW_ARGS(SkCanvas, (device)));
}
invokeGM(gm, canvas, false, deferred);
canvas->flush();
@@ -503,9 +507,13 @@
else { // GPU
SkAutoTUnref<SkDevice> device(SkGpuDevice::Create(gpuTarget));
if (deferred) {
- canvas.reset(new SkDeferredCanvas(device));
+#if SK_DEFERRED_CANVAS_USES_FACTORIES
+ canvas.reset(SkDeferredCanvas::Create(device));
+#else
+ canvas.reset(SkNEW_ARGS(SkDeferredCanvas, (device)));
+#endif
} else {
- canvas.reset(new SkCanvas(device));
+ canvas.reset(SkNEW_ARGS(SkCanvas, (device)));
}
invokeGM(gm, canvas, false, deferred);
// the device is as large as the current rendertarget, so
« no previous file with comments | « bench/benchmain.cpp ('k') | include/utils/SkDeferredCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698