22 : cull_rect_(
ProtectEmpty(cull_rect)), matrix_(matrix) {}
27 matrix_ = matrix_ * tracker.matrix_.
Invert();
36 auto dl_intersected = dl_mapped.
Intersection(cull_rect_);
37 if (dl_intersected.has_value()) {
38 *mapped = dl_intersected.value();
49 adjustCullRect(rect, op, is_aa);
61 adjustCullRect(bounds, op, is_aa);
72inline std::array<DlRect, 2> RoundingRadiiSafeRects(
97 adjustCullRect(bounds, op, is_aa);
104 auto safe_rects = RoundingRadiiSafeRects(bounds, rrect.
GetRadii());
105 adjustCullRect(safe_rects[0], op, is_aa);
106 adjustCullRect(safe_rects[1], op, is_aa);
125 adjustCullRect(bounds, op, is_aa);
132 auto safe_rects = RoundingRadiiSafeRects(bounds, rse.
GetRadii());
133 adjustCullRect(safe_rects[0], op, is_aa);
134 adjustCullRect(safe_rects[1], op, is_aa);
144 if (
path.IsRect(
nullptr)) {
149 adjustCullRect(bounds, op, is_aa);
157 const DlRect& content_bounds)
const {
168 mapRect(content_bounds, &mapped);
176 cull_rect_ = cull_rect;
182 mapRect(cull_rect, &cull_rect_);
190void DisplayListMatrixClipState::adjustCullRect(
const DlRect& clip,
224 if (rect.IsEmpty()) {
261 const DlRect& cull_bounds) {
275 if (!GetLocalCorners(corners, cull_bounds,
matrix)) {
278 for (
auto corner : corners) {
291 const DlRect& local_oval_bounds,
293 const DlRect& cull_bounds) {
294 if (local_oval_bounds.
IsEmpty()) {
301 if (!GetLocalCorners(corners, cull_bounds,
matrix)) {
306 for (
auto corner : corners) {
307 if (!local_oval_bounds.
Contains(corner)) {
310 if (((corner - center) *
scale).GetLengthSquared() >= 1.0) {
325 const DlRect& cull_bounds) {
332 if (local_rrect.
IsRect()) {
336 if (local_rrect.
IsOval()) {
344 if (!GetLocalCorners(corners, cull_bounds,
matrix)) {
348 auto center = outer.GetCenter();
350 auto inner = outer.GetSize() * 0.5 - radii;
351 auto scale = 1.0 / radii;
352 for (
auto corner : corners) {
353 if (!outer.Contains(corner)) {
356 auto rel = (corner - center).Abs() - inner;
357 if (rel.x > 0.0f && rel.y > 0.0f &&
358 (rel *
scale).GetLengthSquared() >= 1.0f) {
373 const DlRect& cull_bounds) {
389 if (!GetLocalCorners(corners, cull_bounds,
matrix)) {
395 for (
auto corner : corners) {
396 if (!outer.Contains(corner)) {
399 if (!param.Contains(corner)) {
406bool DisplayListMatrixClipState::GetLocalCorners(
DlPoint corners[4],
static constexpr DlRect kMaxCullRect
bool mapRect(DlRect *rect) const
static bool TransformedRectCoversBounds(const DlRect &local_rect, const DlMatrix &matrix, const DlRect &cull_bounds)
Checks if the local rect, when transformed by the matrix, completely covers the indicated culling bou...
bool inverseTransform(const DisplayListMatrixClipState &other_tracker)
bool has_perspective() const
void scale(DlScalar sx, DlScalar sy)
static bool TransformedRoundSuperellipseCoversBounds(const DlRoundSuperellipse &local_rse, const DlMatrix &matrix, const DlRect &cull_bounds)
Checks if the local round superellipse, when transformed by the matrix, completely covers the indicat...
bool rsuperellipse_covers_cull(const DlRoundSuperellipse &content) const
void clipRect(const DlRect &rect, DlClipOp op, bool is_aa)
const DlMatrix & matrix() const
bool rrect_covers_cull(const DlRoundRect &content) const
void clipRRect(const DlRoundRect &rrect, DlClipOp op, bool is_aa)
bool is_matrix_invertable() const
void clipRSuperellipse(const DlRoundSuperellipse &rse, DlClipOp op, bool is_aa)
void resetLocalCullRect(const DlRect &cull_rect)
static bool TransformedRRectCoversBounds(const DlRoundRect &local_rrect, const DlMatrix &matrix, const DlRect &cull_bounds)
Checks if the local round rect, when transformed by the matrix, completely covers the indicated culli...
bool content_culled(const DlRect &content_bounds) const
void clipPath(const DlPath &path, DlClipOp op, bool is_aa)
void resetDeviceCullRect(const DlRect &cull_rect)
bool mapAndClipRect(DlRect *rect) const
Maps the rect by the current matrix and then clips it against the current cull rect,...
bool oval_covers_cull(const DlRect &content_bounds) const
DlRect GetLocalCullCoverage() const
DisplayListMatrixClipState(const DlRect &cull_rect, const DlMatrix &matrix=DlMatrix())
bool rect_covers_cull(const DlRect &content) const
void clipOval(const DlRect &bounds, DlClipOp op, bool is_aa)
static bool TransformedOvalCoversBounds(const DlRect &local_oval_bounds, const DlMatrix &matrix, const DlRect &cull_bounds)
Checks if an oval defined by the local bounds, when transformed by the matrix, completely covers the ...
union flutter::testing::@2824::KeyboardChange::@78 content
static constexpr DlRect kEmpty
impeller::Matrix DlMatrix
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static const DlRect & ProtectEmpty(const DlRect &rect)
A 4x4 matrix using column-major storage.
bool IsInvertible() const
constexpr bool HasPerspective2D() const
constexpr bool HasPerspective() const
constexpr bool IsAligned2D(Scalar tolerance=0) const
constexpr bool IsEmpty() const
constexpr bool IsRect() const
constexpr const RoundingRadii & GetRadii() const
constexpr const Rect & GetBounds() const
constexpr bool IsOval() const
constexpr const Rect & GetBounds() const
constexpr bool IsOval() const
constexpr bool IsEmpty() const
constexpr bool IsRect() const
constexpr const RoundingRadii & GetRadii() const
static RoundSuperellipseParam MakeBoundsRadii(const Rect &bounds, const RoundingRadii &radii)
constexpr bool AreAllCornersSame(Scalar tolerance=kEhCloseEnough) const
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
constexpr bool ContainsInclusive(const TPoint< Type > &p) const
Returns true iff the provided point |p| is inside the closed-range interior of this rectangle.
constexpr std::optional< TRect > Intersection(const TRect &o) const
constexpr TSize< Type > GetSize() const
Returns the size of the rectangle which may be negative in either width or height and may have been c...
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
constexpr bool Contains(const TPoint< Type > &p) const
Returns true iff the provided point |p| is inside the half-open interior of this rectangle.
constexpr bool IntersectsWithRect(const TRect &o) const
constexpr TRect CutoutOrEmpty(const TRect &o) const
constexpr TPoint< T > GetLeftTop() const
Round(const TRect< U > &r)
RoundOut(const TRect< U > &r)
IsFinite() const
Returns true if all of the fields of this floating point rectangle are finite.
constexpr TRect TransformAndClipBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle, clipped against the near clippin...
constexpr TPoint< T > GetRightBottom() const
constexpr TPoint< T > GetLeftBottom() const
constexpr TPoint< T > GetRightTop() const
constexpr TRect< T > Expand(T left, T top, T right, T bottom) const
Returns a rectangle with expanded edges. Negative expansion results in shrinking.
constexpr Point GetCenter() const
Get the center point as a |Point|.