diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-07 14:18:59 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-04-07 14:18:59 +0000 |
commit | 4e2b3d3fb1288c6dc0f3ea1c0aa4a0d7c603bd7b (patch) | |
tree | e2f3bfd538b7ded23f94ca2c8af3ea90de52182b /include/effects/SkLayerDrawLooper.h | |
parent | 591b6dadb09b0c143b903d4bae6a888527d36612 (diff) |
Simplify drawloopers and drawfilters. This allows the canvas to keep its
promise that const SkPaint& stay const (so we don't have bugs if a const paint
is referenced from two threads in pictures)
git-svn-id: http://skia.googlecode.com/svn/trunk@1074 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/effects/SkLayerDrawLooper.h')
-rw-r--r-- | include/effects/SkLayerDrawLooper.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h index 670ac23d87..d35d70d7dd 100644 --- a/include/effects/SkLayerDrawLooper.h +++ b/include/effects/SkLayerDrawLooper.h @@ -23,9 +23,8 @@ public: } // overrides from SkDrawLooper - virtual void init(SkCanvas*, SkPaint*); - virtual bool next(); - virtual void restore(); + virtual void init(SkCanvas*); + virtual bool next(SkCanvas*, SkPaint* paint); // must be public for Registrar :( static SkFlattenable* CreateProc(SkFlattenableReadBuffer& buffer) { @@ -49,14 +48,9 @@ private: }; Rec* fRecs; int fCount; - - struct Iter { - SkPaint fSavedPaint; - SkPaint* fPaint; - SkCanvas* fCanvas; - Rec* fRec; - }; - Iter fIter; + + // state-machine during the init/next cycle + Rec* fCurrRec; class MyRegistrar : public SkFlattenable::Registrar { public: |