#include <SkPicture.h>
Inherits SkRefCnt.
Public Types | |
enum | RecordingFlags { kUsePathBoundsForClip_RecordingFlag = 0x01 } |
Public Member Functions | |
SkPicture () | |
SkPicture (const SkPicture &src) | |
SkPicture (SkStream *) | |
virtual | ~SkPicture () |
void | swap (SkPicture &other) |
SkCanvas * | beginRecording (int width, int height, uint32_t recordFlags=0) |
SkCanvas * | getRecordingCanvas () const |
void | endRecording () |
void | draw (SkCanvas *surface) |
int | width () const |
int | height () const |
void | serialize (SkWStream *) const |
void | abortPlayback () |
Friends | |
class | SkFlatPicture |
class | SkPicturePlayback |
The SkPicture class records the drawing commands made to a canvas, to be played back at a later time.
Definition at line 33 of file SkPicture.h.
Definition at line 52 of file SkPicture.h.
SkPicture::SkPicture | ( | ) |
The constructor prepares the picture to record.
width | the width of the virtual device the picture records. | |
height | the height of the virtual device the picture records. |
SkPicture::SkPicture | ( | const SkPicture & | src | ) |
Make a copy of the contents of src. If src records more drawing after this call, those elements will not appear in this picture.
SkPicture::SkPicture | ( | SkStream * | ) | [explicit] |
virtual SkPicture::~SkPicture | ( | ) | [virtual] |
void SkPicture::abortPlayback | ( | ) |
Signals that the caller is prematurely done replaying the drawing commands. This can be called from a canvas virtual while the picture is drawing. Has no effect if the picture is not drawing.
SkCanvas* SkPicture::beginRecording | ( | int | width, | |
int | height, | |||
uint32_t | recordFlags = 0 | |||
) |
Returns the canvas that records the drawing commands.
width | the base width for the picture, as if the recording canvas' bitmap had this width. | |
height | the base width for the picture, as if the recording canvas' bitmap had this height. | |
recordFlags | optional flags that control recording. |
void SkPicture::draw | ( | SkCanvas * | surface | ) |
Replays the drawing commands on the specified canvas. This internally calls endRecording() if that has not already been called.
surface | the canvas receiving the drawing commands. |
void SkPicture::endRecording | ( | ) |
Signal that the caller is done recording. This invalidates the canvas returned by beginRecording/getRecordingCanvas, and prepares the picture for drawing. Note: this happens implicitly the first time the picture is drawn.
SkCanvas* SkPicture::getRecordingCanvas | ( | ) | const |
Returns the recording canvas if one is active, or NULL if recording is not active. This does not alter the refcnt on the canvas (if present).
int SkPicture::height | ( | ) | const [inline] |
Return the height of the picture's recording canvas. This value reflects what was passed to setSize(), and does not necessarily reflect the bounds of what has been recorded into the picture.
Definition at line 103 of file SkPicture.h.
void SkPicture::serialize | ( | SkWStream * | ) | const |
void SkPicture::swap | ( | SkPicture & | other | ) |
Swap the contents of the two pictures. Guaranteed to succeed.
int SkPicture::width | ( | ) | const [inline] |
Return the width of the picture's recording canvas. This value reflects what was passed to setSize(), and does not necessarily reflect the bounds of what has been recorded into the picture.
Definition at line 96 of file SkPicture.h.
friend class SkFlatPicture [friend] |
Definition at line 118 of file SkPicture.h.
friend class SkPicturePlayback [friend] |
Definition at line 119 of file SkPicture.h.