Index: include/effects/SkLayerRasterizer.h |
diff --git a/include/effects/SkLayerRasterizer.h b/include/effects/SkLayerRasterizer.h |
index fdfb179cb6bab604188c2f20b12f74697e29b757..fc21a7cd18884d72efcf3bbe95b5245dc408fa21 100644 |
--- a/include/effects/SkLayerRasterizer.h |
+++ b/include/effects/SkLayerRasterizer.h |
@@ -39,10 +39,26 @@ public: |
/** |
* Pass queue of layers on to newly created layer rasterizer and return it. The builder |
- * cannot be used any more after calling this function. |
+ * *cannot* be used any more after calling this function. |
+ * |
+ * The caller is responsible for calling unref() on the returned object. |
*/ |
SkLayerRasterizer* detachRasterizer(); |
+ /** |
+ * Create and return a new immutable SkLayerRasterizer that contains a shapshot of the |
+ * layers that were added to the Builder, without modifying the Builder. The Builder |
+ * *may* be used after calling this function. It will continue to hold any layers |
+ * previously added, so consecutive calls to this function will return identical objects, |
+ * and objects returned by future calls to this function contain all the layers in |
+ * previously returned objects. |
+ * |
+ * Future calls to addLayer will not affect rasterizers previously returned by this call. |
+ * |
+ * The caller is responsible for calling unref() on the returned object. |
+ */ |
+ SkLayerRasterizer* snapshotRasterizer() const; |
reed1
2014/04/10 20:16:42
can this guy be const? Does it have to be? I'd be
scroggo
2014/04/10 20:21:37
As stated in person, it can, but does not have to
|
+ |
private: |
SkDeque* fLayers; |
}; |
@@ -86,6 +102,8 @@ private: |
static SkDeque* ReadLayers(SkReadBuffer& buffer); |
+ friend class LayerRasterizerTester; |
+ |
typedef SkRasterizer INHERITED; |
}; |