Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Unified Diff: include/core/SkImageFilter.h

Issue 452923002: Remove external SkImageFilter cache, and rename UniqueIDCache -> Cache. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkDevice.h ('k') | include/gpu/SkGpuDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkImageFilter.h
diff --git a/include/core/SkImageFilter.h b/include/core/SkImageFilter.h
index d2a4d3e3d93073a6c9ccc2b17c11d5f329576058..d4930c4975935801a26b2e03fd59da3cdb3b62f8 100644
--- a/include/core/SkImageFilter.h
+++ b/include/core/SkImageFilter.h
@@ -49,42 +49,30 @@ public:
uint32_t fFlags;
};
- class SK_API Cache : public SkRefCnt {
- public:
- // By default, we cache only image filters with 2 or more children.
- // Values less than 2 mean always cache; values greater than 2 are not supported.
- static Cache* Create(int minChildren = 2);
- virtual ~Cache() {}
- virtual bool get(const SkImageFilter* key, SkBitmap* result, SkIPoint* offset) = 0;
- virtual void set(const SkImageFilter* key,
- const SkBitmap& result, const SkIPoint& offset) = 0;
- virtual void remove(const SkImageFilter* key) = 0;
- };
-
// This cache maps from (filter's unique ID + CTM + clipBounds + src bitmap generation ID) to
// (result, offset).
- class UniqueIDCache : public SkRefCnt {
+ class Cache : public SkRefCnt {
public:
struct Key;
- virtual ~UniqueIDCache() {}
- static UniqueIDCache* Create(size_t maxBytes);
- static UniqueIDCache* Get();
+ virtual ~Cache() {}
+ static Cache* Create(size_t maxBytes);
+ static Cache* Get();
virtual bool get(const Key& key, SkBitmap* result, SkIPoint* offset) const = 0;
virtual void set(const Key& key, const SkBitmap& result, const SkIPoint& offset) = 0;
};
class Context {
public:
- Context(const SkMatrix& ctm, const SkIRect& clipBounds, UniqueIDCache* cache) :
+ Context(const SkMatrix& ctm, const SkIRect& clipBounds, Cache* cache) :
fCTM(ctm), fClipBounds(clipBounds), fCache(cache) {
}
const SkMatrix& ctm() const { return fCTM; }
const SkIRect& clipBounds() const { return fClipBounds; }
- UniqueIDCache* cache() const { return fCache; }
+ Cache* cache() const { return fCache; }
private:
SkMatrix fCTM;
SkIRect fClipBounds;
- UniqueIDCache* fCache;
+ Cache* fCache;
};
class Proxy {
« no previous file with comments | « include/core/SkDevice.h ('k') | include/gpu/SkGpuDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698