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
diff --git a/include/effects/SkLayerDrawLooper.h b/include/effects/SkLayerDrawLooper.h
index 670ac23..d35d70d 100644
--- a/include/effects/SkLayerDrawLooper.h
+++ b/include/effects/SkLayerDrawLooper.h
@@ -23,9 +23,8 @@
     }
     
     // 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 @@
     };
     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: