skia2/site/user/api/SkPicture_Reference.md
skia-bookmaker dd962a95c5 Update markdown files
Automatic commit by the Housekeeper-Nightly-Bookmaker bot.

TBR=rmistry@google.com
NO_MERGE_BUILDS

Change-Id: I8bf0dccafeaeffbeb2f477229d2bef691e9b5fe9
Reviewed-on: https://skia-review.googlesource.com/139532
Reviewed-by: <skia-bookmaker@skia-swarming-bots.iam.gserviceaccount.com>
Commit-Queue: <skia-bookmaker@skia-swarming-bots.iam.gserviceaccount.com>
2018-07-07 05:58:01 +00:00

17 KiB

SkPicture Reference

Picture

Class SkPicture

Constructor

SkPicture can be constructed or initialized by these functions, including C++ class constructors.

Topic Description
MakeFromData incomplete
MakeFromStream incomplete
MakePlaceholder incomplete

An SkPicture records drawing commands made to a canvas to be played back at a later time. This base class handles serialization and a few other miscellany.

Overview

Topic Description
Class Declarations embedded class members
Constructors functions that construct SkPicture
Functions global and class member functions

Class

SkPicture uses C++ classes to declare the public data structures and interfaces.

Topic Description
AbortCallback incomplete

Member Function

SkPicture member functions read and modify the structure properties.

Topic Description
MakeFromData incomplete
MakeFromStream incomplete
MakePlaceholder incomplete
approximateBytesUsed incomplete
approximateOpCount incomplete
cullRect incomplete
playback incomplete
serialize incomplete
uniqueID incomplete

Class SkPicture::AbortCallback

Constructor

SkPicture can be constructed or initialized by these functions, including C++ class constructors.

Topic Description

Member_Function

SkPicture member functions read and modify the structure properties.

Topic Description

Subclasses of this can be passed to playback. During the playback of the picture, this callback will periodically be invoked. If its abort returns true, then picture playback will be interrupted. The resulting drawing is undefined, as there is no guarantee how often the callback will be invoked. If the abort happens inside some level of nested calls to save(), restore will automatically be called to return the state to the same level it was before the playback call was made.

AbortCallback

AbortCallback()

Return Value

incomplete

Example

See Also

incomplete


~AbortCallback

virtual

Example

See Also

incomplete


abort

virtual bool abort() = 0

Return Value

incomplete

Example

See Also

incomplete


MakeFromStream

static sk sp<SkPicture> MakeFromStream(SkStream* stream, const SkDeserialProcs* procs = nullptr)

Recreate a picture that was serialized into a stream or data.

Parameters

stream incomplete
procs incomplete

Return Value

incomplete

Example

See Also

incomplete


MakeFromData

static sk sp<SkPicture> MakeFromData(const SkData* data, const SkDeserialProcs* procs = nullptr)

Parameters

data incomplete
procs incomplete

Return Value

incomplete

Example

See Also

incomplete


static sk sp<SkPicture> MakeFromData(const void* data, size_t size,
                                     const SkDeserialProcs* procs = nullptr)

Parameters

data incomplete
size incomplete
procs incomplete

Return Value

incomplete

Example

See Also

incomplete


playback

virtual void playback(SkCanvas* canvas, AbortCallback* callback = nullptr) const = 0

Replays the drawing commands on the specified canvas. Note that this has the effect of unfurling this picture into the destination canvas. Using the SkCanvas::drawPicture entry point gives the destination canvas the option of just taking a ref.

Parameters

canvas the canvas receiving the drawing commands.
callback a callback that allows interruption of playback

Return Value

incomplete

Example

See Also

incomplete


cullRect

virtual SkRect cullRect() const = 0

Return a cull rect for this picture. Ops recorded into this picture that attempt to draw outside the cull might not be drawn.

Return Value

incomplete

Example

See Also

incomplete


uniqueID

uint32_t uniqueID() const

Returns a non-zero value unique among all pictures.

Return Value

incomplete

Example

See Also

incomplete


serialize

sk sp<SkData> serialize(const SkSerialProcs* procs = nullptr) const

Parameters

procs incomplete

Return Value

incomplete

Example

See Also

incomplete


void serialize(SkWStream* stream, const SkSerialProcs* procs = nullptr) const

Parameters

stream incomplete
procs incomplete

Example

See Also

incomplete


MakePlaceholder

static sk sp<SkPicture> MakePlaceholder(SkRect cull)

Return a placeholder SkPicture. This placeholder does not draw anything itself. It has a distinct uniqueID (just like all Pictures) and will always be visible to SkSerialProcs.

Parameters

cull the placeholder's dimensions

Return Value

incomplete

Example

See Also

incomplete


approximateOpCount

virtual int approximateOpCount() const = 0

Return the approximate number of operations in this picture. This number may be greater or less than the number of SkCanvas calls recorded: some calls may be recorded as more than one operation, or some calls may be optimized away.

Return Value

incomplete

Example

See Also

incomplete


approximateBytesUsed

virtual size_t approximateBytesUsed() const = 0

Returns the approximate byte size of this picture, not including large ref'd objects.

Return Value

incomplete

Example

See Also

incomplete