Skia
2DGraphicsLibrary
|
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< DrawData > | fThreadSafeDrawData |
SkTDArray< DrawData > | fGPUDrawData |
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.
SkMultiPictureDraw::SkMultiPictureDraw | ( | int | reserve = 0 | ) |
Create an object to optimize the drawing of multiple pictures.
reserve | Hint for the number of add calls expected to be issued |
void SkMultiPictureDraw::add | ( | SkCanvas * | canvas, |
const SkPicture * | picture, | ||
const SkMatrix * | matrix = NULL , |
||
const SkPaint * | paint = NULL |
||
) |
Add a canvas/picture pair for later rendering.
canvas | the canvas in which to draw picture |
picture | the picture to draw into canvas |
matrix | if non-NULL, applied to the CTM when drawing |
paint | if 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.