Index: include/effects/SkLayerDrawLooper.h |
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h |
index 241b3b2494139b909bbb6a3ce196b1ff383fd09a..7a13b7a7b90bd44cfd96a5f006a696d0f2029803 100644 |
--- a/include/effects/SkLayerDrawLooper.h |
+++ b/include/effects/SkLayerDrawLooper.h |
@@ -94,9 +94,9 @@ public: |
/// Similar to addLayer, but adds a layer to the top. |
SkPaint* addLayerOnTop(const LayerInfo&); |
- // overrides from SkDrawLooper |
- virtual void init(SkCanvas*); |
- virtual bool next(SkCanvas*, SkPaint* paint); |
+ virtual SkDrawLooper::Context* createContext(SkCanvas*, void* storage) const SK_OVERRIDE; |
+ |
+ virtual size_t contextSize() const SK_OVERRIDE { return sizeof(LayerDrawLooperContext); } |
SK_DEVELOPER_TO_STRING() |
@@ -118,9 +118,18 @@ private: |
int fCount; |
// state-machine during the init/next cycle |
- Rec* fCurrRec; |
+ class LayerDrawLooperContext : public SkDrawLooper::Context { |
+ public: |
+ explicit LayerDrawLooperContext(const SkLayerDrawLooper* looper); |
+ |
+ protected: |
+ virtual bool next(SkCanvas*, SkPaint* paint) SK_OVERRIDE; |
- static void ApplyInfo(SkPaint* dst, const SkPaint& src, const LayerInfo&); |
+ private: |
+ Rec* fCurrRec; |
+ |
+ static void ApplyInfo(SkPaint* dst, const SkPaint& src, const LayerInfo&); |
+ }; |
class MyRegistrar : public SkFlattenable::Registrar { |
public: |