Go to the source code of this file.
|
static bool | aa_affects_rect (GrQuadAAFlags edgeFlags, float ql, float qt, float qr, float qb) |
|
static void | map_rect_translate_scale (const SkRect &rect, const SkMatrix &m, V4f *xs, V4f *ys) |
|
static void | map_quad_general (const V4f &qx, const V4f &qy, const SkMatrix &m, V4f *xs, V4f *ys, V4f *ws) |
|
static void | map_rect_general (const SkRect &rect, const SkMatrix &matrix, V4f *xs, V4f *ys, V4f *ws) |
|
static void | rearrange_sk_to_gr_points (const SkPoint skQuadPts[4], V4f *xs, V4f *ys) |
|
static GrQuad::Type | quad_type_for_transformed_rect (const SkMatrix &matrix) |
|
static GrQuad::Type | quad_type_for_points (const SkPoint pts[4], const SkMatrix &matrix) |
|
◆ V4f
◆ aa_affects_rect()
static bool aa_affects_rect |
( |
GrQuadAAFlags |
edgeFlags, |
|
|
float |
ql, |
|
|
float |
qt, |
|
|
float |
qr, |
|
|
float |
qb |
|
) |
| |
|
static |
Definition at line 15 of file GrQuad.cpp.
15 {
16
17
22}
static bool SkScalarIsInt(SkScalar x)
◆ map_quad_general()
Definition at line 43 of file GrQuad.cpp.
44 {
45 *xs =
m.getScaleX() * qx + (
m.getSkewX() * qy +
m.getTranslateX());
46 *ys =
m.getSkewY() * qx + (
m.getScaleY() * qy +
m.getTranslateY());
47 if (
m.hasPerspective()) {
49 if (ws) {
50
52 } else {
53
55 *xs *= iw;
56 *ys *= iw;
57 }
58 } else if (ws) {
59 *ws = 1.f;
60 }
61}
static constexpr int kMPersp2
perspective bias
◆ map_rect_general()
Definition at line 63 of file GrQuad.cpp.
64 {
68}
static void map_quad_general(const V4f &qx, const V4f &qy, const SkMatrix &m, V4f *xs, V4f *ys, V4f *ws)
unsigned useCenter Optional< SkMatrix > matrix
sk_sp< SkBlender > blender SkRect rect
◆ map_rect_translate_scale()
static void map_rect_translate_scale |
( |
const SkRect & |
rect, |
|
|
const SkMatrix & |
m, |
|
|
V4f * |
xs, |
|
|
V4f * |
ys |
|
) |
| |
|
static |
Definition at line 24 of file GrQuad.cpp.
25 {
28
31 const V4f t{
m.getTranslateX(),
m.getTranslateY(),
m.getTranslateX(),
m.getTranslateY()};
33 r += t;
34 } else {
35 const V4f s{
m.getScaleX(),
m.getScaleY(),
m.getScaleX(),
m.getScaleY()};
37 }
38 }
39 *xs = skvx::shuffle<0, 0, 2, 2>(r);
40 *ys = skvx::shuffle<1, 3, 1, 3>(r);
41}
@ kTranslate_Mask
translation SkMatrix
@ kScale_Mask
scale SkMatrix
@ kIdentity_Mask
identity SkMatrix; all bits clear
static SKVX_ALWAYS_INLINE Vec Load(const void *ptr)
◆ quad_type_for_points()
Definition at line 92 of file GrQuad.cpp.
92 {
93 if (
matrix.hasPerspective()) {
95 }
96
97
98
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)) {
102 } else {
104 }
105}
static GrQuad::Type quad_type_for_transformed_rect(const SkMatrix &matrix)
◆ quad_type_for_transformed_rect()
Definition at line 78 of file GrQuad.cpp.
78 {
79 if (
matrix.rectStaysRect()) {
81 }
else if (
matrix.preservesRightAngles()) {
83 }
else if (
matrix.hasPerspective()) {
85 } else {
87 }
88}
◆ rearrange_sk_to_gr_points()
static void rearrange_sk_to_gr_points |
( |
const SkPoint |
skQuadPts[4], |
|
|
V4f * |
xs, |
|
|
V4f * |
ys |
|
) |
| |
|
static |
Definition at line 72 of file GrQuad.cpp.
72 {
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};
75}