SkPageFlipper Class Reference

#include <SkPageFlipper.h>

Collaboration diagram for SkPageFlipper:
[legend]

List of all members.

Public Member Functions

 SkPageFlipper ()
 SkPageFlipper (int width, int height)
int width () const
int height () const
void resize (int width, int height)
bool isDirty () const
const SkRegiondirtyRgn () const
void inval ()
void inval (const SkIRect &)
void inval (const SkRegion &)
void inval (const SkRect &, bool antialias)
const SkRegionupdate (SkRegion *copyBits)

Detailed Description

SkPageFlipper manages alternating inval/dirty regions for a rectangular area (like a bitmap). You call inval() to accumulate inval areas, and then when you're ready to "flip" pages (i.e. draw into the one you've been invalidating) you call update, which swaps the inval regions, and returns two things to you: 1) the final inval region to be drawn into, and 2) the region of pixels that should be copied from the "front" page onto the one you're about to draw into. This copyBits region will be disjoint from the inval region, so both need to be handled.

Definition at line 31 of file SkPageFlipper.h.


Constructor & Destructor Documentation

SkPageFlipper::SkPageFlipper (  ) 
SkPageFlipper::SkPageFlipper ( int  width,
int  height 
)

Member Function Documentation

const SkRegion& SkPageFlipper::dirtyRgn (  )  const [inline]

Definition at line 42 of file SkPageFlipper.h.

int SkPageFlipper::height (  )  const [inline]

Definition at line 37 of file SkPageFlipper.h.

void SkPageFlipper::inval ( const SkRect ,
bool  antialias 
)
void SkPageFlipper::inval ( const SkRegion  ) 
void SkPageFlipper::inval ( const SkIRect  ) 
void SkPageFlipper::inval (  ) 
bool SkPageFlipper::isDirty (  )  const [inline]

Definition at line 41 of file SkPageFlipper.h.

void SkPageFlipper::resize ( int  width,
int  height 
)
const SkRegion& SkPageFlipper::update ( SkRegion copyBits  ) 

When you're ready to write to the back page, call update. The returned region is the invalidate are that needs to be drawn to. The copyBits region (provided by the caller) is the area that should be copied from the front page to the back page (will not intersect with the returned inval region.

Once this is called, the two internal regions are swapped, so the *new* back inval region is ready to receive new inval calls.

int SkPageFlipper::width (  )  const [inline]

Definition at line 36 of file SkPageFlipper.h.


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

Generated on Tue Oct 20 10:33:04 2009 for Skia by  doxygen 1.6.1