Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
RootDrawable Class Reference
Inheritance diagram for RootDrawable:
SkDrawable SkFlattenable SkRefCnt SkRefCntBase

Public Member Functions

 RootDrawable (uint32_t a, uint32_t b, uint32_t c, uint32_t d, const SkPaint &paint, uint32_t e, uint32_t f, uint32_t g, uint32_t h, SkDrawable *drawable)
 
 RootDrawable (CompoundDrawable *compoundDrawable, IntDrawable *intDrawable, SkDrawable *drawable)
 
void flatten (SkWriteBuffer &buffer) const override
 
Factory getFactory () const override
 
CompoundDrawablecompoundDrawable () const
 
IntDrawableintDrawable () const
 
SkDrawabledrawable () const
 
const char * getTypeName () const override
 
- Public Member Functions inherited from SkDrawable
void draw (SkCanvas *, const SkMatrix *=nullptr)
 
void draw (SkCanvas *, SkScalar x, SkScalar y)
 
std::unique_ptr< GpuDrawHandlersnapGpuDrawHandler (GrBackendApi backendApi, const SkMatrix &matrix, const SkIRect &clipBounds, const SkImageInfo &bufferInfo)
 
sk_sp< SkPicturemakePictureSnapshot ()
 
uint32_t getGenerationID ()
 
SkRect getBounds ()
 
size_t approximateBytesUsed ()
 
void notifyDrawingChanged ()
 
SkFlattenable::Type getFlattenableType () const override
 
Factory getFactory () const override
 
const char * getTypeName () const override
 
- Public Member Functions inherited from SkFlattenable
 SkFlattenable ()
 
sk_sp< SkDataserialize (const SkSerialProcs *=nullptr) const
 
size_t serialize (void *memory, size_t memory_size, const SkSerialProcs *=nullptr) const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< SkFlattenableCreateProc (SkReadBuffer &buffer)
 
- Static Public Member Functions inherited from SkDrawable
static SkFlattenable::Type GetFlattenableType ()
 
static sk_sp< SkDrawableDeserialize (const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
 
- Static Public Member Functions inherited from SkFlattenable
static Factory NameToFactory (const char name[])
 
static const char * FactoryToName (Factory)
 
static void Register (const char name[], Factory)
 
static sk_sp< SkFlattenableDeserialize (Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
 

Protected Member Functions

SkRect onGetBounds () override
 
void onDraw (SkCanvas *) override
 
- Protected Member Functions inherited from SkDrawable
 SkDrawable ()
 
virtual size_t onApproximateBytesUsed ()
 
virtual std::unique_ptr< GpuDrawHandleronSnapGpuDrawHandler (GrBackendApi, const SkMatrix &, const SkIRect &, const SkImageInfo &)
 
virtual std::unique_ptr< GpuDrawHandleronSnapGpuDrawHandler (GrBackendApi, const SkMatrix &)
 
virtual sk_sp< SkPictureonMakePictureSnapshot ()
 

Additional Inherited Members

- Public Types inherited from SkFlattenable
enum  Type {
  kSkColorFilter_Type , kSkBlender_Type , kSkDrawable_Type , kSkDrawLooper_Type ,
  kSkImageFilter_Type , kSkMaskFilter_Type , kSkPathEffect_Type , kSkShader_Type
}
 
typedef sk_sp< SkFlattenable >(* Factory) (SkReadBuffer &)
 

Detailed Description

Definition at line 152 of file FlattenDrawableTest.cpp.

Constructor & Destructor Documentation

◆ RootDrawable() [1/2]

RootDrawable::RootDrawable ( uint32_t  a,
uint32_t  b,
uint32_t  c,
uint32_t  d,
const SkPaint paint,
uint32_t  e,
uint32_t  f,
uint32_t  g,
uint32_t  h,
SkDrawable drawable 
)
inline

Definition at line 154 of file FlattenDrawableTest.cpp.

156 : fCompoundDrawable(new CompoundDrawable(a, b, c, d, paint))
157 , fIntDrawable(new IntDrawable(e, f, g, h))
158 , fDrawable(SkRef(drawable))
159 {}
static T * SkRef(T *obj)
Definition SkRefCnt.h:132
SkDrawable * drawable() const
const Paint & paint
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition main.cc:19
static bool b
struct MyStruct a[10]
SkScalar h

◆ RootDrawable() [2/2]

RootDrawable::RootDrawable ( CompoundDrawable compoundDrawable,
IntDrawable intDrawable,
SkDrawable drawable 
)
inline

Definition at line 161 of file FlattenDrawableTest.cpp.

163 : fCompoundDrawable(SkRef(compoundDrawable))
164 , fIntDrawable(SkRef(intDrawable))
165 , fDrawable(SkRef(drawable))
166 {}
CompoundDrawable * compoundDrawable() const
IntDrawable * intDrawable() const

Member Function Documentation

◆ compoundDrawable()

CompoundDrawable * RootDrawable::compoundDrawable ( ) const
inline

Definition at line 196 of file FlattenDrawableTest.cpp.

196{ return fCompoundDrawable.get(); }
T * get() const
Definition SkRefCnt.h:303

◆ CreateProc()

static sk_sp< SkFlattenable > RootDrawable::CreateProc ( SkReadBuffer buffer)
inlinestatic

Definition at line 174 of file FlattenDrawableTest.cpp.

174 {
176 buffer.readFlattenable(SkFlattenable::kSkDrawable_Type));
178 SkASSERT(!strcmp("CompoundDrawable", compoundDrawable->getTypeName()));
179
181 buffer.readFlattenable(SkFlattenable::kSkDrawable_Type));
183 SkASSERT(!strcmp("IntDrawable", intDrawable->getTypeName()));
184
186 buffer.readFlattenable(SkFlattenable::kSkDrawable_Type));
188
190 (IntDrawable*) intDrawable.get(),
191 (SkDrawable*) drawable.get()));
192 }
#define SkASSERT(cond)
Definition SkAssert.h:116
const char * getTypeName() const override
const char * getTypeName() const override
static const uint8_t buffer[]

◆ drawable()

SkDrawable * RootDrawable::drawable ( ) const
inline

Definition at line 198 of file FlattenDrawableTest.cpp.

198{ return fDrawable.get(); }

◆ flatten()

void RootDrawable::flatten ( SkWriteBuffer ) const
inlineoverridevirtual

Override this if your subclass needs to record data that it will need to recreate itself from its CreateProc (returned by getFactory()).

DEPRECATED public : will move to protected ... use serialize() instead

Reimplemented from SkFlattenable.

Definition at line 168 of file FlattenDrawableTest.cpp.

168 {
169 buffer.writeFlattenable(fCompoundDrawable.get());
170 buffer.writeFlattenable(fIntDrawable.get());
171 buffer.writeFlattenable(fDrawable.get());
172 }

◆ getFactory()

Factory RootDrawable::getFactory ( ) const
inlineoverridevirtual

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().

Implements SkFlattenable.

Definition at line 194 of file FlattenDrawableTest.cpp.

194{ return CreateProc; }
static sk_sp< SkFlattenable > CreateProc(SkReadBuffer &buffer)

◆ getTypeName()

const char * RootDrawable::getTypeName ( ) const
inlineoverridevirtual

Returns the name of the object's class.

Implements SkFlattenable.

Definition at line 200 of file FlattenDrawableTest.cpp.

200{ return "RootDrawable"; }

◆ intDrawable()

IntDrawable * RootDrawable::intDrawable ( ) const
inline

Definition at line 197 of file FlattenDrawableTest.cpp.

197{ return fIntDrawable.get(); }

◆ onDraw()

void RootDrawable::onDraw ( SkCanvas )
inlineoverrideprotectedvirtual

Implements SkDrawable.

Definition at line 204 of file FlattenDrawableTest.cpp.

204{}

◆ onGetBounds()

SkRect RootDrawable::onGetBounds ( )
inlineoverrideprotectedvirtual

Implements SkDrawable.

Definition at line 203 of file FlattenDrawableTest.cpp.

203{ return SkRect::MakeEmpty(); }
static constexpr SkRect MakeEmpty()
Definition SkRect.h:595

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