ef284a84f5
missing unrefs in megalooper GM missing reset capability in oval renderer This CL also expands the instance counting system to some recently adding classes (e.g., SkFontStyleSet) R=bsalomon@google.com, jvanverth@google.com Author: robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/18461007 git-svn-id: http://skia.googlecode.com/svn/trunk@10030 2bbb7eff-a529-9590-31e7-b0007b416f81
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
/*
|
|
* Copyright 2013 Google Inc.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
* found in the LICENSE file.
|
|
*/
|
|
|
|
#ifndef SkPurgeableImageCache_DEFINED
|
|
#define SkPurgeableImageCache_DEFINED
|
|
|
|
#include "SkImageCache.h"
|
|
|
|
#ifdef SK_DEBUG
|
|
#include "SkTDArray.h"
|
|
#endif
|
|
|
|
/**
|
|
* Implementation for SkImageCache that uses system defined purgeable memory.
|
|
*/
|
|
class SkPurgeableImageCache : public SkImageCache {
|
|
|
|
public:
|
|
SK_DECLARE_INST_COUNT(SkPurgeableImageCache)
|
|
|
|
static SkImageCache* Create();
|
|
|
|
virtual void* allocAndPinCache(size_t bytes, ID*) SK_OVERRIDE;
|
|
virtual void* pinCache(ID, SkImageCache::DataStatus*) SK_OVERRIDE;
|
|
virtual void releaseCache(ID) SK_OVERRIDE;
|
|
virtual void throwAwayCache(ID) SK_OVERRIDE;
|
|
|
|
#ifdef SK_DEBUG
|
|
virtual MemoryStatus getMemoryStatus(ID) const SK_OVERRIDE;
|
|
virtual void purgeAllUnpinnedCaches() SK_OVERRIDE;
|
|
virtual ~SkPurgeableImageCache();
|
|
#endif
|
|
|
|
private:
|
|
SkPurgeableImageCache();
|
|
|
|
#ifdef SK_DEBUG
|
|
SkTDArray<ID> fRecs;
|
|
int findRec(ID) const;
|
|
#endif
|
|
void removeRec(ID);
|
|
};
|
|
#endif // SkPurgeableImageCache_DEFINED
|