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

Unified Diff: tests/CanvasTest.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 | « src/utils/SkDeferredCanvas.cpp ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/CanvasTest.cpp
===================================================================
--- tests/CanvasTest.cpp (revision 9282)
+++ tests/CanvasTest.cpp (working copy)
@@ -777,24 +777,29 @@
SkBitmap deferredStore;
createBitmap(&deferredStore, SkBitmap::kARGB_8888_Config, 0xFFFFFFFF);
SkDevice deferredDevice(deferredStore);
- SkDeferredCanvas deferredCanvas(&deferredDevice);
+ SkAutoTUnref<SkDeferredCanvas> deferredCanvas(
+#if SK_DEFERRED_CANVAS_USES_FACTORIES
+ SkDeferredCanvas::Create(&deferredDevice));
+#else
+ SkNEW_ARGS(SkDeferredCanvas, (&deferredDevice)));
+#endif
testStep->setAssertMessageFormat(kDeferredDrawAssertMessageFormat);
- testStep->draw(&deferredCanvas, reporter);
+ testStep->draw(deferredCanvas, reporter);
testStep->setAssertMessageFormat(kDeferredPreFlushAssertMessageFormat);
- AssertCanvasStatesEqual(reporter, &deferredCanvas, &referenceCanvas,
+ AssertCanvasStatesEqual(reporter, deferredCanvas, &referenceCanvas,
testStep);
if (silent) {
- deferredCanvas.silentFlush();
+ deferredCanvas->silentFlush();
} else {
- deferredCanvas.flush();
+ deferredCanvas->flush();
}
testStep->setAssertMessageFormat(
silent ? kDeferredPostSilentFlushPlaybackAssertMessageFormat :
kDeferredPostFlushPlaybackAssertMessageFormat);
AssertCanvasStatesEqual(reporter,
- deferredCanvas.immediateCanvas(),
+ deferredCanvas->immediateCanvas(),
&referenceCanvas, testStep);
// Verified that deferred canvas state is not affected by flushing
« no previous file with comments | « src/utils/SkDeferredCanvas.cpp ('k') | tests/DeferredCanvasTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698