Adding setSurface public API method to SkDeferredCanvas
The purpose of this change is to provide an API that Blink 2D canvas layers can use
to install a new render target when recovering from a lost graphics context.
Review URL: https://codereview.chromium.org/15896005
git-svn-id: http://skia.googlecode.com/svn/trunk@9276 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/utils/SkDeferredCanvas.h b/include/utils/SkDeferredCanvas.h
index 60f709c..bef26c0 100644
--- a/include/utils/SkDeferredCanvas.h
+++ b/include/utils/SkDeferredCanvas.h
@@ -54,6 +54,16 @@
virtual SkDevice* setDevice(SkDevice* device);
/**
+ * Specify the surface to be used by this canvas. Calling setSurface will
+ * release the previously set surface or device. Takes a reference on the
+ * surface.
+ *
+ * @param surface The surface that the canvas will raw into
+ * @return The surface argument, for convenience.
+ */
+ SkSurface* setSurface(SkSurface* surface);
+
+ /**
* Specify a NotificationClient to be used by this canvas. Calling
* setNotificationClient will release the previously set
* NotificationClient, if any. SkDeferredCanvas does not take ownership