31 const V4f t{
m.getTranslateX(),
m.getTranslateY(),
m.getTranslateX(),
m.getTranslateY()};
35 const V4f s{
m.getScaleX(),
m.getScaleY(),
m.getScaleX(),
m.getScaleY()};
39 *xs = skvx::shuffle<0, 0, 2, 2>(r);
40 *ys = skvx::shuffle<1, 3, 1, 3>(r);
45 *xs =
m.getScaleX() * qx + (
m.getSkewX() * qy +
m.getTranslateX());
46 *ys =
m.getSkewY() * qx + (
m.getScaleY() * qy +
m.getTranslateY());
47 if (
m.hasPerspective()) {
73 *xs =
V4f{skQuadPts[0].
fX, skQuadPts[3].
fX, skQuadPts[1].
fX, skQuadPts[2].
fX};
74 *ys =
V4f{skQuadPts[0].
fY, skQuadPts[3].
fY, skQuadPts[1].
fY, skQuadPts[2].
fY};
79 if (
matrix.rectStaysRect()) {
81 }
else if (
matrix.preservesRightAngles()) {
83 }
else if (
matrix.hasPerspective()) {
93 if (
matrix.hasPerspective()) {
99 if ((pts[0].fX == pts[3].fX && pts[1].fX == pts[2].fX) &&
100 (pts[0].fY == pts[1].fY && pts[2].fY == pts[3].fY)) {
126 if (
matrix.isIdentity()) {
149 return fX[0] ==
rect->fLeft && fY[0] ==
rect->fTop;
static void map_rect_general(const SkRect &rect, const SkMatrix &matrix, V4f *xs, V4f *ys, V4f *ws)
static void map_quad_general(const V4f &qx, const V4f &qy, const SkMatrix &m, V4f *xs, V4f *ys, V4f *ws)
static GrQuad::Type quad_type_for_transformed_rect(const SkMatrix &matrix)
static void map_rect_translate_scale(const SkRect &rect, const SkMatrix &m, V4f *xs, V4f *ys)
static void rearrange_sk_to_gr_points(const SkPoint skQuadPts[4], V4f *xs, V4f *ys)
static bool aa_affects_rect(GrQuadAAFlags edgeFlags, float ql, float qt, float qr, float qb)
static GrQuad::Type quad_type_for_points(const SkPoint pts[4], const SkMatrix &matrix)
static bool SkScalarIsInt(SkScalar x)
static GrQuad MakeFromRect(const SkRect &, const SkMatrix &)
bool aaHasEffectOnRect(GrQuadAAFlags edgeFlags) const
bool asRect(SkRect *rect) const
static GrQuad MakeFromSkQuad(const SkPoint pts[4], const SkMatrix &)
static constexpr int kMPersp2
perspective bias
@ kTranslate_Mask
translation SkMatrix
@ kScale_Mask
scale SkMatrix
@ kIdentity_Mask
identity SkMatrix; all bits clear
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
static SKVX_ALWAYS_INLINE Vec Load(const void *ptr)