#include <dl_region.h>
Public Member Functions | |
| DlRegion ()=default | |
| Creates an empty region. | |
| DlRegion (const std::vector< DlIRect > &rects) | |
| DlRegion (const DlIRect &rect) | |
| Creates region covering area of a rectangle. | |
| DlRegion (const DlRegion &)=default | |
| DlRegion (DlRegion &&)=default | |
| DlRegion & | operator= (const DlRegion &)=default |
| DlRegion & | operator= (DlRegion &&)=default |
| std::vector< DlIRect > | getRects (bool deband=true) const |
| const DlIRect & | bounds () const |
| bool | intersects (const DlIRect &rect) const |
| Returns whether this region intersects with a rectangle. | |
| bool | intersects (const DlRegion ®ion) const |
| Returns whether this region intersects with another region. | |
| bool | isEmpty () const |
| Returns true if region is empty (contains no rectangles). | |
| bool | isComplex () const |
| Returns true if region is not empty and contains more than one rectangle. | |
| 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.
References impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), and impeller::TRect< T >::GetTop().
|
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.
Referenced by flutter::testing::CheckEquality().
| std::vector< DlIRect > flutter::DlRegion::getRects | ( | bool | deband = true | ) | const |
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 560 of file dl_region.cc.
References FML_DCHECK.
Referenced by flutter::testing::CheckEquality(), flutter::DlRTree::searchAndConsolidateRects(), flutter::RTree::searchNonOverlappingDrawnRects(), flutter::SliceViews(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().
| bool flutter::DlRegion::intersects | ( | const DlIRect & | rect | ) | const |
Returns whether this region intersects with a rectangle.
Definition at line 615 of file dl_region.cc.
References end, FML_DCHECK, impeller::TRect< T >::GetBottom(), impeller::TRect< T >::GetLeft(), impeller::TRect< T >::GetRight(), impeller::TRect< T >::GetTop(), and flutter::kBinarySearchThreshold.
Referenced by intersects(), and flutter::testing::TEST().
| bool flutter::DlRegion::intersects | ( | const DlRegion & | region | ) | const |
Returns whether this region intersects with another region.
Definition at line 704 of file dl_region.cc.
References FML_DCHECK, intersects(), isComplex(), and isEmpty().
| bool flutter::DlRegion::isComplex | ( | ) | const |
Returns true if region is not empty and contains more than one rectangle.
Definition at line 609 of file dl_region.cc.
Referenced by intersects(), and isSimple().
|
inline |
Returns true if region is empty (contains no rectangles).
Definition at line 62 of file dl_region.h.
Referenced by intersects(), MakeUnion(), and flutter::testing::TEST().
|
inline |
Returns true if region can be represented by single rectangle or is empty.
Definition at line 69 of file dl_region.h.
References isComplex().
Referenced by MakeIntersection(), and MakeUnion().
Creates intersection region of region a and b. Matches SkRegion a; a.op(b, SkRegion::kIntersect_Op) behavior.
Definition at line 496 of file dl_region.cc.
References impeller::TRect< T >::Contains(), FML_DCHECK, impeller::TRect< T >::Intersection(), impeller::TRect< T >::IntersectsWithRect(), isSimple(), flutter::size, and impeller::TRect< T >::Union().
Referenced by flutter::DlRTree::region(), flutter::EmbedderViewSlice::region(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().
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.
References impeller::TRect< T >::Contains(), FML_DCHECK, isEmpty(), isSimple(), flutter::size, and impeller::TRect< T >::Union().
Referenced by flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().