Index: include/core/SkGraphics.h |
diff --git a/include/core/SkGraphics.h b/include/core/SkGraphics.h |
index 2667a388d2bbb66a7081fe18bb053328fbdc9266..e7865ca5afb4c393af54fc0bfa8fb7a22392e3e3 100644 |
--- a/include/core/SkGraphics.h |
+++ b/include/core/SkGraphics.h |
@@ -79,9 +79,47 @@ public: |
*/ |
static void PurgeFontCache(); |
- static size_t GetImageCacheBytesUsed(); |
- static size_t GetImageCacheByteLimit(); |
- static size_t SetImageCacheByteLimit(size_t newLimit); |
+ /** |
+ * Scaling bitmaps with the SkPaint::kHigh_FilterLevel setting is |
+ * expensive, so the result is saved in the global Scaled Image |
+ * Cache. |
+ * |
+ * This function returns the memory usage of the Scaled Image Cache. |
+ */ |
+ static size_t GetImageCacheTotalBytesUsed(); |
+ /** |
+ * These functions get/set the memory usage limit for the Scaled |
+ * Image Cache. Bitmaps are purged from the cache when the |
+ * memory useage exceeds this limit. |
+ */ |
+ static size_t GetImageCacheTotalByteLimit(); |
+ static size_t SetImageCacheTotalByteLimit(size_t newLimit); |
+ |
+ // DEPRECATED |
+ static size_t GetImageCacheBytesUsed() { |
+ return GetImageCacheTotalBytesUsed(); |
+ } |
+ // DEPRECATED |
+ static size_t GetImageCacheByteLimit() { |
+ return GetImageCacheTotalByteLimit(); |
+ } |
+ // DEPRECATED |
+ static size_t SetImageCacheByteLimit(size_t newLimit) { |
+ return SetImageCacheTotalByteLimit(newLimit); |
+ } |
+ |
+ /** |
+ * Scaling bitmaps with the SkPaint::kHigh_FilterLevel setting is |
+ * expensive, so the result is saved in the global Scaled Image |
+ * Cache. When the resulting bitmap is too large, this can |
+ * overload the cache. If the ImageCacheSingleAllocationByteLimit |
+ * is set to a non-zero number, and the resulting bitmap would be |
+ * larger than that value, the bitmap scaling algorithm falls |
+ * back onto a cheaper algorithm and does not cache the result. |
+ * Zero is the default value. |
+ */ |
+ static size_t GetImageCacheSingleAllocationByteLimit(); |
+ static size_t SetImageCacheSingleAllocationByteLimit(size_t newLimit); |
/** |
* Applications with command line options may pass optional state, such |