Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkFlattenable Class Referenceabstract

SkFlattenable is the base class for objects that need to be flattened into a data stream for either transport or as part of the key to the font cache. More...

#include <SkFlattenable.h>

Inheritance diagram for SkFlattenable:
SkRefCnt SkRefCntBase SkColorFilter SkDrawable SkDrawLooper SkImageFilter SkMaskFilter SkPathEffect SkRasterizer SkShader

Classes

class  PrivateInitializer
 

Public Types

enum  Type {
  kSkColorFilter_Type, kSkDrawable_Type, kSkDrawLooper_Type, kSkImageFilter_Type,
  kSkMaskFilter_Type, kSkPathEffect_Type, kSkPixelRef_Type, kSkRasterizer_Type,
  kSkShaderBase_Type, kSkUnused_Type, kSkUnused_Xfermode_Type, kSkNormalSource_Type
}
 
typedef sk_sp< SkFlattenable >(* Factory )(SkReadBuffer &)
 

Public Member Functions

virtual Factory getFactory () const =0
 Implement this to return a factory function pointer that can be called to recreate your class given a buffer (previously written to by your override of flatten().
 
virtual const char * getTypeName () const
 Returns the name of the object's class. More...
 
virtual void flatten (SkWriteBuffer &) const
 Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()).
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 Default construct, initializing the reference count to 1.
 
virtual ~SkRefCntBase ()
 Destruct, asserting that the reference count is 1.
 
int32_t getRefCnt () const
 Return the reference count. More...
 
void validate () const
 
bool unique () const
 May return true if the caller is the only owner. More...
 
void ref () const
 Increment the reference count. More...
 
void unref () const
 Decrement the reference count. More...
 

Static Public Member Functions

static Factory NameToFactory (const char name[])
 
static const char * FactoryToName (Factory)
 
static bool NameToType (const char name[], Type *type)
 
static void Register (const char name[], Factory, Type)
 

Private Types

typedef SkRefCnt INHERITED
 

Static Private Member Functions

static void InitializeFlattenablesIfNeeded ()
 

Friends

class SkGraphics
 

Additional Inherited Members

- Protected Member Functions inherited from SkRefCntBase
void internal_dispose_restore_refcnt_to_1 () const
 Allow subclasses to call this if they've overridden internal_dispose so they can reset fRefCnt before the destructor is called or if they choose not to call the destructor (e.g. More...
 

Detailed Description

SkFlattenable is the base class for objects that need to be flattened into a data stream for either transport or as part of the key to the font cache.

Member Function Documentation

virtual const char* SkFlattenable::getTypeName ( ) const
inlinevirtual

Returns the name of the object's class.

Subclasses should override this function if they intend to provide support for flattening without using the global registry.

If the flattenable is registered, there is no need to override.


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