 |
Skia
2D Graphics Library
|
Go to the documentation of this file.
8 #ifndef SkDrawable_DEFINED
9 #define SkDrawable_DEFINED
125 kSkDrawable_Type, data, size, procs).release()));
157 int32_t fGenerationID;
Factory getFactory() const override
Implement this to return a factory function pointer that can be called to recreate your class given a...
Definition: SkDrawable.h:128
virtual void draw(const GrBackendDrawableInfo &)
Definition: SkDrawable.h:72
const char * getTypeName() const override
Returns the name of the object's class.
Definition: SkDrawable.h:129
void draw(SkCanvas *, const SkMatrix *=nullptr)
Draws into the specified content.
static sk_sp< SkFlattenable > Deserialize(Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
static sk_sp< SkDrawable > Deserialize(const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
Definition: SkDrawable.h:121
virtual SkPicture * onNewPictureSnapshot()
Default implementation calls onDraw() with a canvas that records into a picture.
Type
Definition: SkFlattenable.h:28
virtual std::unique_ptr< GpuDrawHandler > onSnapGpuDrawHandler(GrBackendApi, const SkMatrix &)
Definition: SkDrawable.h:144
SkRect getBounds()
Return the (conservative) bounds of what the drawable will draw.
virtual void onDraw(SkCanvas *)=0
Shared pointer class to wrap classes that support a ref()/unref() interface.
Definition: SkRefCnt.h:215
uint32_t getGenerationID()
Return a unique value for this instance.
#define SK_API
Definition: SkTypes.h:181
Definition: SkImageInfo.h:283
virtual SkRect onGetBounds()=0
@ kSkDrawable_Type
Definition: SkFlattenable.h:30
Definition: SkCanvas.h:87
Definition: SkPicture.h:39
Base-class for objects that draw into SkCanvas.
Definition: SkDrawable.h:29
SkFlattenable::Type getFlattenableType() const override
Definition: SkDrawable.h:117
Definition: GrBackendDrawableInfo.h:15
float SkScalar
Definition: SkScalar.h:16
GrBackendApi
Possible 3D APIs that may be used by Ganesh.
Definition: GrTypes.h:135
SkPicture * newPictureSnapshot()
std::unique_ptr< GpuDrawHandler > snapGpuDrawHandler(GrBackendApi backendApi, const SkMatrix &matrix, const SkIRect &clipBounds, const SkImageInfo &bufferInfo)
Snaps off a GpuDrawHandler to represent the state of the SkDrawable at the time the snap is called.
Definition: SkDrawable.h:81
Definition: SkMatrix.h:48
void notifyDrawingChanged()
Calling this invalidates the previous generation ID, and causes a new one to be computed the next tim...
When using the GPU backend it is possible for a drawable to execute using the underlying 3D API rathe...
Definition: SkDrawable.h:68
static SkFlattenable::Type GetFlattenableType()
Definition: SkDrawable.h:113
void draw(SkCanvas *, SkScalar x, SkScalar y)
Definition: SkSerialProcs.h:61
virtual std::unique_ptr< GpuDrawHandler > onSnapGpuDrawHandler(GrBackendApi, const SkMatrix &, const SkIRect &, const SkImageInfo &)
Definition: SkDrawable.h:137
Definition: SkFlattenable.h:26
virtual ~GpuDrawHandler()
Definition: SkDrawable.h:70