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

Unified Diff: include/ports/SkAshmemImageCache.h

Issue 12433020: Improvements/additions to SkImageCache/SkLazyPixelRef. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Respond to comments. Created 7 years, 9 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/lazy/SkPurgeableImageCache.h ('k') | src/lazy/SkBitmapFactory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/ports/SkAshmemImageCache.h
diff --git a/include/ports/SkAshmemImageCache.h b/include/ports/SkAshmemImageCache.h
deleted file mode 100644
index 817e702490341c5b9a23005d863b8171da3d3237..0000000000000000000000000000000000000000
--- a/include/ports/SkAshmemImageCache.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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 SkAshmemImageCache_DEFINED
-#define SkAshmemImageCache_DEFINED
-
-#include "SkImageCache.h"
-#include "SkTDArray.h"
-#include "SkTypes.h"
-
-class SkAshmemImageCache : public SkImageCache {
-
-public:
- /**
- * Get a pointer to the single global instance of SkAshmemImageCache.
- */
- static SkAshmemImageCache* GetAshmemImageCache();
-
- virtual void* allocAndPinCache(size_t bytes, intptr_t* ID) SK_OVERRIDE;
- virtual void* pinCache(intptr_t ID) SK_OVERRIDE;
- virtual void releaseCache(intptr_t ID) SK_OVERRIDE;
- virtual void throwAwayCache(intptr_t ID) SK_OVERRIDE;
-
-#ifdef SK_DEBUG
- SkImageCache::CacheStatus getCacheStatus(intptr_t ID) const SK_OVERRIDE;
-
- virtual ~SkAshmemImageCache();
-#endif
-
-private:
- struct AshmemRec {
- int fFD;
- void* fAddr;
- size_t fSize;
-#ifdef SK_DEBUG
- bool fPinned;
-
- static int Compare(const AshmemRec*, const AshmemRec*);
-#endif
- };
-
- /**
- * Constructor is private. The correct way to get this cache is through
- * GetAshmemImageCache, so that all callers can get the single global.
- */
- SkAshmemImageCache();
-
-#ifdef SK_DEBUG
- // Stores a list of AshmemRecs to track deletion.
- SkTDArray<AshmemRec*> fRecs;
-
- /**
- * Debug only function to add an AshmemRec to the list.
- */
- void appendRec(AshmemRec*);
-
- /**
- * Return the index of AshmemRec.
- */
- int findRec(const AshmemRec*) const;
-#endif
-
- /**
- * Deletes AshmemRec. In debug, also removes from the list.
- */
- void removeRec(AshmemRec*);
-};
-#endif // SkAshmemImageCache_DEFINED
« no previous file with comments | « include/lazy/SkPurgeableImageCache.h ('k') | src/lazy/SkBitmapFactory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698