| Index: src/core/SkCanvas.cpp
|
| diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
|
| index 08b09e8e2b6e970b06d93c0449b9af8859573173..a6a4bd5ac494fa60fd2d9c4ecbc0478ad68bbed7 100644
|
| --- a/src/core/SkCanvas.cpp
|
| +++ b/src/core/SkCanvas.cpp
|
| @@ -29,6 +29,8 @@
|
| #include "GrRenderTarget.h"
|
| #endif
|
|
|
| +#define kDrawLooperContextStorageLongCount (sizeof(void*) + sizeof(int))
|
| +
|
| // experimental for faster tiled drawing...
|
| //#define SK_ENABLE_CLIP_QUICKREJECT
|
|
|
| @@ -356,7 +358,8 @@ public:
|
| }
|
|
|
| if (fLooper) {
|
| - fLooper->init(canvas);
|
| + fLooperContext = fLooper->init(canvas, fLooperContextStorage,
|
| + sizeof(fLooperContextStorage));
|
| fIsSimple = false;
|
| } else {
|
| // can we be marked as simple?
|
| @@ -369,6 +372,10 @@ public:
|
| fCanvas->internalRestore();
|
| }
|
| SkASSERT(fCanvas->getSaveCount() == fSaveCount);
|
| + if (fLooper) {
|
| + SkASSERT(fLooperContext);
|
| + fLooperContext->cleanup(fLooperContextStorage);
|
| + }
|
| }
|
|
|
| const SkPaint& paint() const {
|
| @@ -399,6 +406,8 @@ private:
|
| bool fDoClearImageFilter;
|
| bool fDone;
|
| bool fIsSimple;
|
| + SkDrawLooper::DrawContext* fLooperContext;
|
| + uint32_t fLooperContextStorage[kDrawLooperContextStorageLongCount];
|
|
|
| bool doNext(SkDrawFilter::Type drawType);
|
| };
|
| @@ -407,6 +416,7 @@ bool AutoDrawLooper::doNext(SkDrawFilter::Type drawType) {
|
| fPaint = NULL;
|
| SkASSERT(!fIsSimple);
|
| SkASSERT(fLooper || fFilter || fDoClearImageFilter);
|
| + SkASSERT(!fLooper || fLooperContext);
|
|
|
| SkPaint* paint = fLazyPaint.set(fOrigPaint);
|
|
|
| @@ -414,7 +424,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;
|
| }
|
|
|