Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkMultiPictureDraw Class Reference

The MultiPictureDraw object accepts several picture/canvas pairs and then attempts to optimally draw the pictures into the canvases, sharing as many resources as possible. More...

#include <SkMultiPictureDraw.h>

Classes

struct  DrawData
 

Public Member Functions

 SkMultiPictureDraw (int reserve=0)
 Create an object to optimize the drawing of multiple pictures. More...
 
void add (SkCanvas *canvas, const SkPicture *picture, const SkMatrix *matrix=NULL, const SkPaint *paint=NULL)
 Add a canvas/picture pair for later rendering. More...
 
void draw (bool flush=false)
 Perform all the previously added draws. More...
 
void reset ()
 Abandon all buffered draws and reset to the initial state.
 

Private Attributes

SkTDArray< DrawDatafThreadSafeDrawData
 
SkTDArray< DrawDatafGPUDrawData
 

Detailed Description

The MultiPictureDraw object accepts several picture/canvas pairs and then attempts to optimally draw the pictures into the canvases, sharing as many resources as possible.

Constructor & Destructor Documentation

SkMultiPictureDraw::SkMultiPictureDraw ( int  reserve = 0)

Create an object to optimize the drawing of multiple pictures.

Parameters
reserveHint for the number of add calls expected to be issued

Member Function Documentation

void SkMultiPictureDraw::add ( SkCanvas canvas,
const SkPicture picture,
const SkMatrix matrix = NULL,
const SkPaint paint = NULL 
)

Add a canvas/picture pair for later rendering.

Parameters
canvasthe canvas in which to draw picture
picturethe picture to draw into canvas
matrixif non-NULL, applied to the CTM when drawing
paintif non-NULL, draw picture to a temporary buffer and then apply the paint when the result is drawn
void SkMultiPictureDraw::draw ( bool  flush = false)

Perform all the previously added draws.

This will reset the state of this object. If flush is true, all canvases are flushed after draw.


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