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

Unified Diff: include/lazy/SkImageCache.h

Issue 12398021: If Ashmem cache fails pinCache, do not reallocate. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rebase Created 7 years, 10 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 | « no previous file | src/lazy/SkLazyPixelRef.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/lazy/SkImageCache.h
diff --git a/include/lazy/SkImageCache.h b/include/lazy/SkImageCache.h
index 045ce2c384f168c94129408d65b67ffaa6274d14..6cd064ba5bfae6cd73672975080cf4d5d82ef318 100644
--- a/include/lazy/SkImageCache.h
+++ b/include/lazy/SkImageCache.h
@@ -34,15 +34,16 @@ public:
* @param ID Unique ID for the memory block.
* @return Pointer: If non-NULL, points to the previously allocated memory, in which case
* this call must be balanced with a call to releaseCache. If NULL, the memory
- * has been reclaimed, so allocAndPinCache must be called again, and ID is no
- * longer valid (thus throwAwayCache need not be called).
+ * has been reclaimed, so allocAndPinCache must be called again with a pointer to
+ * the same ID.
*/
virtual void* pinCache(intptr_t ID) = 0;
/**
* Inform the cache that it is safe to free the block of memory corresponding to ID. After
- * calling this function, the pointer returnted by allocAndPinCache or pinCache must not be
- * used again. In order to access the same memory after this, pinCache must be called.
+ * calling this function, the pointer returned by allocAndPinCache or pinCache must not be
+ * used again. In order to access the same memory after this, pinCache must be called with
+ * the same ID.
* @param ID Unique ID for the memory block which is now safe to age out of the cache.
*/
virtual void releaseCache(intptr_t ID) = 0;
@@ -50,8 +51,7 @@ public:
/**
* Inform the cache that the block of memory associated with ID will not be asked for again.
* After this call, ID is no longer valid. Must not be called while the associated memory is
- * pinned. Must be called to balance a successful allocAndPinCache, unless a later pinCache
- * returns NULL.
+ * pinned. Must be called to balance a successful allocAndPinCache.
*/
virtual void throwAwayCache(intptr_t ID) = 0;
« no previous file with comments | « no previous file | src/lazy/SkLazyPixelRef.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698