Index: include/utils/SkDeferredCanvas.h |
=================================================================== |
--- include/utils/SkDeferredCanvas.h (revision 9282) |
+++ include/utils/SkDeferredCanvas.h (working copy) |
@@ -15,6 +15,11 @@ |
class SkImage; |
class SkSurface; |
+#if !defined(SK_DEFERRED_CANVAS_USES_FACTORIES) |
+// This is temporary, for rolling the API change into Chromium/Blink |
+#define SK_DEFERRED_CANVAS_USES_FACTORIES 0 |
+#endif |
+ |
/** \class SkDeferredCanvas |
Subclass of SkCanvas that encapsulates an SkPicture or SkGPipe for deferred |
drawing. The main difference between this class and SkPictureRecord (the |
@@ -27,23 +32,40 @@ |
public: |
class NotificationClient; |
+#if SK_DEFERRED_CANVAS_USES_FACTORIES |
reed1
2013/05/28 12:55:18
Why do we need to ever hide the new methods?
|
+ /** Construct a canvas with the specified device to draw into. |
+ @param device Specifies a device for the canvas to draw into. |
+ */ |
+ static SkDeferredCanvas* create(SkDevice* device); |
reed1
2013/05/28 12:55:18
Static methods are Capitalized.
reed1
2013/05/28 12:55:18
Do we really need to expose a version that takes a
Justin Novosad
2013/05/28 14:05:30
It would require a whole lot of work in our test p
|
+ |
+ /** Construct a canvas with the specified surface to draw into. |
+ This factory must be used for newImageSnapshot to work. |
+ @param surface Specifies a surface for the canvas to draw into. |
+ */ |
+ static SkDeferredCanvas* create(SkSurface* surface); |
+#else |
+ /** DEPRECATED |
+ */ |
SkDeferredCanvas(); |
- /** Construct a canvas with the specified device to draw into. |
+ /** DEPRACATED, use create instead |
+ Construct a canvas with the specified device to draw into. |
Equivalent to calling default constructor, then setDevice. |
@param device Specifies a device for the canvas to draw into. |
*/ |
explicit SkDeferredCanvas(SkDevice* device); |
- /** Construct a canvas with the specified surface to draw into. |
+ /** DEPRECATED, use create instead |
+ Construct a canvas with the specified surface to draw into. |
This constructor must be used for newImageSnapshot to work. |
@param surface Specifies a surface for the canvas to draw into. |
*/ |
explicit SkDeferredCanvas(SkSurface* surface); |
+#endif |
virtual ~SkDeferredCanvas(); |
- /** |
+ /** DEPRECATED |
* Specify a device to be used by this canvas. Calling setDevice will |
* release the previously set device, if any. Takes a reference on the |
* device. |
@@ -254,6 +276,10 @@ |
DeferredDevice* getDeferredDevice() const; |
private: |
+#if SK_DEFERRED_CANVAS_USES_FACTORIES |
+ SkDeferredCanvas(DeferredDevice*); |
+#endif |
+ |
void recordedDrawCommand(); |
SkCanvas* drawingCanvas() const; |
SkCanvas* immediateCanvas() const; |