#include <SkMatrixPriv.h>
|
static size_t | WriteToMemory (const SkMatrix &matrix, void *buffer) |
|
static size_t | ReadFromMemory (SkMatrix *matrix, const void *buffer, size_t length) |
|
static MapPtsProc | GetMapPtsProc (const SkMatrix &matrix) |
|
static MapXYProc | GetMapXYProc (const SkMatrix &matrix) |
|
static bool | InverseMapRect (const SkMatrix &mx, SkRect *dst, const SkRect &src) |
|
static void | MapPointsWithStride (const SkMatrix &mx, SkPoint pts[], size_t stride, int count) |
|
static void | MapPointsWithStride (const SkMatrix &mx, SkPoint dst[], size_t dstStride, const SkPoint src[], size_t srcStride, int count) |
|
static void | MapHomogeneousPointsWithStride (const SkMatrix &mx, SkPoint3 dst[], size_t dstStride, const SkPoint3 src[], size_t srcStride, int count) |
|
static bool | PostIDiv (SkMatrix *matrix, int divx, int divy) |
|
static bool | CheapEqual (const SkMatrix &a, const SkMatrix &b) |
|
static const SkScalar * | M44ColMajor (const SkM44 &m) |
|
static bool | IsScaleTranslateAsM33 (const SkM44 &m) |
|
static SkRect | MapRect (const SkM44 &m, const SkRect &r) |
|
static SkScalar | DifferentialAreaScale (const SkMatrix &m, const SkPoint &p) |
|
static bool | NearlyAffine (const SkMatrix &m, const SkRect &bounds, SkScalar tolerance=SK_ScalarNearlyZero) |
|
static SkScalar | ComputeResScaleForStroking (const SkMatrix &matrix) |
|
Definition at line 23 of file SkMatrixPriv.h.
◆ MapPtsProc
◆ MapXYProc
◆ anonymous enum
◆ CheapEqual()
Definition at line 181 of file SkMatrixPriv.h.
181 {
182 return &
a == &
b || 0 == memcmp(
a.fMat,
b.fMat,
sizeof(
a.fMat));
183 }
◆ ComputeResScaleForStroking()
Definition at line 1877 of file SkMatrix.cpp.
1877 {
1878
1885 }
1886 }
1887 return 1;
1888}
static bool SkIsFinite(T x, Pack... values)
static constexpr int kMScaleX
horizontal scale factor
static constexpr int kMSkewY
vertical skew factor
static constexpr int kMScaleY
vertical scale factor
static constexpr int kMSkewX
horizontal skew factor
static float max(float r, float g, float b)
unsigned useCenter Optional< SkMatrix > matrix
static float Length(float x, float y)
◆ DifferentialAreaScale()
Definition at line 1786 of file SkMatrix.cpp.
1786 {
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1805 m.mapHomogeneousPoints(&xyw, &
p, 1);
1806
1808
1810 }
1812 m.getScaleX(),
m.getSkewY(),
m.getPerspX(),
1813 m.getSkewX(),
m.getScaleY(),
m.getPerspY());
1814
1815 double denom = 1.0 / xyw.
fZ;
1816 denom = denom * denom * denom;
1818}
static double sk_determinant(const float mat[9], int isPerspective)
#define SkDoubleToScalar(x)
#define SK_ScalarNearlyZero
#define SK_ScalarInfinity
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
◆ GetMapPtsProc()
◆ GetMapXYProc()
◆ InverseMapRect()
Attempt to map the rect through the inverse of the matrix. If it is not invertible, then this returns false and dst is unchanged.
Definition at line 54 of file SkMatrixPriv.h.
54 {
56
58 return false;
59 }
60
63
64
65
68
73 if (sx < 0.f && sy < 0.f) {
74 inverted = skvx::shuffle<2, 3, 0, 1>(inverted);
75 } else if (sx < 0.f) {
76 inverted = skvx::shuffle<2, 1, 0, 3>(inverted);
77 } else if (sy < 0.f) {
78 inverted = skvx::shuffle<0, 3, 2, 1>(inverted);
79 }
80 }
81 inverted.store(&
dst->fLeft);
82 return true;
83 }
84
85
89 return true;
90 }
91 return false;
92 }
SkScalar getTranslateY() const
bool invert(SkMatrix *inverse) const
SkScalar getScaleX() const
SkScalar getScaleY() const
bool isScaleTranslate() const
bool mapRect(SkRect *dst, const SkRect &src, SkApplyPerspectiveClip pc=SkApplyPerspectiveClip::kYes) const
SkScalar getTranslateX() const
@ kTranslate_Mask
translation SkMatrix
static SKVX_ALWAYS_INLINE Vec Load(const void *ptr)
◆ IsScaleTranslateAsM33()
static bool SkMatrixPriv::IsScaleTranslateAsM33 |
( |
const SkM44 & |
m | ) |
|
|
inlinestatic |
Definition at line 190 of file SkMatrixPriv.h.
190 {
191 return m.rc(1,0) == 0 &&
m.rc(3,0) == 0 &&
192 m.rc(0,1) == 0 &&
m.rc(3,1) == 0 &&
194
195 }
◆ M44ColMajor()
static const SkScalar * SkMatrixPriv::M44ColMajor |
( |
const SkM44 & |
m | ) |
|
|
inlinestatic |
◆ MapHomogeneousPointsWithStride()
void SkMatrixPriv::MapHomogeneousPointsWithStride |
( |
const SkMatrix & |
mx, |
|
|
SkPoint3 |
dst[], |
|
|
size_t |
dstStride, |
|
|
const SkPoint3 |
src[], |
|
|
size_t |
srcStride, |
|
|
int |
count |
|
) |
| |
|
static |
Definition at line 1026 of file SkMatrix.cpp.
1028 {
1030
1032
1038 } else {
1041 dst =
reinterpret_cast<SkPoint3*
>(
reinterpret_cast<char*
>(
dst) + dstStride);
1042 src =
reinterpret_cast<const SkPoint3*
>(
reinterpret_cast<const char*
>(
src) +
1043 srcStride);
1044 }
1045 }
1046 }
1047 return;
1048 }
1049 do {
1053 src =
reinterpret_cast<const SkPoint3*
>(
reinterpret_cast<const char*
>(
src) + srcStride);
1056 SkScalar x =
sdot(sx, mat[M::kMScaleX], sy, mat[M::kMSkewX], sw, mat[M::kMTransX]);
1057 SkScalar y =
sdot(sx, mat[M::kMSkewY], sy, mat[M::kMScaleY], sw, mat[M::kMTransY]);
1058 SkScalar w =
sdot(sx, mat[M::kMPersp0], sy, mat[M::kMPersp1], sw, mat[M::kMPersp2]);
1059
1061 dst =
reinterpret_cast<SkPoint3*
>(
reinterpret_cast<char*
>(
dst) + dstStride);
1063 }
1064}
static SkScalar sdot(SkScalar a, SkScalar b, SkScalar c, SkScalar d)
◆ MapPointsWithStride() [1/2]
static void SkMatrixPriv::MapPointsWithStride |
( |
const SkMatrix & |
mx, |
|
|
SkPoint |
dst[], |
|
|
size_t |
dstStride, |
|
|
const SkPoint |
src[], |
|
|
size_t |
srcStride, |
|
|
int |
count |
|
) |
| |
|
inlinestatic |
Maps src SkPoint array of length count to dst SkPoint array, skipping stride bytes to advance from one SkPoint to the next. Points are mapped by multiplying each SkPoint by SkMatrix. Given:
| A B C | | x |
Matrix = | D E F |, src = | y |
| G H I | | 1 |
each resulting dst SkPoint is computed as:
|A B C| |x| Ax+By+C Dx+Ey+F
Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
- Parameters
-
mx | matrix used to map the points |
dst | storage for mapped points |
src | points to transform |
stride | size of record starting with SkPoint, in bytes |
count | number of points to transform |
Definition at line 161 of file SkMatrixPriv.h.
162 {
171 }
172 }
void mapPoints(SkPoint dst[], const SkPoint src[], int count) const
◆ MapPointsWithStride() [2/2]
static void SkMatrixPriv::MapPointsWithStride |
( |
const SkMatrix & |
mx, |
|
|
SkPoint |
pts[], |
|
|
size_t |
stride, |
|
|
int |
count |
|
) |
| |
|
inlinestatic |
Maps count pts, skipping stride bytes to advance from one SkPoint to the next. Points are mapped by multiplying each SkPoint by SkMatrix. Given:
| A B C | | x |
Matrix = | D E F |, pt = | y |
| G H I | | 1 |
each resulting pts SkPoint is computed as:
|A B C| |x| Ax+By+C Dx+Ey+F
Matrix * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+I| = ------- , -------
|G H I| |1| Gx+Hy+I Gx+Hy+I
- Parameters
-
mx | matrix used to map the points |
pts | storage for mapped points |
stride | size of record starting with SkPoint, in bytes |
count | number of points to transform |
Definition at line 112 of file SkMatrixPriv.h.
112 {
115
117
119 return;
120 }
127 pts = (
SkPoint*)((intptr_t)pts + stride);
128 }
129 return;
130 }
131
132
133
134 SkMatrix::MapXYProc proc = mx.getMapXYProc();
136 proc(mx, pts->
fX, pts->
fY, pts);
137 pts = (
SkPoint*)((intptr_t)pts + stride);
138 }
139 }
@ kIdentity_Mask
identity SkMatrix; all bits clear
◆ MapRect()
Definition at line 216 of file SkM44.cpp.
216 {
217 const bool hasPerspective =
218 m.fMat[3] != 0 ||
m.fMat[7] != 0 ||
m.fMat[11] != 0 ||
m.fMat[15] != 1;
219 if (hasPerspective) {
221 } else {
223 }
224}
static SkRect map_rect_affine(const SkRect &src, const float mat[16])
static SkRect map_rect_perspective(const SkRect &src, const float mat[16])
◆ NearlyAffine()
Definition at line 1820 of file SkMatrix.cpp.
1822 {
1823 if (!
m.hasPerspective()) {
1824 return true;
1825 }
1826
1827
1828
1829
1830
1831
1835 m.mapHomogeneousPoints(xyw, quad, 4);
1836
1837
1838
1839 SkPoint3 v1{
m.getScaleX(),
m.getSkewY(),
m.getPerspX()};
1842
1843
1845
1846 return false;
1847 }
1848
1849
1850
1851 double det = detCrossProd.
dot(xyw[0]);
1852
1853 double denom = 1.0 / xyw[0].
fZ;
1854 denom = denom * denom * denom;
1856
1857
1858 tolerance *= tolerance;
1859 for (
int i = 1;
i < 4; ++
i) {
1861
1862 return false;
1863 }
1864
1865 det = detCrossProd.
dot(xyw[
i]);
1866 denom = 1.0 / xyw[
i].
fZ;
1867 denom = denom * denom * denom;
1870 return false;
1871 }
1872 }
1873
1874 return true;
1875}
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
Optional< SkRect > bounds
SkPoint3 cross(const SkPoint3 &vec) const
SkScalar dot(const SkPoint3 &vec) const
◆ PostIDiv()
static bool SkMatrixPriv::PostIDiv |
( |
SkMatrix * |
matrix, |
|
|
int |
divx, |
|
|
int |
divy |
|
) |
| |
|
inlinestatic |
◆ ReadFromMemory()
static size_t SkMatrixPriv::ReadFromMemory |
( |
SkMatrix * |
matrix, |
|
|
const void * |
buffer, |
|
|
size_t |
length |
|
) |
| |
|
inlinestatic |
Definition at line 34 of file SkMatrixPriv.h.
34 {
36 }
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
◆ WriteToMemory()
static size_t SkMatrixPriv::WriteToMemory |
( |
const SkMatrix & |
matrix, |
|
|
void * |
buffer |
|
) |
| |
|
inlinestatic |
The documentation for this class was generated from the following files: