Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SkDiscardableMemory Class Referenceabstract

#include <SkDiscardableMemory.h>

Classes

class  Factory
 

Public Member Functions

virtual ~SkDiscardableMemory ()
 
virtual bool lock ()=0
 
virtual void * data ()=0
 
virtual void unlock ()=0
 

Static Public Member Functions

static SkDiscardableMemoryCreate (size_t bytes)
 

Protected Member Functions

 SkDiscardableMemory ()=default
 
 SkDiscardableMemory (const SkDiscardableMemory &)=delete
 
SkDiscardableMemoryoperator= (const SkDiscardableMemory &)=delete
 

Detailed Description

Interface for discardable memory. Implementation is provided by the embedder.

Definition at line 18 of file SkDiscardableMemory.h.

Constructor & Destructor Documentation

◆ ~SkDiscardableMemory()

virtual SkDiscardableMemory::~SkDiscardableMemory ( )
inlinevirtual

Must not be called while locked.

Definition at line 39 of file SkDiscardableMemory.h.

39{}

◆ SkDiscardableMemory() [1/2]

SkDiscardableMemory::SkDiscardableMemory ( )
protecteddefault

◆ SkDiscardableMemory() [2/2]

SkDiscardableMemory::SkDiscardableMemory ( const SkDiscardableMemory )
protecteddelete

Member Function Documentation

◆ Create()

SkDiscardableMemory * SkDiscardableMemory::Create ( size_t  bytes)
static

Factory method that creates, initializes and locks an SkDiscardableMemory object. If either of these steps fails, a nullptr pointer will be returned.

Definition at line 12 of file SkDiscardableMemory_none.cpp.

12 {
14}
SkDiscardableMemoryPool * SkGetGlobalDiscardableMemoryPool()
virtual SkDiscardableMemory * create(size_t bytes)=0

◆ data()

virtual void * SkDiscardableMemory::data ( )
pure virtual

Returns the current pointer for the discardable memory. This call is ONLY valid when the discardable memory object is locked.

◆ lock()

virtual bool SkDiscardableMemory::lock ( )
pure virtual

Locks the memory, prevent it from being discarded. Once locked. you may obtain a pointer to that memory using the data() method.

lock() may return false, indicating that the underlying memory was discarded and that the lock failed.

Nested calls to lock are not allowed.

◆ operator=()

SkDiscardableMemory & SkDiscardableMemory::operator= ( const SkDiscardableMemory )
protecteddelete

◆ unlock()

virtual void SkDiscardableMemory::unlock ( )
pure virtual

Unlock the memory so that it can be purged by the system. Must be called after every successful lock call.


The documentation for this class was generated from the following files: