Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | List of all members
SkTraceMemoryDump Class Referenceabstract

#include <SkTraceMemoryDump.h>

Public Types

enum  LevelOfDetail { kLight_LevelOfDetail , kObjectsBreakdowns_LevelOfDetail }
 

Public Member Functions

virtual void dumpNumericValue (const char *dumpName, const char *valueName, const char *units, uint64_t value)=0
 
virtual void dumpStringValue (const char *, const char *, const char *)
 
virtual void setMemoryBacking (const char *dumpName, const char *backingType, const char *backingObjectId)=0
 
virtual void setDiscardableMemoryBacking (const char *dumpName, const SkDiscardableMemory &discardableMemoryObject)=0
 
virtual LevelOfDetail getRequestedDetails () const =0
 
virtual bool shouldDumpWrappedObjects () const
 
virtual void dumpWrappedState (const char *, bool)
 
virtual bool shouldDumpUnbudgetedObjects () const
 
virtual void dumpBudgetedState (const char *, bool)
 

Protected Member Functions

virtual ~SkTraceMemoryDump ()=default
 
 SkTraceMemoryDump ()=default
 
 SkTraceMemoryDump (const SkTraceMemoryDump &)=delete
 
SkTraceMemoryDumpoperator= (const SkTraceMemoryDump &)=delete
 

Detailed Description

Interface for memory tracing. This interface is meant to be passed as argument to the memory dump methods of Skia objects. The implementation of this interface is provided by the embedder.

Definition at line 20 of file SkTraceMemoryDump.h.

Member Enumeration Documentation

◆ LevelOfDetail

Enum to specify the level of the requested details for the dump from the Skia objects.

Enumerator
kLight_LevelOfDetail 
kObjectsBreakdowns_LevelOfDetail 

Definition at line 25 of file SkTraceMemoryDump.h.

25 {
26 // Dump only the minimal details to get the total memory usage (Usually just the totals).
28
29 // Dump the detailed breakdown of the objects in the caches.
31 };

Constructor & Destructor Documentation

◆ ~SkTraceMemoryDump()

virtual SkTraceMemoryDump::~SkTraceMemoryDump ( )
protectedvirtualdefault

◆ SkTraceMemoryDump() [1/2]

SkTraceMemoryDump::SkTraceMemoryDump ( )
protecteddefault

◆ SkTraceMemoryDump() [2/2]

SkTraceMemoryDump::SkTraceMemoryDump ( const SkTraceMemoryDump )
protecteddelete

Member Function Documentation

◆ dumpBudgetedState()

virtual void SkTraceMemoryDump::dumpBudgetedState ( const char *  ,
bool   
)
inlinevirtual

If shouldDumpUnbudgetedObjects() returns true then this function will be called to populate the output with information on whether the item being dumped is budgeted. This call is only used when dumping Graphite memory statistics.

Definition at line 105 of file SkTraceMemoryDump.h.

105{}

◆ dumpNumericValue()

virtual void SkTraceMemoryDump::dumpNumericValue ( const char *  dumpName,
const char *  valueName,
const char *  units,
uint64_t  value 
)
pure virtual

Appends a new memory dump (i.e. a row) to the trace memory infrastructure. If dumpName does not exist yet, a new one is created. Otherwise, a new column is appended to the previously created dump. Arguments: dumpName: an absolute, slash-separated, name for the item being dumped e.g., "skia/CacheX/EntryY". valueName: a string indicating the name of the column. e.g., "size", "active_size", "number_of_objects". This string is supposed to be long lived and is NOT copied. units: a string indicating the units for the value. e.g., "bytes", "objects". This string is supposed to be long lived and is NOT copied. value: the actual value being dumped.

◆ dumpStringValue()

virtual void SkTraceMemoryDump::dumpStringValue ( const char *  ,
const char *  ,
const char *   
)
inlinevirtual

Definition at line 53 of file SkTraceMemoryDump.h.

55 { }

◆ dumpWrappedState()

virtual void SkTraceMemoryDump::dumpWrappedState ( const char *  ,
bool   
)
inlinevirtual

If shouldDumpWrappedObjects() returns true then this function will be called to populate the output with information on whether the item being dumped is a wrapped object.

Definition at line 90 of file SkTraceMemoryDump.h.

90{}

◆ getRequestedDetails()

virtual LevelOfDetail SkTraceMemoryDump::getRequestedDetails ( ) const
pure virtual

Returns the type of details requested in the dump. The granularity of the dump is supposed to match the LevelOfDetail argument. The level of detail must not affect the total size reported, but only granularity of the child entries.

◆ operator=()

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

◆ setDiscardableMemoryBacking()

virtual void SkTraceMemoryDump::setDiscardableMemoryBacking ( const char *  dumpName,
const SkDiscardableMemory discardableMemoryObject 
)
pure virtual

Specialization for memory backed by discardable memory.

◆ setMemoryBacking()

virtual void SkTraceMemoryDump::setMemoryBacking ( const char *  dumpName,
const char *  backingType,
const char *  backingObjectId 
)
pure virtual

Sets the memory backing for an existing dump. backingType and backingObjectId are used by the embedder to associate the memory dumped via dumpNumericValue with the corresponding dump that backs the memory.

◆ shouldDumpUnbudgetedObjects()

virtual bool SkTraceMemoryDump::shouldDumpUnbudgetedObjects ( ) const
inlinevirtual

Returns true if we should dump unbudgeted objects. Unbudgeted objects can either come from wrapped objects passed into Skia from the client or from Skia created objects currently held by the client in a public Skia object (e.g. SkSurface or SkImage). This call is only used when dumping Graphite memory statistics.

Definition at line 98 of file SkTraceMemoryDump.h.

98{ return true; }

◆ shouldDumpWrappedObjects()

virtual bool SkTraceMemoryDump::shouldDumpWrappedObjects ( ) const
inlinevirtual

Returns true if we should dump wrapped objects. Wrapped objects come from outside Skia, and may be independently tracked there.

Definition at line 84 of file SkTraceMemoryDump.h.

84{ return true; }

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