5#ifndef FLUTTER_DISPLAY_LIST_UTILS_DL_MATRIX_CLIP_TRACKER_H_
6#define FLUTTER_DISPLAY_LIST_UTILS_DL_MATRIX_CLIP_TRACKER_H_
10#include "flutter/display_list/dl_canvas.h"
11#include "flutter/fml/logging.h"
12#include "flutter/impeller/geometry/matrix.h"
13#include "flutter/impeller/geometry/rect.h"
34 return *
reinterpret_cast<const DlRect*
>(&rect);
42 0.0f, 0.0f, 1.0f, 0.0f,
50 matrix.getColMajor(dl_matrix.
m);
55 return *
reinterpret_cast<const SkRect*
>(&rect);
113 matrix_ = matrix_.
Scale({sx, sy, 1.0f});
129 mxx, myx, 0.0f, 0.0f,
130 mxy, myy, 0.0f, 0.0f,
131 0.0f, 0.0f, 1.0f, 0.0f,
159 *mapped = src.TransformAndClipBounds(matrix_);
164 *mapped = ToSkRect(ToDlRect(src).TransformAndClipBounds(matrix_));
168 void clipRect(
const DlRect& rect, ClipOp op,
bool is_aa);
170 clipRect(ToDlRect(rect), op, is_aa);
179 void adjustCullRect(
const DlRect&
clip, ClipOp op,
bool is_aa);
255 return saved_.size() - 1;
298 return current_->
mapRect(src, mapped);
302 return current_->
mapRect(src, mapped);
306 current_->
clipRect(rect, op, is_aa);
309 current_->
clipRect(rect, op, is_aa);
320 std::vector<DisplayListMatrixClipState> saved_;
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static SkM44 ColMajor(const SkScalar c[16])
static constexpr int kMScaleX
horizontal scale factor
static constexpr int kMTransY
vertical translation
static constexpr int kMPersp1
input y perspective factor
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
static constexpr int kMPersp0
input x perspective factor
static constexpr int kMPersp2
perspective bias
static constexpr int kMTransX
horizontal translation
static constexpr int kMSkewY
vertical skew factor
static constexpr int kMScaleY
vertical scale factor
static constexpr int kMSkewX
horizontal skew factor
bool mapRect(DlRect *rect) const
bool inverseTransform(const DisplayListMatrixClipState &other_tracker)
void resetLocalCullRect(const SkRect &cull_rect)
bool mapRect(const DlRect &src, DlRect *mapped) const
void scale(SkScalar sx, SkScalar sy)
bool using_4x4_matrix() const
bool has_perspective() const
void clipRRect(const SkRRect &rrect, ClipOp op, bool is_aa)
SkMatrix matrix_3x3() const
void clipRect(const DlRect &rect, ClipOp op, bool is_aa)
DisplayListMatrixClipState(const DisplayListMatrixClipState &other)=default
void setTransform(const SkM44 &m44)
const DlMatrix & matrix() const
void rotate(SkScalar degrees)
bool content_culled(const SkRect &content_bounds) const
void transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt)
SkRect device_cull_rect() const
bool is_matrix_invertable() const
bool mapRect(const SkRect &src, SkRect *mapped) const
void setTransform(const DlMatrix &matrix)
bool mapRect(SkRect *rect) const
void clipPath(const SkPath &path, ClipOp op, bool is_aa)
void resetLocalCullRect(const DlRect &cull_rect)
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt)
void transform(const SkMatrix &matrix)
void clipRect(const SkRect &rect, ClipOp op, bool is_aa)
void skew(SkScalar skx, SkScalar sky)
SkRect local_cull_rect() const
bool content_culled(const DlRect &content_bounds) const
void transform(const DlMatrix &matrix)
bool is_cull_rect_empty() const
void resetDeviceCullRect(const DlRect &cull_rect)
void setTransform(const SkMatrix &matrix)
void resetDeviceCullRect(const SkRect &cull_rect)
void translate(SkScalar tx, SkScalar ty)
void transform(const SkM44 &m44)
void clipRect(const DlRect &rect, ClipOp op, bool is_aa)
void scale(SkScalar sx, SkScalar sy)
void setTransform(const SkMatrix &matrix)
void setTransform(const SkM44 &m44)
bool using_4x4_matrix() const
SkRect local_cull_rect() const
bool inverseTransform(const DisplayListMatrixClipTracker &other_tracker)
SkRect device_cull_rect() const
static bool is_3x3(const SkM44 &m44)
void clipPath(const SkPath &path, ClipOp op, bool is_aa)
void resetLocalCullRect(const SkRect *cull_rect=nullptr)
void resetDeviceCullRect(const DlRect *cull_rect=nullptr)
void transform2DAffine(SkScalar mxx, SkScalar mxy, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myt)
bool mapRect(SkRect *rect) const
void transform(const DlMatrix &matrix)
void transform(const SkM44 &m44)
void clipRect(const SkRect &rect, ClipOp op, bool is_aa)
void resetLocalCullRect(const DlRect *cull_rect=nullptr)
void translate(SkScalar tx, SkScalar ty)
void clipRRect(const SkRRect &rrect, ClipOp op, bool is_aa)
void setTransform(const DlMatrix &matrix)
void transformFullPerspective(SkScalar mxx, SkScalar mxy, SkScalar mxz, SkScalar mxt, SkScalar myx, SkScalar myy, SkScalar myz, SkScalar myt, SkScalar mzx, SkScalar mzy, SkScalar mzz, SkScalar mzt, SkScalar mwx, SkScalar mwy, SkScalar mwz, SkScalar mwt)
void resetDeviceCullRect(const SkRect *cull_rect=nullptr)
bool mapRect(const DlRect &src, DlRect *mapped)
void skew(SkScalar skx, SkScalar sky)
bool is_cull_rect_empty() const
void restoreToCount(int restore_count)
SkMatrix matrix_3x3() const
SkRect base_device_cull_rect() const
void transform(const SkMatrix &matrix)
bool content_culled(const SkRect &content_bounds) const
bool mapRect(DlRect *rect) const
bool mapRect(const SkRect &src, SkRect *mapped)
void rotate(SkScalar degrees)
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
A 4x4 matrix using column-major storage.
constexpr bool IsAffine() const
constexpr Matrix Translate(const Vector3 &t) const
static constexpr Matrix MakeColumn(Scalar m0, Scalar m1, Scalar m2, Scalar m3, Scalar m4, Scalar m5, Scalar m6, Scalar m7, Scalar m8, Scalar m9, Scalar m10, Scalar m11, Scalar m12, Scalar m13, Scalar m14, Scalar m15)
static constexpr Matrix MakeSkew(Scalar sx, Scalar sy)
constexpr Matrix Scale(const Vector3 &s) const
static Matrix MakeRotationZ(Radians r)
Scalar GetDeterminant() const
constexpr bool HasPerspective() const
constexpr bool IsAligned2D(Scalar tolerance=0) const
constexpr bool IsEmpty() const
Returns true if either of the width or height are 0, negative, or NaN.