Native Client

pp::PaintAggregator Class Reference

This class is responsible for aggregating multiple invalidation and scroll commands to produce a scroll and repaint sequence. More...

List of all members.

Classes

class  InternalPaintUpdate
struct  PaintUpdate

Public Functions

 PaintAggregator ()
void set_max_redundant_paint_to_scroll_area (float area)
void set_max_paint_rects (size_t max_rects)
bool HasPendingUpdate () const
void ClearPendingUpdate ()
PaintUpdate GetPendingUpdate () const
void InvalidateRect (const Rect &rect)
void ScrollRect (const Rect &clip_rect, const Point &amount)

Detailed Description

This class is responsible for aggregating multiple invalidation and scroll commands to produce a scroll and repaint sequence.

You can use this manually to track your updates, but most applications will use the PaintManager to additionally handle the necessary callbacks on top of the PaintAggregator functionality.

Refer to http://code.google.com/p/ppapi/wiki/2DPaintingModel for further information.


Constructor and Destructor Details

pp::PaintAggregator::PaintAggregator ( )

Default constructor.


Function Details

void pp::PaintAggregator::ClearPendingUpdate ( )

This function clears a pending update.

PaintUpdate pp::PaintAggregator::GetPendingUpdate ( ) const

This function gets a pending update.

Returns:
A PaintUpdate containing the pending update.
bool pp::PaintAggregator::HasPendingUpdate ( ) const

This function determines if there is a pending update.

There is a PendingUpdate if InvalidateRect or ScrollRect were called and ClearPendingUpdate was not called.

Returns:
true if there is a pending update, otherwise false.
void pp::PaintAggregator::InvalidateRect ( const Rect rect)

This function invalidates the rect so it will be repainted.

Parameters:
[in]rectA rect to be repainted.
void pp::PaintAggregator::ScrollRect ( const Rect clip_rect,
const Point amount 
)

This function adds a pending scroll update.

Parameters:
[in]clip_rectThe rect to scroll.
[in]amountA Point amount to scroll rect.
void pp::PaintAggregator::set_max_paint_rects ( size_t  max_rects) [inline]

Setter function for setting the maximum number of paint rects.

If we exceed this limit, then we'll start combining paint rects (see CombinePaintRects). This limiting can be important since there is typically some overhead in deciding what to paint. If your module is fast at doing these computations, raise this threshold, if your module is slow, lower it (probably requires some tuning to find the right value).

Parameters:
[in]max_rectsThe maximum number of paint rects.
void pp::PaintAggregator::set_max_redundant_paint_to_scroll_area ( float  area) [inline]

Setter function setting the max ratio of paint rect area to scroll rect area that we will tolerate before downgrading the scroll into a repaint.

If the combined area of paint rects contained within the scroll rect grows too large, then we might as well just treat the scroll rect as a paint rect.

Parameters:
[in]areaThe max ratio of paint rect area to scroll rect area that we will tolerate before downgrading the scroll into a repaint.

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.