SkLiteDL: remove freelisting, add reset() and SKLITEDL_PAGE knob.
We think Android can cache these better than a global freelist allows.
This removes the freelisting but adds reset() to allow reuse.
I took the opportunity to abstract 4096 as a define SKLITEDL_PAGE.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248693004
Review-Url: https://codereview.chromium.org/2248693004
diff --git a/src/core/SkLiteDL.h b/src/core/SkLiteDL.h
index aa4dea4..ac1eb9f 100644
--- a/src/core/SkLiteDL.h
+++ b/src/core/SkLiteDL.h
@@ -20,8 +20,7 @@
class SkLiteDL final : public SkDrawable {
public:
static sk_sp<SkLiteDL> New(SkRect);
-
- static void PurgeFreelist();
+ void reset(SkRect);
void optimizeFor(GrContext*);
void makeThreadsafe();
@@ -81,11 +80,9 @@
SkXfermode::Mode, const SkRect*, const SkPaint*);
private:
- SkLiteDL();
+ SkLiteDL(SkRect);
~SkLiteDL();
- void internal_dispose() const override;
-
SkRect onGetBounds() override;
void onDraw(SkCanvas*) override;
@@ -99,10 +96,6 @@
size_t fUsed;
size_t fReserved;
SkRect fBounds;
-
- // Only used for freelisting.
- SkLiteDL* fNext;
- int fUsesRemaining;
};
#endif//SkLiteDL_DEFINED