Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
flutter::RectBoundsAccumulator Class Referencefinal

#include <dl_bounds_accumulator.h>

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

Public Member Functions

void accumulate (SkScalar x, SkScalar y)
 
void accumulate (const SkPoint &p)
 
void accumulate (const SkRect &r, int index) override
 
bool is_empty () const
 
bool is_not_empty () const
 
void save () override
 
void restore () override
 
bool restore (std::function< bool(const SkRect &, SkRect &)> mapper, const SkRect *clip) override
 
SkRect bounds () const override
 
BoundsAccumulatorType type () const override
 
sk_sp< DlRTreertree () const override
 
- Public Member Functions inherited from flutter::BoundsAccumulator
virtual ~BoundsAccumulator ()=default
 
virtual bool restore (std::function< bool(const SkRect &original, SkRect &modified)> map, const SkRect *clip=nullptr)=0
 

Additional Inherited Members

- Public Types inherited from flutter::BoundsAccumulator
typedef bool BoundsModifier(const SkRect &original, SkRect *dest)
 

Detailed Description

Definition at line 92 of file dl_bounds_accumulator.h.

Member Function Documentation

◆ accumulate() [1/3]

void flutter::RectBoundsAccumulator::accumulate ( const SkPoint p)
inline

Definition at line 95 of file dl_bounds_accumulator.h.

95{ rect_.accumulate(p.fX, p.fY); }

◆ accumulate() [2/3]

void flutter::RectBoundsAccumulator::accumulate ( const SkRect r,
int  index 
)
overridevirtual

Implements flutter::BoundsAccumulator.

Definition at line 9 of file dl_bounds_accumulator.cc.

9 {
10 if (r.fLeft < r.fRight && r.fTop < r.fBottom) {
11 rect_.accumulate(r.fLeft, r.fTop);
12 rect_.accumulate(r.fRight, r.fBottom);
13 }
14}
SkScalar fBottom
larger y-axis bounds
Definition extension.cpp:17
SkScalar fLeft
smaller x-axis bounds
Definition extension.cpp:14
SkScalar fRight
larger x-axis bounds
Definition extension.cpp:16
SkScalar fTop
smaller y-axis bounds
Definition extension.cpp:15

◆ accumulate() [3/3]

void flutter::RectBoundsAccumulator::accumulate ( SkScalar  x,
SkScalar  y 
)
inline

Definition at line 94 of file dl_bounds_accumulator.h.

94{ rect_.accumulate(x, y); }
double y
double x

◆ bounds()

SkRect flutter::RectBoundsAccumulator::bounds ( ) const
inlineoverridevirtual

Implements flutter::BoundsAccumulator.

Definition at line 106 of file dl_bounds_accumulator.h.

106 {
107 FML_DCHECK(saved_rects_.empty());
108 return rect_.bounds();
109 }
#define FML_DCHECK(condition)
Definition logging.h:103

◆ is_empty()

bool flutter::RectBoundsAccumulator::is_empty ( ) const
inline

Definition at line 98 of file dl_bounds_accumulator.h.

98{ return rect_.is_empty(); }

◆ is_not_empty()

bool flutter::RectBoundsAccumulator::is_not_empty ( ) const
inline

Definition at line 99 of file dl_bounds_accumulator.h.

99{ return rect_.is_not_empty(); }

◆ restore() [1/2]

void flutter::RectBoundsAccumulator::restore ( )
overridevirtual

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

Implements flutter::BoundsAccumulator.

Definition at line 20 of file dl_bounds_accumulator.cc.

20 {
21 if (!saved_rects_.empty()) {
22 SkRect layer_bounds = rect_.bounds();
23 pop_and_accumulate(layer_bounds, nullptr);
24 }
25}

◆ restore() [2/2]

bool flutter::RectBoundsAccumulator::restore ( std::function< bool(const SkRect &, SkRect &)>  mapper,
const SkRect clip 
)
override

Definition at line 26 of file dl_bounds_accumulator.cc.

28 {
29 bool success = true;
30 if (!saved_rects_.empty()) {
31 SkRect layer_bounds = rect_.bounds();
32 success = mapper(layer_bounds, layer_bounds);
33 pop_and_accumulate(layer_bounds, clip);
34 }
35 return success;
36}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824

◆ rtree()

sk_sp< DlRTree > flutter::RectBoundsAccumulator::rtree ( ) const
inlineoverridevirtual

Implements flutter::BoundsAccumulator.

Definition at line 115 of file dl_bounds_accumulator.h.

115{ return nullptr; }

◆ save()

void flutter::RectBoundsAccumulator::save ( )
overridevirtual

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.

Implements flutter::BoundsAccumulator.

Definition at line 16 of file dl_bounds_accumulator.cc.

16 {
17 saved_rects_.emplace_back(rect_);
18 rect_ = AccumulationRect();
19}

◆ type()

BoundsAccumulatorType flutter::RectBoundsAccumulator::type ( ) const
inlineoverridevirtual

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