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

Unified Diff: src/lazy/SkDiscardableMemoryPool.h

Issue 228613003: Move SkDecodingImageGenerator.h to include/ (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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
Index: src/lazy/SkDiscardableMemoryPool.h
diff --git a/src/lazy/SkDiscardableMemoryPool.h b/src/lazy/SkDiscardableMemoryPool.h
deleted file mode 100644
index d141507004151360931df09b8622862dc480962b..0000000000000000000000000000000000000000
--- a/src/lazy/SkDiscardableMemoryPool.h
+++ /dev/null
@@ -1,68 +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 SkDiscardableMemoryPool_DEFINED
-#define SkDiscardableMemoryPool_DEFINED
-
-#include "SkDiscardableMemory.h"
-
-#ifndef SK_LAZY_CACHE_STATS
- #ifdef SK_DEBUG
- #define SK_LAZY_CACHE_STATS 1
- #else
- #define SK_LAZY_CACHE_STATS 0
- #endif
-#endif
-
-/**
- * An implementation of Discardable Memory that manages a fixed-size
- * budget of memory. When the allocated memory exceeds this size,
- * unlocked blocks of memory are purged. If all memory is locked, it
- * can exceed the memory-use budget.
- */
-class SkDiscardableMemoryPool : public SkDiscardableMemory::Factory {
-public:
- virtual ~SkDiscardableMemoryPool() { }
-
- virtual size_t getRAMUsed() = 0;
- virtual void setRAMBudget(size_t budget) = 0;
- virtual size_t getRAMBudget() = 0;
-
- /** purges all unlocked DMs */
- virtual void dumpPool() = 0;
-
- #if SK_LAZY_CACHE_STATS
- /**
- * These two values are a count of the number of successful and
- * failed calls to SkDiscardableMemory::lock() for all DMs managed
- * by this pool.
- */
- virtual int getCacheHits() = 0;
- virtual int getCacheMisses() = 0;
- virtual void resetCacheHitsAndMisses() = 0;
- #endif
-
- /**
- * This non-global pool can be used for unit tests to verify that
- * the pool works.
- * Without mutex, will be not be thread safe.
- */
- static SkDiscardableMemoryPool* Create(
- size_t size, SkBaseMutex* mutex = NULL);
-};
-
-/**
- * Returns (and creates if needed) a threadsafe global
- * SkDiscardableMemoryPool.
- */
-SkDiscardableMemoryPool* SkGetGlobalDiscardableMemoryPool();
-
-#if !defined(SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE)
-#define SK_DEFAULT_GLOBAL_DISCARDABLE_MEMORY_POOL_SIZE (128 * 1024 * 1024)
-#endif
-
-#endif // SkDiscardableMemoryPool_DEFINED
« include/lazy/SkDiscardableMemoryPool.h ('K') | « src/images/SkDecodingImageGenerator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698