All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkMetaData Class Reference


class  Iter
struct  Rec

Public Types

enum  Type {
  kS32_Type, kScalar_Type, kString_Type, kPtr_Type,
  kBool_Type, kData_Type, kTypeCount
typedef void *(* PtrProc )(void *ptr, bool doRef)
 Used to manage the life-cycle of a ptr in the metadata. More...

Public Member Functions

 SkMetaData (const SkMetaData &src)
SkMetaDataoperator= (const SkMetaData &src)
void reset ()
bool findS32 (const char name[], int32_t *value=NULL) const
bool findScalar (const char name[], SkScalar *value=NULL) const
const SkScalar * findScalars (const char name[], int *count, SkScalar values[]=NULL) const
const char * findString (const char name[]) const
bool findPtr (const char name[], void **value=NULL, PtrProc *=NULL) const
bool findBool (const char name[], bool *value=NULL) const
const void * findData (const char name[], size_t *byteCount=NULL) const
bool hasS32 (const char name[], int32_t value) const
bool hasScalar (const char name[], SkScalar value) const
bool hasString (const char name[], const char value[]) const
bool hasPtr (const char name[], void *value) const
bool hasBool (const char name[], bool value) const
bool hasData (const char name[], const void *data, size_t byteCount) const
void setS32 (const char name[], int32_t value)
void setScalar (const char name[], SkScalar value)
SkScalar * setScalars (const char name[], int count, const SkScalar values[]=NULL)
void setString (const char name[], const char value[])
void setPtr (const char name[], void *value, PtrProc proc=NULL)
void setBool (const char name[], bool value)
void setData (const char name[], const void *data, size_t byteCount)
bool removeS32 (const char name[])
bool removeScalar (const char name[])
bool removeString (const char name[])
bool removePtr (const char name[])
bool removeBool (const char name[])
bool removeData (const char name[])
bool findRefCnt (const char name[], SkRefCnt **ptr=NULL)
bool hasRefCnt (const char name[], SkRefCnt *ptr)
void setRefCnt (const char name[], SkRefCnt *ptr)
bool removeRefCnt (const char name[])
const Recfind (const char name[], Type) const
void * set (const char name[], const void *data, size_t len, Type, int count)
bool remove (const char name[], Type)

Static Public Member Functions

static void * RefCntProc (void *ptr, bool doRef)
 Implements PtrProc for SkRefCnt pointers.

Public Attributes



class Iter

Member Typedef Documentation

typedef void*(* SkMetaData::PtrProc)(void *ptr, bool doRef)

Used to manage the life-cycle of a ptr in the metadata.

This is option in setPtr, and is only invoked when either copying one metadata to another, or when the metadata is destroyed.

setPtr(name, ptr, proc) { fPtr = proc(ptr, true); }

copy: A = B { A.fPtr = B.fProc(B.fPtr, true); }

~SkMetaData { fProc(fPtr, false); }

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