SkPicture Class Reference

#include <SkPicture.h>

Inherits SkRefCnt.

Collaboration diagram for SkPicture:
Collaboration graph
[legend]

List of all members.

Public Types

enum  RecordingFlags { kUsePathBoundsForClip_RecordingFlag = 0x01 }

Public Member Functions

 SkPicture ()
 SkPicture (const SkPicture &src)
 SkPicture (SkStream *)
virtual ~SkPicture ()
void swap (SkPicture &other)
SkCanvasbeginRecording (int width, int height, uint32_t recordFlags=0)
SkCanvasgetRecordingCanvas () const
void endRecording ()
void draw (SkCanvas *surface)
int width () const
int height () const
void serialize (SkWStream *) const
void abortPlayback ()

Friends

class SkFlatPicture
class SkPicturePlayback

Detailed Description

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.


Member Enumeration Documentation

Enumerator:
kUsePathBoundsForClip_RecordingFlag 

Definition at line 52 of file SkPicture.h.


Constructor & Destructor Documentation

SkPicture::SkPicture (  ) 

The constructor prepares the picture to record.

Parameters:
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]

Member Function Documentation

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.

Parameters:
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.
Returns:
the picture canvas.
void SkPicture::draw ( SkCanvas surface  ) 

Replays the drawing commands on the specified canvas. This internally calls endRecording() if that has not already been called.

Parameters:
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.

Returns:
the height of the picture's recording canvas

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.

Returns:
the width of the picture's recording canvas

Definition at line 96 of file SkPicture.h.


Friends And Related Function Documentation

friend class SkFlatPicture [friend]

Definition at line 118 of file SkPicture.h.

friend class SkPicturePlayback [friend]

Definition at line 119 of file SkPicture.h.


The documentation for this class was generated from the following file:

Generated on Tue Oct 20 11:03:42 2009 for Skia by  doxygen 1.6.1