Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
flutter::BoundsAccumulator Class Referenceabstract

#include <dl_bounds_accumulator.h>

Inheritance diagram for flutter::BoundsAccumulator:
flutter::RTreeBoundsAccumulator flutter::RectBoundsAccumulator

Public Types

typedef bool BoundsModifier(const SkRect &original, SkRect *dest)
 

Public Member Functions

virtual ~BoundsAccumulator ()=default
 
virtual void accumulate (const SkRect &r, int index=0)=0
 
virtual void save ()=0
 
virtual void restore ()=0
 
virtual bool restore (std::function< bool(const SkRect &original, SkRect &modified)> map, const SkRect *clip=nullptr)=0
 
virtual SkRect bounds () const =0
 
virtual sk_sp< DlRTreertree () const =0
 
virtual BoundsAccumulatorType type () const =0
 

Detailed Description

Definition at line 29 of file dl_bounds_accumulator.h.

Member Typedef Documentation

◆ BoundsModifier

typedef bool flutter::BoundsAccumulator::BoundsModifier(const SkRect &original, SkRect *dest)

function definition for modifying the bounds of a rectangle during a restore operation. The function is used primarily to account for the bounds impact of an ImageFilter on a saveLayer on a per-rect basis. The implementation may apply this function at whatever granularity it can manage easily (for example, a Rect accumulator might apply it to the entire local bounds being restored, whereas an RTree accumulator might apply it individually to each element in the local RTree).

The function will do a best faith attempt at determining the modified bounds and store the results in the supplied |dest| rectangle and return true. If the function is unable to accurately determine the modifed bounds, it will set the |dest| rectangle to a copy of the input bounds (or a best guess) and return false to indicate that the bounds should not be trusted.

Definition at line 47 of file dl_bounds_accumulator.h.

Constructor & Destructor Documentation

◆ ~BoundsAccumulator()

virtual flutter::BoundsAccumulator::~BoundsAccumulator ( )
virtualdefault

Member Function Documentation

◆ accumulate()

virtual void flutter::BoundsAccumulator::accumulate ( const SkRect r,
int  index = 0 
)
pure virtual

◆ bounds()

virtual SkRect flutter::BoundsAccumulator::bounds ( ) const
pure virtual

◆ restore() [1/2]

virtual void flutter::BoundsAccumulator::restore ( )
pure virtual

Restore to the previous accumulation and incorporate the bounds of the primitives that were recorded since the last save (if needed).

Implemented in flutter::RectBoundsAccumulator, and flutter::RTreeBoundsAccumulator.

◆ restore() [2/2]

virtual bool flutter::BoundsAccumulator::restore ( std::function< bool(const SkRect &original, SkRect &modified)>  map,
const SkRect clip = nullptr 
)
pure virtual

Restore the previous set of accumulation rects/bounds and accumulate the current rects/bounds that were accumulated since the most recent call to |save| into them with modifications specified by the |map| parameter and clipping to the clip parameter if it is not null.

The indicated map function is applied to the various rects and bounds that have been accumulated in this save/restore cycle before they are then accumulated into the previous accumulations. The granularity of the application of the map function to the rectangles that were accumulated during the save period is left up to the implementation.

This method will return true if the map function returned true on every single invocation. A false return value means that the bounds accumulated during this restore may not be trusted (as determined by the map function).

If there are no saved accumulations to restore to, this method will NOP ignoring the map function and the optional clip entirely.

Implemented in flutter::RTreeBoundsAccumulator.

◆ rtree()

virtual sk_sp< DlRTree > flutter::BoundsAccumulator::rtree ( ) const
pure virtual

◆ save()

virtual void flutter::BoundsAccumulator::save ( )
pure virtual

Save aside the rects/bounds currently being accumulated and start accumulating a new set of rects/bounds. When restore is called, some additional modifications may be applied to these new bounds before they are accumulated back into the surrounding bounds.

Implemented in flutter::RectBoundsAccumulator, and flutter::RTreeBoundsAccumulator.

◆ type()

virtual BoundsAccumulatorType flutter::BoundsAccumulator::type ( ) const
pure virtual

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