8 #ifndef SkPicture_DEFINED
9 #define SkPicture_DEFINED
247 return this->makeShader(tmx, tmy, mode,
nullptr,
nullptr);
253 friend class SkBigPicture;
254 friend class SkEmptyPicture;
255 friend class SkPicturePriv;
258 bool textBlobsOnly=
false)
const;
260 class SkTypefacePlayback*,
262 friend class SkPictureData;
272 static bool StreamIsSKP(
SkStream*,
struct SkPictInfo*);
273 static bool BufferIsSKP(
class SkReadBuffer*,
struct SkPictInfo*);
277 virtual const class SkBigPicture* asSkBigPicture()
const {
return nullptr; }
279 static bool IsValidPictInfo(
const struct SkPictInfo& info);
281 const class SkPictureData*,
282 class SkReadBuffer* buffer);
284 struct SkPictInfo createHeader() const;
285 class SkPictureData* backport()
const;
288 mutable std::atomic<bool> fAddedToCache{
false};
SkFilterMode
Definition: SkSamplingOptions.h:16
SkTileMode
Definition: SkTileMode.h:13
SkCanvas provides an interface for drawing, and how the drawing is clipped and transformed.
Definition: SkCanvas.h:99
SkData holds an immutable data buffer.
Definition: SkData.h:25
SkMatrix holds a 3x3 matrix for transforming coordinates.
Definition: SkMatrix.h:53
AbortCallback is an abstract class.
Definition: SkPicture.h:97
virtual bool abort()=0
Stops SkPicture playback when some condition is met.
virtual ~AbortCallback()=default
Has no effect.
AbortCallback & operator=(const AbortCallback &)=delete
AbortCallback(const AbortCallback &)=delete
SkPicture records drawing commands made to SkCanvas.
Definition: SkPicture.h:44
uint32_t uniqueID() const
Returns a non-zero value unique among SkPicture in Skia process.
Definition: SkPicture.h:155
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, SkFilterMode mode, const SkMatrix *localMatrix, const SkRect *tileRect) const
Return a new shader that will draw with this picture.
static sk_sp< SkPicture > MakeFromStream(SkStream *stream, const SkDeserialProcs *procs=nullptr)
Recreates SkPicture that was serialized into a stream.
static sk_sp< SkPicture > MakePlaceholder(SkRect cull)
Returns a placeholder SkPicture.
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, SkFilterMode mode) const
Definition: SkPicture.h:246
virtual SkRect cullRect() const =0
Returns cull SkRect for this picture, passed in when SkPicture was created.
friend bool SkPicture_StreamIsSKP(SkStream *, struct SkPictInfo *)
virtual void playback(SkCanvas *canvas, AbortCallback *callback=nullptr) const =0
Replays the drawing commands on the specified canvas.
virtual size_t approximateBytesUsed() const =0
Returns the approximate byte size of SkPicture.
static sk_sp< SkPicture > MakeFromData(const void *data, size_t size, const SkDeserialProcs *procs=nullptr)
sk_sp< SkData > serialize(const SkSerialProcs *procs=nullptr) const
Returns storage containing SkData describing SkPicture, using optional custom encoders.
void serialize(SkWStream *stream, const SkSerialProcs *procs=nullptr) const
Writes picture to stream, using optional custom encoders.
virtual int approximateOpCount(bool nested=false) const =0
Returns the approximate number of operations in SkPicture.
static sk_sp< SkPicture > MakeFromData(const SkData *data, const SkDeserialProcs *procs=nullptr)
Recreates SkPicture that was serialized into data.
Definition: SkRefCnt.h:119
SkStream – abstraction for a source of bytes.
Definition: SkStream.h:29
Definition: SkStream.h:218
Definition: SkSerialProcs.h:97
SkRect holds four float coordinates describing the upper and lower bounds of a rectangle.
Definition: SkRect.h:582
Definition: SkSerialProcs.h:86