#include <SkImageRef_GlobalPool.h>
Inherits SkImageRef.
Public Member Functions | |
SkImageRef_GlobalPool (SkStream *, SkBitmap::Config, int sampleSize=1) | |
virtual | ~SkImageRef_GlobalPool () |
virtual Factory | getFactory () const |
Static Public Member Functions | |
static SkPixelRef * | Create (SkFlattenableReadBuffer &) |
static size_t | GetRAMBudget () |
static void | SetRAMBudget (size_t) |
static size_t | GetRAMUsed () |
static void | SetRAMUsed (size_t usageInBytes) |
static void | DumpPool () |
Protected Member Functions | |
virtual bool | onDecode (SkImageDecoder *codec, SkStream *stream, SkBitmap *bitmap, SkBitmap::Config config, SkImageDecoder::Mode mode) |
virtual void | onUnlockPixels () |
SkImageRef_GlobalPool (SkFlattenableReadBuffer &) |
Definition at line 22 of file SkImageRef_GlobalPool.h.
SkImageRef_GlobalPool::SkImageRef_GlobalPool | ( | SkStream * | , | |
SkBitmap::Config | , | |||
int | sampleSize = 1 | |||
) |
virtual SkImageRef_GlobalPool::~SkImageRef_GlobalPool | ( | ) | [virtual] |
SkImageRef_GlobalPool::SkImageRef_GlobalPool | ( | SkFlattenableReadBuffer & | ) | [protected] |
static SkPixelRef* SkImageRef_GlobalPool::Create | ( | SkFlattenableReadBuffer & | ) | [static] |
static void SkImageRef_GlobalPool::DumpPool | ( | ) | [static] |
virtual Factory SkImageRef_GlobalPool::getFactory | ( | ) | const [inline, virtual] |
Reimplemented from SkPixelRef.
Definition at line 29 of file SkImageRef_GlobalPool.h.
static size_t SkImageRef_GlobalPool::GetRAMBudget | ( | ) | [static] |
Return the amount specified as the budget for the cache (in bytes).
static size_t SkImageRef_GlobalPool::GetRAMUsed | ( | ) | [static] |
Return how much ram is currently in use by the global cache.
virtual bool SkImageRef_GlobalPool::onDecode | ( | SkImageDecoder * | codec, | |
SkStream * | , | |||
SkBitmap * | , | |||
SkBitmap::Config | , | |||
SkImageDecoder::Mode | ||||
) | [protected, virtual] |
Override if you want to install a custom allocator. When this is called we will have already acquired the mutex!
Reimplemented from SkImageRef.
virtual void SkImageRef_GlobalPool::onUnlockPixels | ( | ) | [protected, virtual] |
Called when the lock count goes from 1 to 0. The caller will have already acquire a mutex for thread safety, so this method need not do that.
Reimplemented from SkImageRef.
static void SkImageRef_GlobalPool::SetRAMBudget | ( | size_t | ) | [static] |
Set a new budget value for the cache.
static void SkImageRef_GlobalPool::SetRAMUsed | ( | size_t | usageInBytes | ) | [static] |
Free up (approximately) enough such that the amount used by the cache is <= the specified amount. Since some images may be "in use", the amount actually freed may not always result in a ram usage value <= to the requested amount. In addition, because of the chunky nature of the cache, the resulting usage may be < the requested amount.