Native Client

pp::PaintManager::Client Class Reference

List of all members.

Public Functions

virtual bool OnPaint (Graphics2D &graphics, const std::vector< Rect > &paint_rects, const Rect &paint_bounds)=0

Protected Functions

virtual ~Client ()

Constructor and Destructor Details

virtual pp::PaintManager::Client::~Client ( ) [inline, protected, virtual]

Function Details

virtual bool pp::PaintManager::Client::OnPaint ( Graphics2D graphics,
const std::vector< Rect > &  paint_rects,
const Rect paint_bounds 
) [pure virtual]

OnPaint() paints the given invalid area of the instance to the given graphics device.

Returns true if anything was painted.

You are given the list of rects to paint in paint_rects, and the union of all of these rects in paint_bounds. You only have to paint the area inside each of the paint_rects, but can paint more if you want (some apps may just want to paint the union).

Do not call Flush() on the graphics device, this will be done automatically if you return true from this function since the PaintManager needs to handle the callback.

It is legal for you to cause invalidates inside of Paint which will then get executed as soon as the Flush for this update has completed. However, this is not very nice to the host system since it will spin the CPU, possibly updating much faster than necessary. It is best to have a 1/60 second timer to do an invalidate instead. This will limit your animation to the slower of 60Hz or "however fast Flush can complete."

[in]graphicsA Graphics2D to be painted.
[in]paint_rectsA list of rects to paint.
[in]paint_boundsA union of the rects to paint.
true if successful, otherwise false.

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

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.