Index: src/core/SkCanvas.cpp |
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp |
index 9dcbfdbc38891c65deb30feb8bf047dfc42022c4..dd3cdb17a41ce5880fa2feeb402e827a212e8238 100644 |
--- a/src/core/SkCanvas.cpp |
+++ b/src/core/SkCanvas.cpp |
@@ -355,7 +355,7 @@ public: |
} |
if (fLooper) { |
- fLooper->init(canvas); |
+ fLooperContext = fLooper->init(canvas, &fLooperContextAllocator); |
fIsSimple = false; |
} else { |
// can we be marked as simple? |
@@ -398,6 +398,8 @@ private: |
bool fDoClearImageFilter; |
bool fDone; |
bool fIsSimple; |
+ SkDrawLooper::Context* fLooperContext; |
+ SkDrawLooper::ContextAllocator fLooperContextAllocator; |
bool doNext(SkDrawFilter::Type drawType); |
}; |
@@ -406,6 +408,7 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) { |
fPaint = NULL; |
SkASSERT(!fIsSimple); |
SkASSERT(fLooper || fFilter || fDoClearImageFilter); |
+ SkASSERT(!fLooper || fLooperContext); |
SkPaint* paint = fLazyPaint.set(fOrigPaint); |
@@ -413,7 +416,7 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) { |
paint->setImageFilter(NULL); |
} |
- if (fLooper && !fLooper->next(fCanvas, paint)) { |
+ if (fLooper && !fLooperContext->next(fCanvas, paint)) { |
fDone = true; |
return false; |
} |