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

Unified Diff: bench/DeferredSurfaceCopyBench.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/DeferredCanvasBench.cpp ('k') | bench/benchmain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/DeferredSurfaceCopyBench.cpp
===================================================================
--- bench/DeferredSurfaceCopyBench.cpp (revision 9282)
+++ bench/DeferredSurfaceCopyBench.cpp (working copy)
@@ -53,21 +53,26 @@
{
surface = SkSurface::NewRaster(info);
}
- SkDeferredCanvas drawingCanvas(surface);
+ SkAutoTUnref<SkDeferredCanvas> drawingCanvas(
+#if SK_DEFERRED_CANVAS_USES_FACTORIES
+ SkDeferredCanvas::Create(surface));
+#else
+ SkNEW_ARGS(SkDeferredCanvas, (surface)));
+#endif
surface->unref();
for (int iteration = 0; iteration < N; iteration++) {
- drawingCanvas.clear(0);
- SkAutoTUnref<SkImage> image(drawingCanvas.newImageSnapshot());
+ drawingCanvas->clear(0);
+ SkAutoTUnref<SkImage> image(drawingCanvas->newImageSnapshot());
SkPaint paint;
if (!fDiscardableContents) {
// If paint is not opaque, prior canvas contents are
// not discardable because they are needed for compositing.
paint.setAlpha(127);
}
- drawingCanvas.drawRect(fullCanvasRect, paint);
+ drawingCanvas->drawRect(fullCanvasRect, paint);
// Trigger copy on write, which should be faster in the discardable case.
- drawingCanvas.flush();
+ drawingCanvas->flush();
}
}
« no previous file with comments | « bench/DeferredCanvasBench.cpp ('k') | bench/benchmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698