8 #ifndef SkDrawable_DEFINED
9 #define SkDrawable_DEFINED
14 #include "include/private/base/SkAPI.h"
93 return this->onSnapGpuDrawHandler(backendApi, matrix, clipBounds, bufferInfo);
131 return kSkDrawable_Type;
135 return kSkDrawable_Type;
142 kSkDrawable_Type, data, size, procs).release()));
175 int32_t fGenerationID;
GrBackendApi
Possible 3D APIs that may be used by Ganesh.
Definition: GrTypes.h:96
float SkScalar
Definition: SkScalar.h:14
Definition: GrBackendDrawableInfo.h:15
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
When using the GPU backend it is possible for a drawable to execute using the underlying 3D API rathe...
Definition: SkDrawable.h:76
virtual ~GpuDrawHandler()
Definition: SkDrawable.h:78
virtual void draw(const GrBackendDrawableInfo &)
Definition: SkDrawable.h:80
Base-class for objects that draw into SkCanvas.
Definition: SkDrawable.h:37
sk_sp< SkPicture > makePictureSnapshot()
Returns an SkPicture with the contents of this SkDrawable.
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:89
void notifyDrawingChanged()
Calling this invalidates the previous generation ID, and causes a new one to be computed the next tim...
uint32_t getGenerationID()
Return a unique value for this instance.
SkFlattenable::Type getFlattenableType() const override
Definition: SkDrawable.h:134
size_t approximateBytesUsed()
Return approximately how many bytes would be freed if this drawable is destroyed.
virtual SkRect onGetBounds()=0
void draw(SkCanvas *, SkScalar x, SkScalar y)
virtual std::unique_ptr< GpuDrawHandler > onSnapGpuDrawHandler(GrBackendApi, const SkMatrix &, const SkIRect &, const SkImageInfo &)
Definition: SkDrawable.h:155
static SkFlattenable::Type GetFlattenableType()
Definition: SkDrawable.h:130
SkRect getBounds()
Return the (conservative) bounds of what the drawable will draw.
virtual std::unique_ptr< GpuDrawHandler > onSnapGpuDrawHandler(GrBackendApi, const SkMatrix &)
Definition: SkDrawable.h:162
virtual void onDraw(SkCanvas *)=0
static sk_sp< SkDrawable > Deserialize(const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
Definition: SkDrawable.h:138
const char * getTypeName() const override
Returns the name of the object's class.
Definition: SkDrawable.h:146
virtual size_t onApproximateBytesUsed()
void draw(SkCanvas *, const SkMatrix *=nullptr)
Draws into the specified content.
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:145
virtual sk_sp< SkPicture > onMakePictureSnapshot()
Default implementation calls onDraw() with a canvas that records into a picture.
SkFlattenable is the base class for objects that need to be flattened into a data stream for either t...
Definition: SkFlattenable.h:28
static sk_sp< SkFlattenable > Deserialize(Type, const void *data, size_t length, const SkDeserialProcs *procs=nullptr)
Type
Definition: SkFlattenable.h:30
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:53
SkPicture records drawing commands made to SkCanvas.
Definition: SkPicture.h:44
Definition: SkSerialProcs.h:97
SkIRect holds four 32-bit integer coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:32
Describes pixel dimensions and encoding.
Definition: SkImageInfo.h:194
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582