5#include "flutter/display_list/utils/dl_matrix_clip_tracker.h"
7#include "flutter/display_list/dl_builder.h"
8#include "flutter/fml/logging.h"
14 return ( m.rc(0, 2) == 0 &&
16 m.rc(2, 0) == 0 && m.rc(2, 1) == 0 && m.rc(2, 2) == 1 && m.rc(2, 3) == 0 &&
23 : cull_rect_(cull_rect), matrix_(matrix) {}
27 : cull_rect_(ToDlRect(cull_rect)), matrix_(ToDlMatrix(matrix)) {}
31 : cull_rect_(ToDlRect(cull_rect)), matrix_(ToDlMatrix(matrix)) {}
38 saved_.emplace_back(cull,
matrix);
39 current_ = &saved_.back();
48 saved_.emplace_back(cull,
matrix);
49 current_ = &saved_.back();
58 saved_.emplace_back(cull, m44);
59 current_ = &saved_.back();
64 saved_.emplace_back(*current_);
65 current_ = &saved_.back();
69 if (saved_.size() > 2) {
71 current_ = &saved_.back();
76 while (saved_.size() > 1) {
78 current_ = &saved_.back();
85 if (restore_count < 1) {
96 matrix_ = matrix_ * tracker.matrix_.
Invert();
105 adjustCullRect(rect, op, is_aa);
113 case ClipOp::kIntersect:
115 case ClipOp::kDifference:
121 adjustCullRect(ToDlRect(bounds), op, is_aa);
129 if (
path.isInverseFillType()) {
131 case ClipOp::kIntersect:
132 op = ClipOp::kDifference;
134 case ClipOp::kDifference:
135 op = ClipOp::kIntersect;
142 case ClipOp::kIntersect:
143 bounds =
path.getBounds();
145 case ClipOp::kDifference:
146 if (!
path.isRect(&bounds)) {
151 adjustCullRect(ToDlRect(bounds), op, is_aa);
155 const DlRect& content_bounds)
const {
166 mapRect(content_bounds, &mapped);
174 cull_rect_ = cull_rect;
180 mapRect(cull_rect, &cull_rect_);
188void DisplayListMatrixClipState::adjustCullRect(
const DlRect&
clip,
200 case ClipOp::kIntersect: {
201 if (
clip.IsEmpty()) {
202 cull_rect_ = DlRect();
210 cull_rect_ = cull_rect_.
Intersection(rect).value_or(DlRect());
213 case ClipOp::kDifference: {
214 if (
clip.IsEmpty()) {
222 if (
rect.IsEmpty()) {
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
const SkRect & getBounds() const
static constexpr SkRect kMaxCullRect
bool mapRect(DlRect *rect) const
bool inverseTransform(const DisplayListMatrixClipState &other_tracker)
bool has_perspective() const
void clipRRect(const SkRRect &rrect, ClipOp op, bool is_aa)
void clipRect(const DlRect &rect, ClipOp op, bool is_aa)
bool is_matrix_invertable() const
void clipPath(const SkPath &path, ClipOp op, bool is_aa)
void resetLocalCullRect(const DlRect &cull_rect)
SkRect local_cull_rect() const
bool content_culled(const DlRect &content_bounds) const
void resetDeviceCullRect(const DlRect &cull_rect)
DisplayListMatrixClipState(const DlRect &cull_rect, const DlMatrix &matrix)
static bool is_3x3(const SkM44 &m44)
DisplayListMatrixClipTracker(const DlRect &cull_rect, const DlMatrix &matrix)
void restoreToCount(int restore_count)
#define FML_DCHECK(condition)
sk_sp< SkBlender > blender SkRect rect
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 constexpr SkRect MakeEmpty()
A 4x4 matrix using column-major storage.
constexpr bool HasPerspective2D() const
constexpr bool HasPerspective() const
constexpr TRect TransformBounds(const Matrix &transform) const
Creates a new bounding box that contains this transformed rectangle.
constexpr std::optional< TRect > Intersection(const TRect &o) const
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.
constexpr bool IntersectsWithRect(const TRect &o) const
constexpr TRect CutoutOrEmpty(const TRect &o) const
Round(const TRect< U > &r)
RoundOut(const TRect< U > &r)