Flutter Engine
The Flutter Engine
|
#include <dl_region.h>
Public Member Functions | |
DlRegion ()=default | |
Creates an empty region. More... | |
DlRegion (const std::vector< SkIRect > &rects) | |
DlRegion (const SkIRect &rect) | |
Creates region covering area of a rectangle. More... | |
DlRegion (const DlRegion &)=default | |
DlRegion (DlRegion &&)=default | |
DlRegion & | operator= (const DlRegion &)=default |
DlRegion & | operator= (DlRegion &&)=default |
std::vector< SkIRect > | getRects (bool deband=true) const |
const SkIRect & | bounds () const |
bool | intersects (const SkIRect &rect) const |
Returns whether this region intersects with a rectangle. More... | |
bool | intersects (const DlRegion ®ion) const |
Returns whether this region intersects with another region. More... | |
bool | isEmpty () const |
Returns true if region is empty (contains no rectangles). More... | |
bool | isComplex () const |
Returns true if region is not empty and contains more than one rectangle. More... | |
bool | isSimple () const |
Static Public Member Functions | |
static DlRegion | MakeUnion (const DlRegion &a, const DlRegion &b) |
static DlRegion | MakeIntersection (const DlRegion &a, const DlRegion &b) |
Represents a region as a collection of non-overlapping rectangles. Implements a subset of SkRegion functionality optimized for quickly converting set of overlapping rectangles to non-overlapping rectangles.
Definition at line 18 of file dl_region.h.
|
default |
Creates an empty region.
|
explicit |
Creates region by bulk adding the rectangles. Matches SkRegion::op(rect, SkRegion::kUnion_Op) behavior.
Definition at line 97 of file dl_region.cc.
|
explicit |
Creates region covering area of a rectangle.
Definition at line 101 of file dl_region.cc.
|
default |
|
default |
|
inline |
Returns maximum and minimum axis values of rectangles in this region. If region is empty returns SKIRect::MakeEmpty().
Definition at line 53 of file dl_region.h.
Returns list of non-overlapping rectangles that cover current region. If |deband| is false, each span line will result in separate rectangles, closely matching SkRegion::Iterator behavior. If |deband| is true, matching rectangles from adjacent span lines will be merged into single rectangle.
Definition at line 563 of file dl_region.cc.
bool flutter::DlRegion::intersects | ( | const DlRegion & | region | ) | const |
Returns whether this region intersects with another region.
Definition at line 705 of file dl_region.cc.
bool flutter::DlRegion::intersects | ( | const SkIRect & | rect | ) | const |
Returns whether this region intersects with a rectangle.
Definition at line 617 of file dl_region.cc.
bool flutter::DlRegion::isComplex | ( | ) | const |
Returns true if region is not empty and contains more than one rectangle.
Definition at line 611 of file dl_region.cc.
|
inline |
Returns true if region is empty (contains no rectangles).
Definition at line 62 of file dl_region.h.
|
inline |
Returns true if region can be represented by single rectangle or is empty.
Definition at line 69 of file dl_region.h.
Creates intersection region of region a and b. Matches SkRegion a; a.op(b, SkRegion::kIntersect_Op) behavior.
Definition at line 497 of file dl_region.cc.
Creates union region of region a and b. Matches SkRegion a; a.op(b, SkRegion::kUnion_Op) behavior.
Definition at line 405 of file dl_region.cc.