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 &&
51 matrix_ = matrix_ * tracker.matrix_.
Invert();
60 auto dl_intersected = dl_mapped.
Intersection(cull_rect_);
61 if (dl_intersected.has_value()) {
62 *mapped =
ToSkRect(dl_intersected.value());
72 if (
rect.IsFinite()) {
73 adjustCullRect(
rect, op, is_aa);
86 adjustCullRect(
bounds, op, is_aa);
98 -
std::max(upper_right.fX, lower_right.fX), 0);
99 adjustCullRect(safe, op, is_aa);
101 0, -
std::max(lower_left.fY, lower_right.fY));
102 adjustCullRect(safe, op, is_aa);
113 if (
path.isInverseFillType()) {
125 if (
path.isRect(
nullptr)) {
130 adjustCullRect(
bounds, op, is_aa);
138 const DlRect& content_bounds)
const {
149 mapRect(content_bounds, &mapped);
157 cull_rect_ = cull_rect;
163 mapRect(cull_rect, &cull_rect_);
171void DisplayListMatrixClipState::adjustCullRect(
const DlRect&
clip,
184 if (
clip.IsEmpty()) {
197 if (
clip.IsEmpty()) {
205 if (
rect.IsEmpty()) {
246 return content.TransformAndClipBounds(matrix_).Contains(cull_rect_);
249 if (!getLocalCullCorners(corners)) {
252 for (
auto corner : corners) {
253 if (!
content.ContainsInclusive(corner)) {
268 if (!getLocalCullCorners(corners)) {
273 for (
auto corner : corners) {
274 if (!
bounds.Contains(corner)) {
277 if (((corner - center) *
scale).GetLengthSquared() >= 1.0) {
302 if (!getLocalCullCorners(corners)) {
305 auto outer =
content.getBounds();
306 DlScalar x_center = outer.centerX();
307 DlScalar y_center = outer.centerY();
308 auto radii =
content.getSimpleRadii();
309 DlScalar inner_x = outer.width() * 0.5f - radii.fX;
310 DlScalar inner_y = outer.height() * 0.5f - radii.fY;
313 for (
auto corner : corners) {
314 if (!outer.contains(corner.x, corner.y)) {
319 if (x_rel > 0.0f && y_rel > 0.0f) {
322 if (x_rel * x_rel + y_rel * y_rel >= 1.0f) {
330bool DisplayListMatrixClipState::getLocalCullCorners(
DlPoint corners[4])
const {
335 corners[0] = inverse * cull_rect_.
GetLeftTop();
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
SkVector radii(Corner corner) const
@ kUpperLeft_Corner
index of top-left corner radii
@ kLowerRight_Corner
index of bottom-right corner radii
@ kUpperRight_Corner
index of top-right corner radii
@ kLowerLeft_Corner
index of bottom-left corner radii
const SkRect & getBounds() const
static constexpr SkRect kMaxCullRect
bool mapAndClipRect(SkRect *rect) const
Maps the rect by the current matrix and then clips it against the current cull rect,...
bool mapRect(DlRect *rect) const
bool inverseTransform(const DisplayListMatrixClipState &other_tracker)
void scale(SkScalar sx, SkScalar sy)
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)
bool oval_covers_cull(const DlRect &content_bounds) const
static bool is_3x3(const SkM44 &m44)
DisplayListMatrixClipState(const DlRect &cull_rect, const DlMatrix &matrix=DlMatrix())
bool rect_covers_cull(const DlRect &content) const
bool rrect_covers_cull(const SkRRect &content) const
static float max(float r, float g, float b)
union flutter::testing::@2836::KeyboardChange::@76 content
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
sk_sp< SkBlender > blender SkRect rect
impeller::Scalar DlScalar
static constexpr DlRect kEmpty
constexpr DlMatrix ToDlMatrix(const SkMatrix &matrix)
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 SkRect &rect)
const DlRect & ToDlRect(const SkRect &rect)
const SkRect & ToSkRect(const DlRect &rect)
SIN Vec< N, float > abs(const Vec< N, float > &x)
static constexpr SkRect MakeEmpty()
A 4x4 matrix using column-major storage.
constexpr bool HasPerspective2D() const
constexpr bool HasPerspective() const
constexpr bool IsAligned2D(Scalar tolerance=0) 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
constexpr TPoint< T > GetLeftTop() const
Round(const TRect< U > &r)
RoundOut(const TRect< U > &r)
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