Remove use of SkSmallAllocator from all Loopers.
R=reed@google.com
Change-Id: I22b140ee8e12900de13bc623adb30b5fca3051f9
Reviewed-on: https://skia-review.googlesource.com/7658
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 64ef348..6c6752e 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -5,6 +5,7 @@
* found in the LICENSE file.
*/
+#include "SkArenaAlloc.h"
#include "SkBitmapDevice.h"
#include "SkCanvas.h"
#include "SkCanvasPriv.h"
@@ -33,7 +34,6 @@
#include "SkRRect.h"
#include "SkShadowPaintFilterCanvas.h"
#include "SkShadowShader.h"
-#include "SkSmallAllocator.h"
#include "SkSpecialImage.h"
#include "SkSurface_Base.h"
#include "SkTextBlob.h"
@@ -509,11 +509,7 @@
}
if (SkDrawLooper* looper = paint.getLooper()) {
- fLooperContext = fLooperContextAllocator.createWithIniter(
- looper->contextSize(),
- [&](void* buffer) {
- return looper->createContext(canvas, buffer);
- });
+ fLooperContext = looper->makeContext(canvas, &fAlloc);
fIsSimple = false;
} else {
fLooperContext = nullptr;
@@ -546,7 +542,7 @@
}
private:
- SkLazyPaint fLazyPaintInit; // base paint storage in case we need to modify it
+ SkLazyPaint fLazyPaintInit; // base paint storage in case we need to modify it
SkLazyPaint fLazyPaintPerLooper; // per-draw-looper storage, so the looper can modify it
SkCanvas* fCanvas;
const SkPaint& fOrigPaint;
@@ -557,7 +553,8 @@
bool fDone;
bool fIsSimple;
SkDrawLooper::Context* fLooperContext;
- SkSmallAllocator<1, 32> fLooperContextAllocator;
+ char fStorage[48];
+ SkArenaAlloc fAlloc {fStorage};
bool doNext(SkDrawFilter::Type drawType);
};