Index: include/effects/SkLayerDrawLooper.h |
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h |
index edffee648660d6d89aa1224d0cfb87c44c445751..70781596ade46de5cbed7c40034a1d5a74ab7645 100644 |
--- a/include/effects/SkLayerDrawLooper.h |
+++ b/include/effects/SkLayerDrawLooper.h |
@@ -141,7 +141,45 @@ private: |
MyRegistrar(); |
}; |
+ friend class SkLayerDrawLooperBuilder; |
typedef SkDrawLooper INHERITED; |
}; |
+class SK_API SkLayerDrawLooperBuilder { |
+public: |
+ SkLayerDrawLooperBuilder(); |
+ ~SkLayerDrawLooperBuilder(); |
+ |
+ /** |
+ * Call for each layer you want to add (from top to bottom). |
+ * This returns a paint you can modify, but that ptr is only valid until |
+ * the next call made to addLayer(). |
+ */ |
+ SkPaint* addLayer(const SkLayerDrawLooper::LayerInfo&); |
+ |
+ /** |
+ * This layer will draw with the original paint, at the specified offset |
+ */ |
+ void addLayer(SkScalar dx, SkScalar dy); |
+ |
+ /** |
+ * This layer will with the original paint and no offset. |
+ */ |
+ void addLayer() { this->addLayer(0, 0); } |
+ |
+ /// Similar to addLayer, but adds a layer to the top. |
+ SkPaint* addLayerOnTop(const SkLayerDrawLooper::LayerInfo&); |
+ |
+ /** |
+ * Pass list of layers onto newly built looper and return it. This will |
+ * also reset the builder, so it can be used to build another looper. |
+ */ |
+ SkDrawLooper* createLooper(); |
reed1
2014/02/07 18:32:22
possibly call this detachLooper(), as in other pla
Dominik Grewe
2014/02/07 18:57:02
Done.
|
+ |
+private: |
+ SkLayerDrawLooper::Rec* fRecs; |
+ SkLayerDrawLooper::Rec* fTopRec; |
+ int fCount; |
+}; |
+ |
#endif |