• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1SkMatrix Reference
2===
3
4
5<a name='SkMatrix'></a>
6
7---
8
9<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
10class <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> {
11
12    static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy);
13    static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> scale);
14    static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeTrans'>MakeTrans</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
15    static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeAll'>MakeAll</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleX, <a href='undocumented#SkScalar'>SkScalar</a> skewX, <a href='undocumented#SkScalar'>SkScalar</a> transX,
16                            <a href='undocumented#SkScalar'>SkScalar</a> skewY, <a href='undocumented#SkScalar'>SkScalar</a> scaleY, <a href='undocumented#SkScalar'>SkScalar</a> transY,
17                            <a href='undocumented#SkScalar'>SkScalar</a> pers0, <a href='undocumented#SkScalar'>SkScalar</a> pers1, <a href='undocumented#SkScalar'>SkScalar</a> pers2);
18
19    enum <a href='#SkMatrix_TypeMask'>TypeMask</a> {
20        <a href='#SkMatrix_kIdentity_Mask'>kIdentity_Mask</a> = 0,
21        <a href='#SkMatrix_kTranslate_Mask'>kTranslate_Mask</a> = 0x01,
22        <a href='#SkMatrix_kScale_Mask'>kScale_Mask</a> = 0x02,
23        <a href='#SkMatrix_kAffine_Mask'>kAffine_Mask</a> = 0x04,
24        <a href='#SkMatrix_kPerspective_Mask'>kPerspective_Mask</a> = 0x08,
25    };
26
27    <a href='#SkMatrix_TypeMask'>TypeMask</a> <a href='#SkMatrix_getType'>getType</a>() const;
28    bool <a href='#SkMatrix_isIdentity'>isIdentity</a>() const;
29    bool <a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a>() const;
30    bool <a href='#SkMatrix_isTranslate'>isTranslate</a>() const;
31    bool <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>() const;
32    bool <a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a>() const;
33    bool <a href='#SkMatrix_hasPerspective'>hasPerspective</a>() const;
34    bool <a href='#SkMatrix_isSimilarity'>isSimilarity</a>(<a href='undocumented#SkScalar'>SkScalar</a> tol = <a href='undocumented#SK_ScalarNearlyZero'>SK_ScalarNearlyZero</a>) const;
35    bool <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a>(<a href='undocumented#SkScalar'>SkScalar</a> tol = <a href='undocumented#SK_ScalarNearlyZero'>SK_ScalarNearlyZero</a>) const;
36
37    static constexpr int <a href='#SkMatrix_kMScaleX'>kMScaleX</a> = 0    static constexpr int <a href='#SkMatrix_kMSkewX'>kMSkewX</a> = 1    static constexpr int <a href='#SkMatrix_kMTransX'>kMTransX</a> = 2    static constexpr int <a href='#SkMatrix_kMSkewY'>kMSkewY</a> = 3    static constexpr int <a href='#SkMatrix_kMScaleY'>kMScaleY</a> = 4    static constexpr int <a href='#SkMatrix_kMTransY'>kMTransY</a> = 5    static constexpr int <a href='#SkMatrix_kMPersp0'>kMPersp0</a> = 6    static constexpr int <a href='#SkMatrix_kMPersp1'>kMPersp1</a> = 7    static constexpr int <a href='#SkMatrix_kMPersp2'>kMPersp2</a> = 8    static constexpr int <a href='#SkMatrix_kAScaleX'>kAScaleX</a> = 0    static constexpr int <a href='#SkMatrix_kASkewY'>kASkewY</a> = 1    static constexpr int <a href='#SkMatrix_kASkewX'>kASkewX</a> = 2    static constexpr int <a href='#SkMatrix_kAScaleY'>kAScaleY</a> = 3    static constexpr int <a href='#SkMatrix_kATransX'>kATransX</a> = 4    static constexpr int <a href='#SkMatrix_kATransY'>kATransY</a> = 5
38    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_array_operator'>operator[]</a>(int index) const;
39    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_get'>get</a>(int index) const;
40    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getScaleX'>getScaleX</a>() const;
41    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getScaleY'>getScaleY</a>() const;
42    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getSkewY'>getSkewY</a>() const;
43    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getSkewX'>getSkewX</a>() const;
44    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getTranslateX'>getTranslateX</a>() const;
45    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getTranslateY'>getTranslateY</a>() const;
46    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getPerspX'>getPerspX</a>() const;
47    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getPerspY'>getPerspY</a>() const;
48    <a href='undocumented#SkScalar'>SkScalar</a>& <a href='#SkMatrix_array1_operator'>operator[]</a>(int index);
49    void <a href='#SkMatrix_set'>set</a>(int index, <a href='undocumented#SkScalar'>SkScalar</a> value);
50    void <a href='#SkMatrix_setScaleX'>setScaleX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
51    void <a href='#SkMatrix_setScaleY'>setScaleY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
52    void <a href='#SkMatrix_setSkewY'>setSkewY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
53    void <a href='#SkMatrix_setSkewX'>setSkewX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
54    void <a href='#SkMatrix_setTranslateX'>setTranslateX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
55    void <a href='#SkMatrix_setTranslateY'>setTranslateY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
56    void <a href='#SkMatrix_setPerspX'>setPerspX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
57    void <a href='#SkMatrix_setPerspY'>setPerspY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v);
58    void <a href='#SkMatrix_setAll'>setAll</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleX, <a href='undocumented#SkScalar'>SkScalar</a> skewX, <a href='undocumented#SkScalar'>SkScalar</a> transX,
59                <a href='undocumented#SkScalar'>SkScalar</a> skewY, <a href='undocumented#SkScalar'>SkScalar</a> scaleY, <a href='undocumented#SkScalar'>SkScalar</a> transY,
60                <a href='undocumented#SkScalar'>SkScalar</a> persp0, <a href='undocumented#SkScalar'>SkScalar</a> persp1, <a href='undocumented#SkScalar'>SkScalar</a> persp2);
61    void <a href='#SkMatrix_get9'>get9</a>(<a href='undocumented#SkScalar'>SkScalar</a> buffer[9]) const;
62    void <a href='#SkMatrix_set9'>set9</a>(const <a href='undocumented#SkScalar'>SkScalar</a> buffer[9]);
63    void <a href='#SkMatrix_reset'>reset()</a>;
64    void <a href='#SkMatrix_setIdentity'>setIdentity</a>();
65    void <a href='#SkMatrix_setTranslate'>setTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
66    void <a href='#SkMatrix_setTranslate'>setTranslate</a>(const <a href='SkPoint_Reference#SkVector'>SkVector</a>& v);
67    void <a href='#SkMatrix_setScale'>setScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
68    void <a href='#SkMatrix_setScale'>setScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy);
69    void <a href='#SkMatrix_setRotate'>setRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
70    void <a href='#SkMatrix_setRotate'>setRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees);
71    void <a href='#SkMatrix_setSinCos'>setSinCos</a>(<a href='undocumented#SkScalar'>SkScalar</a> sinValue, <a href='undocumented#SkScalar'>SkScalar</a> cosValue,
72                   <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
73    void <a href='#SkMatrix_setSinCos'>setSinCos</a>(<a href='undocumented#SkScalar'>SkScalar</a> sinValue, <a href='undocumented#SkScalar'>SkScalar</a> cosValue);
74    <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_setRSXform'>setRSXform</a>(const <a href='undocumented#SkRSXform'>SkRSXform</a>& rsxForm);
75    void <a href='#SkMatrix_setSkew'>setSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
76    void <a href='#SkMatrix_setSkew'>setSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky);
77    void <a href='#SkMatrix_setConcat'>setConcat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b);
78    void <a href='#SkMatrix_preTranslate'>preTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
79    void <a href='#SkMatrix_preScale'>preScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
80    void <a href='#SkMatrix_preScale'>preScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy);
81    void <a href='#SkMatrix_preRotate'>preRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
82    void <a href='#SkMatrix_preRotate'>preRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees);
83    void <a href='#SkMatrix_preSkew'>preSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
84    void <a href='#SkMatrix_preSkew'>preSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky);
85    void <a href='#SkMatrix_preConcat'>preConcat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& other);
86    void <a href='#SkMatrix_postTranslate'>postTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy);
87    void <a href='#SkMatrix_postScale'>postScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
88    void <a href='#SkMatrix_postScale'>postScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy);
89    bool <a href='#SkMatrix_postIDiv'>postIDiv</a>(int divx, int divy);
90    void <a href='#SkMatrix_postRotate'>postRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
91    void <a href='#SkMatrix_postRotate'>postRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees);
92    void <a href='#SkMatrix_postSkew'>postSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py);
93    void <a href='#SkMatrix_postSkew'>postSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky);
94    void <a href='#SkMatrix_postConcat'>postConcat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& other);
95
96    enum <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> {
97        <a href='#SkMatrix_kFill_ScaleToFit'>kFill_ScaleToFit</a>,
98        <a href='#SkMatrix_kStart_ScaleToFit'>kStart_ScaleToFit</a>,
99        <a href='#SkMatrix_kCenter_ScaleToFit'>kCenter_ScaleToFit</a>,
100        <a href='#SkMatrix_kEnd_ScaleToFit'>kEnd_ScaleToFit</a>,
101    };
102
103    bool <a href='#SkMatrix_setRectToRect'>setRectToRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> stf);
104    static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> stf);
105    bool <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> src[], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[], int count);
106    bool <a href='#SkMatrix_invert'>invert</a>(<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* inverse) const;
107    static void <a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a>(<a href='undocumented#SkScalar'>SkScalar</a> affine[6]);
108    bool <a href='#SkMatrix_asAffine'>asAffine</a>(<a href='undocumented#SkScalar'>SkScalar</a> affine[6]) const;
109    void <a href='#SkMatrix_setAffine'>setAffine</a>(const <a href='undocumented#SkScalar'>SkScalar</a> affine[6]);
110    void <a href='#SkMatrix_mapPoints'>mapPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> src[], int count) const;
111    void <a href='#SkMatrix_mapPoints'>mapPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count) const;
112    void <a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a>(<a href='undocumented#SkPoint3'>SkPoint3</a> dst[], const <a href='undocumented#SkPoint3'>SkPoint3</a> src[], int count) const;
113    void <a href='#SkMatrix_mapXY'>mapXY</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>* result) const;
114    <a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkMatrix_mapXY'>mapXY</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y) const;
115    void <a href='#SkMatrix_mapVectors'>mapVectors</a>(<a href='SkPoint_Reference#SkVector'>SkVector</a> dst[], const <a href='SkPoint_Reference#SkVector'>SkVector</a> src[], int count) const;
116    void <a href='#SkMatrix_mapVectors'>mapVectors</a>(<a href='SkPoint_Reference#SkVector'>SkVector</a> vecs[], int count) const;
117    void <a href='#SkMatrix_mapVector'>mapVector</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='SkPoint_Reference#SkVector'>SkVector</a>* result) const;
118    <a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkMatrix_mapVector'>mapVector</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy) const;
119    bool <a href='#SkMatrix_mapRect'>mapRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* dst, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src) const;
120    bool <a href='#SkMatrix_mapRect'>mapRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* <a href='SkRect_Reference#Rect'>rect</a>) const;
121    <a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkMatrix_mapRect'>mapRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src) const;
122    void <a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[4], const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>) const;
123    void <a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* dst, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src) const;
124    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_mapRadius'>mapRadius</a>(<a href='undocumented#SkScalar'>SkScalar</a> radius) const;
125    bool <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a>() const;
126    <a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkMatrix_fixedStepInX'>fixedStepInX</a>(<a href='undocumented#SkScalar'>SkScalar</a> y) const;
127    bool <a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& m) const;
128    friend bool <a href='#SkMatrix_equal_operator'>operator==</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b);
129    friend bool <a href='#SkMatrix_notequal_operator'>operator!=</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b);
130    void <a href='#SkMatrix_dump'>dump()</a> const;
131    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getMinScale'>getMinScale</a>() const;
132    <a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getMaxScale'>getMaxScale</a>() const;
133    bool <a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleFactors[2]) const;
134    bool <a href='#SkMatrix_decomposeScale'>decomposeScale</a>(<a href='undocumented#SkSize'>SkSize</a>* scale, <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* remaining = nullptr) const;
135    static const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_I'>I</a>();
136    static const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_InvalidMatrix'>InvalidMatrix</a>();
137    static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_Concat'>Concat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b);
138    void <a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a>();
139    void <a href='#SkMatrix_setScaleTranslate'>setScaleTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> tx, <a href='undocumented#SkScalar'>SkScalar</a> ty);
140    bool <a href='#SkMatrix_isFinite'>isFinite</a>() const;
141};
142
143</pre>
144
145<a href='SkMatrix_Reference#Matrix'>Matrix</a> holds a 3 by 3 <a href='SkMatrix_Reference#Matrix'>matrix</a> for transforming coordinates. This allows mapping
146<a href='SkPoint_Reference#Point'>Points</a> and <a href='SkPoint_Reference#Vector'>Vectors</a> with translation, scaling, skewing, rotation, and
147perspective.
148
149<a href='SkMatrix_Reference#Matrix'>Matrix</a> elements are in row major order. <a href='SkMatrix_Reference#Matrix'>Matrix</a> does not have a constructor,
150so it must be explicitly initialized. <a href='#SkMatrix_setIdentity'>setIdentity</a> initializes <a href='SkMatrix_Reference#Matrix'>Matrix</a>
151so it has no effect. <a href='#SkMatrix_setTranslate'>setTranslate</a>, <a href='#SkMatrix_setScale'>setScale</a>, <a href='#SkMatrix_setSkew'>setSkew</a>, <a href='#SkMatrix_setRotate'>setRotate</a>, <a href='#SkMatrix_set9'>set9</a> and <a href='#SkMatrix_setAll'>setAll</a>
152initializes all <a href='SkMatrix_Reference#Matrix'>Matrix</a> elements with the corresponding mapping.
153
154<a href='SkMatrix_Reference#Matrix'>Matrix</a> includes a hidden variable that classifies the type of <a href='SkMatrix_Reference#Matrix'>matrix</a> to
155improve performance. <a href='SkMatrix_Reference#Matrix'>Matrix</a> is not thread safe unless <a href='#SkMatrix_getType'>getType</a> is called first.
156
157<a name='SkMatrix_MakeScale'></a>
158
159---
160
161<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
162static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy)
163</pre>
164
165Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to scale by (<a href='#SkMatrix_MakeScale_sx'>sx</a>, <a href='#SkMatrix_MakeScale_sy'>sy</a>). Returned <a href='SkMatrix_Reference#Matrix'>matrix</a> is:
166
167| <a href='#SkMatrix_MakeScale_sx'>sx</a>  0  0 |
168|  0 <a href='#SkMatrix_MakeScale_sy'>sy</a>  0 |
169|  0  0  1 |
170
171### Parameters
172
173<table>  <tr>    <td><a name='SkMatrix_MakeScale_sx'><code><strong>sx</strong></code></a></td>
174    <td>horizontal scale factor</td>
175  </tr>
176  <tr>    <td><a name='SkMatrix_MakeScale_sy'><code><strong>sy</strong></code></a></td>
177    <td>vertical scale factor</td>
178  </tr>
179</table>
180
181### Return Value
182
183<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> with scale
184
185### Example
186
187<div><fiddle-embed name="7ff17718111df6d6f95381d8a8f1b389"></fiddle-embed></div>
188
189### See Also
190
191<a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_postScale'>postScale</a> <a href='#SkMatrix_preScale'>preScale</a>
192
193<a name='SkMatrix_MakeScale_2'></a>
194
195---
196
197<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
198static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> scale)
199</pre>
200
201Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='#SkMatrix_MakeScale_2_scale'>scale</a> by (<a href='#SkMatrix_MakeScale_2_scale'>scale</a>, <a href='#SkMatrix_MakeScale_2_scale'>scale</a>). Returned <a href='SkMatrix_Reference#Matrix'>matrix</a> is:
202
203| <a href='#SkMatrix_MakeScale_2_scale'>scale</a>   0   0 |
204|   0   <a href='#SkMatrix_MakeScale_2_scale'>scale</a> 0 |
205|   0     0   1 |
206
207### Parameters
208
209<table>  <tr>    <td><a name='SkMatrix_MakeScale_2_scale'><code><strong>scale</strong></code></a></td>
210    <td>horizontal and vertical <a href='#SkMatrix_MakeScale_2_scale'>scale</a> factor</td>
211  </tr>
212</table>
213
214### Return Value
215
216<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> with <a href='#SkMatrix_MakeScale_2_scale'>scale</a>
217
218### Example
219
220<div><fiddle-embed name="2956aeb50fa862cdb13995e1e56a4bc8"></fiddle-embed></div>
221
222### See Also
223
224<a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_postScale'>postScale</a> <a href='#SkMatrix_preScale'>preScale</a>
225
226<a name='SkMatrix_MakeTrans'></a>
227
228---
229
230<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
231static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeTrans'>MakeTrans</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy)
232</pre>
233
234Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to translate by (<a href='#SkMatrix_MakeTrans_dx'>dx</a>, <a href='#SkMatrix_MakeTrans_dy'>dy</a>). Returned <a href='SkMatrix_Reference#Matrix'>matrix</a> is:
235
236| 1 0 <a href='#SkMatrix_MakeTrans_dx'>dx</a> |
237| 0 1 <a href='#SkMatrix_MakeTrans_dy'>dy</a> |
238| 0 0  1 |
239
240### Parameters
241
242<table>  <tr>    <td><a name='SkMatrix_MakeTrans_dx'><code><strong>dx</strong></code></a></td>
243    <td>horizontal translation</td>
244  </tr>
245  <tr>    <td><a name='SkMatrix_MakeTrans_dy'><code><strong>dy</strong></code></a></td>
246    <td>vertical translation</td>
247  </tr>
248</table>
249
250### Return Value
251
252<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> with translation
253
254### Example
255
256<div><fiddle-embed name="b2479df0d9cf296ff64ac31e36684557"></fiddle-embed></div>
257
258### See Also
259
260<a href='#SkMatrix_setTranslate'>setTranslate</a> <a href='#SkMatrix_postTranslate'>postTranslate</a> <a href='#SkMatrix_preTranslate'>preTranslate</a>
261
262<a name='SkMatrix_MakeAll'></a>
263
264---
265
266<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
267static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeAll'>MakeAll</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleX, <a href='undocumented#SkScalar'>SkScalar</a> skewX, <a href='undocumented#SkScalar'>SkScalar</a> transX, <a href='undocumented#SkScalar'>SkScalar</a> skewY,
268                        <a href='undocumented#SkScalar'>SkScalar</a> scaleY, <a href='undocumented#SkScalar'>SkScalar</a> transY, <a href='undocumented#SkScalar'>SkScalar</a> pers0, <a href='undocumented#SkScalar'>SkScalar</a> pers1,
269                        <a href='undocumented#SkScalar'>SkScalar</a> pers2)
270</pre>
271
272Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
273
274| <a href='#SkMatrix_MakeAll_scaleX'>scaleX</a>  <a href='#SkMatrix_MakeAll_skewX'>skewX</a> <a href='#SkMatrix_MakeAll_transX'>transX</a> |
275|  <a href='#SkMatrix_MakeAll_skewY'>skewY</a> <a href='#SkMatrix_MakeAll_scaleY'>scaleY</a> <a href='#SkMatrix_MakeAll_transY'>transY</a> |
276|  <a href='#SkMatrix_MakeAll_pers0'>pers0</a>  <a href='#SkMatrix_MakeAll_pers1'>pers1</a>  <a href='#SkMatrix_MakeAll_pers2'>pers2</a> |
277
278### Parameters
279
280<table>  <tr>    <td><a name='SkMatrix_MakeAll_scaleX'><code><strong>scaleX</strong></code></a></td>
281    <td>horizontal scale factor</td>
282  </tr>
283  <tr>    <td><a name='SkMatrix_MakeAll_skewX'><code><strong>skewX</strong></code></a></td>
284    <td>horizontal skew factor</td>
285  </tr>
286  <tr>    <td><a name='SkMatrix_MakeAll_transX'><code><strong>transX</strong></code></a></td>
287    <td>horizontal translation</td>
288  </tr>
289  <tr>    <td><a name='SkMatrix_MakeAll_skewY'><code><strong>skewY</strong></code></a></td>
290    <td>vertical skew factor</td>
291  </tr>
292  <tr>    <td><a name='SkMatrix_MakeAll_scaleY'><code><strong>scaleY</strong></code></a></td>
293    <td>vertical scale factor</td>
294  </tr>
295  <tr>    <td><a name='SkMatrix_MakeAll_transY'><code><strong>transY</strong></code></a></td>
296    <td>vertical translation</td>
297  </tr>
298  <tr>    <td><a name='SkMatrix_MakeAll_pers0'><code><strong>pers0</strong></code></a></td>
299    <td>input x-axis perspective factor</td>
300  </tr>
301  <tr>    <td><a name='SkMatrix_MakeAll_pers1'><code><strong>pers1</strong></code></a></td>
302    <td>input y-axis perspective factor</td>
303  </tr>
304  <tr>    <td><a name='SkMatrix_MakeAll_pers2'><code><strong>pers2</strong></code></a></td>
305    <td>perspective scale factor</td>
306  </tr>
307</table>
308
309### Return Value
310
311<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from parameters
312
313### Example
314
315<div><fiddle-embed name="6bad83b64de9266e323c29d550e04188"></fiddle-embed></div>
316
317### See Also
318
319<a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_postConcat'>postConcat</a> <a href='#SkMatrix_preConcat'>preConcat</a>
320
321<a name='SkMatrix_TypeMask'></a>
322
323---
324
325<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
326    enum <a href='#SkMatrix_TypeMask'>TypeMask</a> {
327        <a href='#SkMatrix_kIdentity_Mask'>kIdentity_Mask</a> = 0,
328        <a href='#SkMatrix_kTranslate_Mask'>kTranslate_Mask</a> = 0x01,
329        <a href='#SkMatrix_kScale_Mask'>kScale_Mask</a> = 0x02,
330        <a href='#SkMatrix_kAffine_Mask'>kAffine_Mask</a> = 0x04,
331        <a href='#SkMatrix_kPerspective_Mask'>kPerspective_Mask</a> = 0x08,
332    };
333
334</pre>
335
336Enumeration of bit fields for mask returned by <a href='#SkMatrix_getType'>getType</a>.
337Used to identify the complexity of <a href='SkMatrix_Reference#Matrix'>Matrix</a>, to optimize performance.
338
339### Constants
340
341<table style='border-collapse: collapse; width: 62.5em'>
342  <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th>
343<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th>
344<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
345  <tr style='background-color: #f0f0f0; '>
346    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kIdentity_Mask'><code>SkMatrix::kIdentity_Mask</code></a></td>
347    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td>
348    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
349all bits clear if <a href='SkMatrix_Reference#Matrix'>Matrix</a> is identity
350</td>
351  </tr>
352  <tr>
353    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kTranslate_Mask'><code>SkMatrix::kTranslate_Mask</code></a></td>
354    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td>
355    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
356set if <a href='SkMatrix_Reference#Matrix'>Matrix</a> has translation
357</td>
358  </tr>
359  <tr style='background-color: #f0f0f0; '>
360    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kScale_Mask'><code>SkMatrix::kScale_Mask</code></a></td>
361    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td>
362    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
363set if <a href='SkMatrix_Reference#Matrix'>Matrix</a> scales x-axis or y-axis
364</td>
365  </tr>
366  <tr>
367    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kAffine_Mask'><code>SkMatrix::kAffine_Mask</code></a></td>
368    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td>
369    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
370set if <a href='SkMatrix_Reference#Matrix'>Matrix</a> skews or rotates
371</td>
372  </tr>
373  <tr style='background-color: #f0f0f0; '>
374    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kPerspective_Mask'><code>SkMatrix::kPerspective_Mask</code></a></td>
375    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td>
376    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
377set if <a href='SkMatrix_Reference#Matrix'>Matrix</a> has perspective
378</td>
379  </tr>
380</table>
381
382### Example
383
384<div><fiddle-embed name="ba19b36df8cd78586f3dff54e2d4c093">
385
386#### Example Output
387
388~~~~
389after reset: kIdentity_Mask
390after postTranslate: kTranslate_Mask
391after postScale: kTranslate_Mask kScale_Mask
392after postScale: kTranslate_Mask kScale_Mask kAffine_Mask
393after setPolyToPoly: kTranslate_Mask kScale_Mask kAffine_Mask kPerspective_Mask
394~~~~
395
396</fiddle-embed></div>
397
398### See Also
399
400<a href='#SkMatrix_getType'>getType</a>
401
402<a name='Property'></a>
403
404<a name='SkMatrix_getType'></a>
405
406---
407
408<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
409<a href='#SkMatrix_TypeMask'>TypeMask</a> <a href='#SkMatrix_getType'>getType</a>()const
410</pre>
411
412Returns a bit field describing the transformations the <a href='SkMatrix_Reference#Matrix'>matrix</a> may
413perform. The bit field is computed conservatively, so it may include
414false positives. For example, when <a href='#SkMatrix_kPerspective_Mask'>kPerspective_Mask</a> is set, all
415other bits are set.
416
417### Return Value
418
419<a href='#SkMatrix_kIdentity_Mask'>kIdentity_Mask</a>, or combinations of: <a href='#SkMatrix_kTranslate_Mask'>kTranslate_Mask</a>, <a href='#SkMatrix_kScale_Mask'>kScale_Mask</a>,
420
421<a href='#SkMatrix_kAffine_Mask'>kAffine_Mask</a>, <a href='#SkMatrix_kPerspective_Mask'>kPerspective_Mask</a>
422
423### Example
424
425<div><fiddle-embed name="8e45fe2dd52731bb2d4318686257e1d7">
426
427#### Example Output
428
429~~~~
430identity flags hex: 0 decimal: 0
431set all  flags hex: f decimal: 15
432~~~~
433
434</fiddle-embed></div>
435
436### See Also
437
438<a href='#SkMatrix_TypeMask'>TypeMask</a>
439
440<a name='SkMatrix_isIdentity'></a>
441
442---
443
444<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
445bool <a href='#SkMatrix_isIdentity'>isIdentity</a>()const
446</pre>
447
448Returns true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is identity.  Identity <a href='SkMatrix_Reference#Matrix'>matrix</a> is:
449
450| 1 0 0 |
451| 0 1 0 |
452| 0 0 1 |
453
454### Return Value
455
456true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> has no effect
457
458### Example
459
460<div><fiddle-embed name="780ab376325b3cfa889ea26c0769ec11">
461
462#### Example Output
463
464~~~~
465is identity: true
466is identity: false
467~~~~
468
469</fiddle-embed></div>
470
471### See Also
472
473<a href='#SkMatrix_reset'>reset()</a> <a href='#SkMatrix_setIdentity'>setIdentity</a> <a href='#SkMatrix_getType'>getType</a>
474
475<a name='SkMatrix_isScaleTranslate'></a>
476
477---
478
479<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
480bool <a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a>()const
481</pre>
482
483Returns true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> at most scales and translates. <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> may be identity,
484contain only scale elements, only translate elements, or both. <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> form is:
485
486| scale-x    0    translate-x |
487|    0    scale-y translate-y |
488|    0       0         1      |
489
490### Return Value
491
492true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is identity; or scales, translates, or both
493
494### Example
495
496<div><fiddle-embed name="6287e29674a487eb94174992d45b9a34">
497
498#### Example Output
499
500~~~~
501is scale-translate: true
502is scale-translate: true
503is scale-translate: true
504is scale-translate: true
505~~~~
506
507</fiddle-embed></div>
508
509### See Also
510
511<a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_isTranslate'>isTranslate</a> <a href='#SkMatrix_setTranslate'>setTranslate</a> <a href='#SkMatrix_getType'>getType</a>
512
513<a name='SkMatrix_isTranslate'></a>
514
515---
516
517<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
518bool <a href='#SkMatrix_isTranslate'>isTranslate</a>()const
519</pre>
520
521Returns true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is identity, or translates. <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> form is:
522
523| 1 0 translate-x |
524| 0 1 translate-y |
525| 0 0      1      |
526
527### Return Value
528
529true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is identity, or translates
530
531### Example
532
533<div><fiddle-embed name="73ac71a8a30841873577c11c6c9b38ee">
534
535#### Example Output
536
537~~~~
538is translate: true
539is translate: true
540is translate: false
541is translate: false
542~~~~
543
544</fiddle-embed></div>
545
546### See Also
547
548<a href='#SkMatrix_setTranslate'>setTranslate</a> <a href='#SkMatrix_getType'>getType</a>
549
550<a name='SkMatrix_rectStaysRect'></a>
551
552---
553
554<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
555bool <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>()const
556</pre>
557
558Returns true <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> maps <a href='SkRect_Reference#SkRect'>SkRect</a> to another <a href='SkRect_Reference#SkRect'>SkRect</a>. If true, <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is identity,
559or scales, or rotates a multiple of 90 degrees, or mirrors on axes. In all
560cases, <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> may also have translation. <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> form is either:
561
562| scale-x    0    translate-x |
563|    0    scale-y translate-y |
564|    0       0         1      |
565
566or
567
568|    0     rotate-x translate-x |
569| rotate-y    0     translate-y |
570|    0        0          1      |
571
572for non-zero values of scale-x, scale-y, rotate-x, and rotate-y.
573
574Also called <a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a>(); use the one that provides better inline
575documentation.
576
577### Return Value
578
579true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> maps one <a href='SkRect_Reference#SkRect'>SkRect</a> into another
580
581### Example
582
583<div><fiddle-embed name="ce5319c036c9b5086da8a0009fe409f8">
584
585#### Example Output
586
587~~~~
588rectStaysRect: true
589rectStaysRect: true
590rectStaysRect: true
591rectStaysRect: true
592~~~~
593
594</fiddle-embed></div>
595
596### See Also
597
598<a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a> <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a>
599
600<a name='SkMatrix_preservesAxisAlignment'></a>
601
602---
603
604<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
605bool <a href='#SkMatrix_preservesAxisAlignment'>preservesAxisAlignment</a>()const
606</pre>
607
608Returns true <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> maps <a href='SkRect_Reference#SkRect'>SkRect</a> to another <a href='SkRect_Reference#SkRect'>SkRect</a>. If true, <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is identity,
609or scales, or rotates a multiple of 90 degrees, or mirrors on axes. In all
610cases, <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> may also have translation. <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> form is either:
611
612| scale-x    0    translate-x |
613|    0    scale-y translate-y |
614|    0       0         1      |
615
616or
617
618|    0     rotate-x translate-x |
619| rotate-y    0     translate-y |
620|    0        0          1      |
621
622for non-zero values of scale-x, scale-y, rotate-x, and rotate-y.
623
624Also called <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>(); use the one that provides better inline
625documentation.
626
627### Return Value
628
629true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> maps one <a href='SkRect_Reference#SkRect'>SkRect</a> into another
630
631### Example
632
633<div><fiddle-embed name="7a234c96608fb7cb8135b9940b0b15f7">
634
635#### Example Output
636
637~~~~
638preservesAxisAlignment: true
639preservesAxisAlignment: true
640preservesAxisAlignment: true
641preservesAxisAlignment: true
642~~~~
643
644</fiddle-embed></div>
645
646### See Also
647
648<a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a>
649
650<a name='SkMatrix_hasPerspective'></a>
651
652---
653
654<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
655bool <a href='#SkMatrix_hasPerspective'>hasPerspective</a>()const
656</pre>
657
658Returns true if the <a href='SkMatrix_Reference#Matrix'>matrix</a> contains perspective elements. <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> form is:
659
660|       --            --              --          |
661|       --            --              --          |
662| perspective-x  perspective-y  perspective-scale |
663
664where perspective-x or perspective-y is non-zero, or perspective-scale is
665not one. All other elements may have any value.
666
667### Return Value
668
669true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is in most general form
670
671### Example
672
673<div><fiddle-embed name="688123908c733169bbbfaf11f41ecff6"></fiddle-embed></div>
674
675### See Also
676
677<a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a>
678
679<a name='SkMatrix_isSimilarity'></a>
680
681---
682
683<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
684bool <a href='#SkMatrix_isSimilarity'>isSimilarity</a>(<a href='undocumented#SkScalar'>SkScalar</a> tol = <a href='undocumented#SK_ScalarNearlyZero'>SK_ScalarNearlyZero</a>)const
685</pre>
686
687Returns true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contains only translation, rotation, reflection, and
688uniform scale.
689Returns false if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contains different scales, skewing, perspective, or
690degenerate forms that collapse to a <a href='undocumented#Line'>line</a> or <a href='SkPoint_Reference#Point'>point</a>.
691
692Describes that the <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> makes rendering with and without the <a href='SkMatrix_Reference#Matrix'>matrix</a> are
693visually alike; a transformed <a href='undocumented#Circle'>circle</a> remains a <a href='undocumented#Circle'>circle</a>. Mathematically, this is
694referred to as similarity of a  <a href='undocumented#Euclidean_Space'>Euclidean space</a>, or a similarity transformation.
695
696Preserves right angles, keeping the arms of the angle equal lengths.
697
698### Parameters
699
700<table>  <tr>    <td><a name='SkMatrix_isSimilarity_tol'><code><strong>tol</strong></code></a></td>
701    <td>to be deprecated</td>
702  </tr>
703</table>
704
705### Return Value
706
707true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> only rotates, uniformly scales, translates
708
709### Example
710
711<div><fiddle-embed name="8b37f4ae7fec1756433c0f984175fb14"><div><a href='undocumented#String'>String</a> is drawn four times through but only two are visible. Drawing the pair
712with <a href='#SkMatrix_isSimilarity'>isSimilarity</a> false reveals the pair not visible through the <a href='SkMatrix_Reference#Matrix'>matrix</a>.
713</div></fiddle-embed></div>
714
715### See Also
716
717<a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a> <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a>
718
719<a name='SkMatrix_preservesRightAngles'></a>
720
721---
722
723<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
724bool <a href='#SkMatrix_preservesRightAngles'>preservesRightAngles</a>(<a href='undocumented#SkScalar'>SkScalar</a> tol = <a href='undocumented#SK_ScalarNearlyZero'>SK_ScalarNearlyZero</a>)const
725</pre>
726
727Returns true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contains only translation, rotation, reflection, and
728scale. Scale may differ along rotated axes.
729Returns false if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> skewing, perspective, or degenerate forms that collapse
730to a <a href='undocumented#Line'>line</a> or <a href='SkPoint_Reference#Point'>point</a>.
731
732Preserves right angles, but not requiring that the arms of the angle
733retain equal lengths.
734
735### Parameters
736
737<table>  <tr>    <td><a name='SkMatrix_preservesRightAngles_tol'><code><strong>tol</strong></code></a></td>
738    <td>to be deprecated</td>
739  </tr>
740</table>
741
742### Return Value
743
744true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> only rotates, scales, translates
745
746### Example
747
748<div><fiddle-embed name="b9becf0dc24a9f00726e24a81fb72f16"><div>Equal scale is both similar and preserves right angles.
749Unequal scale is not similar but preserves right angles.
750Skews are not similar and do not preserve right angles.
751</div></fiddle-embed></div>
752
753### See Also
754
755<a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a> <a href='#SkMatrix_isSimilarity'>isSimilarity</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a> <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a>
756
757<a name='MemberIndex'></a>
758
759---
760
761<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
762    static constexpr int <a href='#SkMatrix_kMScaleX'>kMScaleX</a> = 0;
763    static constexpr int <a href='#SkMatrix_kMSkewX'>kMSkewX</a> = 1;
764    static constexpr int <a href='#SkMatrix_kMTransX'>kMTransX</a> = 2;
765    static constexpr int <a href='#SkMatrix_kMSkewY'>kMSkewY</a> = 3;
766    static constexpr int <a href='#SkMatrix_kMScaleY'>kMScaleY</a> = 4;
767    static constexpr int <a href='#SkMatrix_kMTransY'>kMTransY</a> = 5;
768    static constexpr int <a href='#SkMatrix_kMPersp0'>kMPersp0</a> = 6;
769    static constexpr int <a href='#SkMatrix_kMPersp1'>kMPersp1</a> = 7;
770    static constexpr int <a href='#SkMatrix_kMPersp2'>kMPersp2</a> = 8;
771</pre>
772
773<a href='SkMatrix_Reference#Matrix'>Matrix</a> organizes its values in row order. These members correspond to
774each value in <a href='SkMatrix_Reference#Matrix'>Matrix</a>.
775
776### Constants
777
778<table style='border-collapse: collapse; width: 62.5em'>
779  <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th>
780<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th>
781<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
782  <tr style='background-color: #f0f0f0; '>
783    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMScaleX'><code>SkMatrix::kMScaleX</code></a></td>
784    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td>
785    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
786horizontal scale factor</td>
787  </tr>
788  <tr>
789    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMSkewX'><code>SkMatrix::kMSkewX</code></a></td>
790    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td>
791    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
792horizontal skew factor</td>
793  </tr>
794  <tr style='background-color: #f0f0f0; '>
795    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMTransX'><code>SkMatrix::kMTransX</code></a></td>
796    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td>
797    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
798horizontal translation</td>
799  </tr>
800  <tr>
801    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMSkewY'><code>SkMatrix::kMSkewY</code></a></td>
802    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td>
803    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
804vertical skew factor</td>
805  </tr>
806  <tr style='background-color: #f0f0f0; '>
807    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMScaleY'><code>SkMatrix::kMScaleY</code></a></td>
808    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td>
809    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
810vertical scale factor</td>
811  </tr>
812  <tr>
813    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMTransY'><code>SkMatrix::kMTransY</code></a></td>
814    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>5</td>
815    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
816vertical translation</td>
817  </tr>
818  <tr style='background-color: #f0f0f0; '>
819    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMPersp0'><code>SkMatrix::kMPersp0</code></a></td>
820    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>6</td>
821    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
822input x perspective factor</td>
823  </tr>
824  <tr>
825    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMPersp1'><code>SkMatrix::kMPersp1</code></a></td>
826    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>7</td>
827    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
828input y perspective factor</td>
829  </tr>
830  <tr style='background-color: #f0f0f0; '>
831    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kMPersp2'><code>SkMatrix::kMPersp2</code></a></td>
832    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>8</td>
833    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
834perspective bias</td>
835  </tr>
836</table>
837
838### Example
839
840<div><fiddle-embed name="3bbf75f4748420810aa2586e3c8548d9"></fiddle-embed></div>
841
842### See Also
843
844<a href='#SkMatrix_get'>get()</a> <a href='#SkMatrix_set'>set()</a>
845
846<a name='AffineIndex'></a>
847
848---
849
850<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
851</pre>
852
853Affine arrays are in column major order to match the <a href='SkMatrix_Reference#Matrix'>matrix</a> used by
854PDF and XPS.
855
856### Constants
857
858<table style='border-collapse: collapse; width: 62.5em'>
859  <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th>
860<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th>
861<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
862  <tr style='background-color: #f0f0f0; '>
863    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kAScaleX'><code>SkMatrix::kAScaleX</code></a></td>
864    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td>
865    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
866horizontal scale factor</td>
867  </tr>
868  <tr>
869    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kASkewY'><code>SkMatrix::kASkewY</code></a></td>
870    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td>
871    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
872vertical skew factor</td>
873  </tr>
874  <tr style='background-color: #f0f0f0; '>
875    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kASkewX'><code>SkMatrix::kASkewX</code></a></td>
876    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td>
877    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
878horizontal skew factor</td>
879  </tr>
880  <tr>
881    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kAScaleY'><code>SkMatrix::kAScaleY</code></a></td>
882    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td>
883    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
884vertical scale factor</td>
885  </tr>
886  <tr style='background-color: #f0f0f0; '>
887    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kATransX'><code>SkMatrix::kATransX</code></a></td>
888    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>4</td>
889    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
890horizontal translation</td>
891  </tr>
892  <tr>
893    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kATransY'><code>SkMatrix::kATransY</code></a></td>
894    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>5</td>
895    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
896vertical translation</td>
897  </tr>
898</table>
899
900### See Also
901
902<a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a> <a href='#SkMatrix_asAffine'>asAffine</a> <a href='#SkMatrix_setAffine'>setAffine</a>
903
904<a name='SkMatrix_array_operator'></a>
905
906---
907
908<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
909<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_array1_operator'>operator[]</a>(int index)const
910</pre>
911
912### Example
913
914<div><fiddle-embed name="e8740493abdf0c6341762db9cee56b89">
915
916#### Example Output
917
918~~~~
919matrix[SkMatrix::kMScaleX] == 42
920matrix[SkMatrix::kMScaleY] == 24
921~~~~
922
923</fiddle-embed></div>
924
925### See Also
926
927<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_set'>set</a>
928
929<a name='SkMatrix_get'></a>
930
931---
932
933<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
934<a href='undocumented#SkScalar'>SkScalar</a> get(int index)const
935</pre>
936
937Returns one <a href='SkMatrix_Reference#Matrix'>matrix</a> value. Asserts if <a href='#SkMatrix_get_index'>index</a> is out of range and SK_DEBUG is
938defined.
939
940### Parameters
941
942<table>  <tr>    <td><a name='SkMatrix_get_index'><code><strong>index</strong></code></a></td>
943    <td>one of: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>,</td>
944  </tr>
945</table>
946
947<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a>
948
949### Return Value
950
951value corresponding to <a href='#SkMatrix_get_index'>index</a>
952
953### Example
954
955<div><fiddle-embed name="f5ed382bd04fa7d50b2398cce2fca23a">
956
957#### Example Output
958
959~~~~
960matrix.get(SkMatrix::kMSkewX) == 42
961matrix.get(SkMatrix::kMSkewY) == 24
962~~~~
963
964</fiddle-embed></div>
965
966### See Also
967
968<a href='#SkMatrix_array1_operator'>operator[]</a>(int <a href='#SkMatrix_get_index'>index</a>) <a href='#SkMatrix_set'>set</a>
969
970<a name='SkMatrix_getScaleX'></a>
971
972---
973
974<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
975<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getScaleX'>getScaleX</a>()const
976</pre>
977
978Returns scale factor multiplied by x-axis input, contributing to x-axis output.
979With <a href='#SkMatrix_mapPoints'>mapPoints</a>(), scales <a href='SkPoint_Reference#SkPoint'>SkPoint</a> along the x-axis.
980
981### Return Value
982
983horizontal scale factor
984
985### Example
986
987<div><fiddle-embed name="ab746d9be63975041ae8e50cba84dc3d">
988
989#### Example Output
990
991~~~~
992matrix.getScaleX() == 42
993~~~~
994
995</fiddle-embed></div>
996
997### See Also
998
999<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getScaleY'>getScaleY</a> <a href='#SkMatrix_setScaleX'>setScaleX</a> <a href='#SkMatrix_setScale'>setScale</a>
1000
1001<a name='SkMatrix_getScaleY'></a>
1002
1003---
1004
1005<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1006<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getScaleY'>getScaleY</a>()const
1007</pre>
1008
1009Returns scale factor multiplied by y-axis input, contributing to y-axis output.
1010With <a href='#SkMatrix_mapPoints'>mapPoints</a>(), scales <a href='SkPoint_Reference#SkPoint'>SkPoint</a> along the y-axis.
1011
1012### Return Value
1013
1014vertical scale factor
1015
1016### Example
1017
1018<div><fiddle-embed name="708b1a548a2f8661b2ab570782fbc751">
1019
1020#### Example Output
1021
1022~~~~
1023matrix.getScaleY() == 24
1024~~~~
1025
1026</fiddle-embed></div>
1027
1028### See Also
1029
1030<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getScaleX'>getScaleX</a> <a href='#SkMatrix_setScaleY'>setScaleY</a> <a href='#SkMatrix_setScale'>setScale</a>
1031
1032<a name='SkMatrix_getSkewY'></a>
1033
1034---
1035
1036<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1037<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getSkewY'>getSkewY</a>()const
1038</pre>
1039
1040Returns scale factor multiplied by x-axis input, contributing to y-axis output.
1041With <a href='#SkMatrix_mapPoints'>mapPoints</a>(), skews <a href='SkPoint_Reference#SkPoint'>SkPoint</a> along the y-axis.
1042Skewing both axes can rotate <a href='SkPoint_Reference#SkPoint'>SkPoint</a>.
1043
1044### Return Value
1045
1046vertical skew factor
1047
1048### Example
1049
1050<div><fiddle-embed name="6be5704506d029ffc91ba03b1d3e674b">
1051
1052#### Example Output
1053
1054~~~~
1055matrix.getSkewY() == 24
1056~~~~
1057
1058</fiddle-embed></div>
1059
1060### See Also
1061
1062<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getSkewX'>getSkewX</a> <a href='#SkMatrix_setSkewY'>setSkewY</a> <a href='#SkMatrix_setSkew'>setSkew</a>
1063
1064<a name='SkMatrix_getSkewX'></a>
1065
1066---
1067
1068<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1069<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getSkewX'>getSkewX</a>()const
1070</pre>
1071
1072Returns scale factor multiplied by y-axis input, contributing to x-axis output.
1073With <a href='#SkMatrix_mapPoints'>mapPoints</a>(), skews <a href='SkPoint_Reference#SkPoint'>SkPoint</a> along the x-axis.
1074Skewing both axes can rotate <a href='SkPoint_Reference#SkPoint'>SkPoint</a>.
1075
1076### Return Value
1077
1078horizontal scale factor
1079
1080### Example
1081
1082<div><fiddle-embed name="df3a5d3c688e7597eae1e4e07bf91ae6">
1083
1084#### Example Output
1085
1086~~~~
1087matrix.getSkewX() == 42
1088~~~~
1089
1090</fiddle-embed></div>
1091
1092### See Also
1093
1094<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getSkewY'>getSkewY</a> <a href='#SkMatrix_setSkewX'>setSkewX</a> <a href='#SkMatrix_setSkew'>setSkew</a>
1095
1096<a name='SkMatrix_getTranslateX'></a>
1097
1098---
1099
1100<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1101<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getTranslateX'>getTranslateX</a>()const
1102</pre>
1103
1104Returns translation contributing to x-axis output.
1105With <a href='#SkMatrix_mapPoints'>mapPoints</a>(), moves <a href='SkPoint_Reference#SkPoint'>SkPoint</a> along the x-axis.
1106
1107### Return Value
1108
1109horizontal translation factor
1110
1111### Example
1112
1113<div><fiddle-embed name="6236f7f2b91aff977a66ba2ee2558ca4">
1114
1115#### Example Output
1116
1117~~~~
1118matrix.getTranslateX() == 42
1119~~~~
1120
1121</fiddle-embed></div>
1122
1123### See Also
1124
1125<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getTranslateY'>getTranslateY</a> <a href='#SkMatrix_setTranslateX'>setTranslateX</a> <a href='#SkMatrix_setTranslate'>setTranslate</a>
1126
1127<a name='SkMatrix_getTranslateY'></a>
1128
1129---
1130
1131<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1132<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getTranslateY'>getTranslateY</a>()const
1133</pre>
1134
1135Returns translation contributing to y-axis output.
1136With <a href='#SkMatrix_mapPoints'>mapPoints</a>(), moves <a href='SkPoint_Reference#SkPoint'>SkPoint</a> along the y-axis.
1137
1138### Return Value
1139
1140vertical translation factor
1141
1142### Example
1143
1144<div><fiddle-embed name="08464e32d22421d2b254c71a84545ef5">
1145
1146#### Example Output
1147
1148~~~~
1149matrix.getTranslateY() == 24
1150~~~~
1151
1152</fiddle-embed></div>
1153
1154### See Also
1155
1156<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_getTranslateX'>getTranslateX</a> <a href='#SkMatrix_setTranslateY'>setTranslateY</a> <a href='#SkMatrix_setTranslate'>setTranslate</a>
1157
1158<a name='SkMatrix_getPerspX'></a>
1159
1160---
1161
1162<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1163<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getPerspX'>getPerspX</a>()const
1164</pre>
1165
1166Returns factor scaling input x-axis relative to input y-axis.
1167
1168### Return Value
1169
1170input x-axis perspective factor
1171
1172### Example
1173
1174<div><fiddle-embed name="a0f5bf4b55e8c33bfda29bf67e34306f"></fiddle-embed></div>
1175
1176### See Also
1177
1178<a href='#SkMatrix_kMPersp0'>kMPersp0</a> <a href='#SkMatrix_getPerspY'>getPerspY</a>
1179
1180<a name='SkMatrix_getPerspY'></a>
1181
1182---
1183
1184<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1185<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getPerspY'>getPerspY</a>()const
1186</pre>
1187
1188Returns factor scaling input y-axis relative to input x-axis.
1189
1190### Return Value
1191
1192input y-axis perspective factor
1193
1194### Example
1195
1196<div><fiddle-embed name="424a00a73675dbd99ad20feb0267442b"></fiddle-embed></div>
1197
1198### See Also
1199
1200<a href='#SkMatrix_kMPersp1'>kMPersp1</a> <a href='#SkMatrix_getPerspX'>getPerspX</a>
1201
1202<a name='SkMatrix_array1_operator'></a>
1203
1204---
1205
1206<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1207<a href='undocumented#SkScalar'>SkScalar</a>& <a href='#SkMatrix_array1_operator'>operator[]</a>(int index)
1208</pre>
1209
1210### Example
1211
1212<div><fiddle-embed name="f4365ef332f51f7fd25040e0771ba9a2">
1213
1214#### Example Output
1215
1216~~~~
1217with identity matrix: x = 24
1218after skew x mod:     x = 24
1219after 2nd skew x mod: x = 24
1220after dirty cache:    x = 66
1221~~~~
1222
1223</fiddle-embed></div>
1224
1225### See Also
1226
1227<a href='#SkMatrix_get'>get</a> <a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a> <a href='#SkMatrix_set'>set</a>
1228
1229<a name='Set'></a>
1230
1231<a name='SkMatrix_set'></a>
1232
1233---
1234
1235<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1236void set(int index, <a href='undocumented#SkScalar'>SkScalar</a> value)
1237</pre>
1238
1239Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_set_value'>value</a>. Asserts if <a href='#SkMatrix_set_index'>index</a> is out of range and SK_DEBUG is
1240defined. Safer than operator[]; internal cache is always maintained.
1241
1242### Parameters
1243
1244<table>  <tr>    <td><a name='SkMatrix_set_index'><code><strong>index</strong></code></a></td>
1245    <td>one of: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>,</td>
1246  </tr>
1247</table>
1248
1249<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a>
1250
1251### Parameters
1252
1253<table>  <tr>    <td><a name='SkMatrix_set_value'><code><strong>value</strong></code></a></td>
1254    <td><a href='undocumented#Scalar'>scalar</a> to store in <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a></td>
1255  </tr>
1256</table>
1257
1258### Example
1259
1260<div><fiddle-embed name="1d400a92ca826cc89bcb88ea051f28c8">
1261
1262#### Example Output
1263
1264~~~~
1265with identity matrix: x = 24
1266after skew x mod:     x = 24
1267after 2nd skew x mod: x = 66
1268~~~~
1269
1270</fiddle-embed></div>
1271
1272### See Also
1273
1274operator[] <a href='#SkMatrix_get'>get</a>
1275
1276<a name='SkMatrix_setScaleX'></a>
1277
1278---
1279
1280<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1281void <a href='#SkMatrix_setScaleX'>setScaleX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1282</pre>
1283
1284Sets horizontal scale factor.
1285
1286### Parameters
1287
1288<table>  <tr>    <td><a name='SkMatrix_setScaleX_v'><code><strong>v</strong></code></a></td>
1289    <td>horizontal scale factor to store</td>
1290  </tr>
1291</table>
1292
1293### Example
1294
1295<div><fiddle-embed name="a39dfed98c3c3c3a56be9ad59fe4e21e"></fiddle-embed></div>
1296
1297### See Also
1298
1299<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_setScaleY'>setScaleY</a>
1300
1301<a name='SkMatrix_setScaleY'></a>
1302
1303---
1304
1305<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1306void <a href='#SkMatrix_setScaleY'>setScaleY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1307</pre>
1308
1309Sets vertical scale factor.
1310
1311### Parameters
1312
1313<table>  <tr>    <td><a name='SkMatrix_setScaleY_v'><code><strong>v</strong></code></a></td>
1314    <td>vertical scale factor to store</td>
1315  </tr>
1316</table>
1317
1318### Example
1319
1320<div><fiddle-embed name="f040c6dd85a02e94eaca00d5c2832604"></fiddle-embed></div>
1321
1322### See Also
1323
1324<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_setScaleX'>setScaleX</a>
1325
1326<a name='SkMatrix_setSkewY'></a>
1327
1328---
1329
1330<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1331void <a href='#SkMatrix_setSkewY'>setSkewY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1332</pre>
1333
1334Sets vertical skew factor.
1335
1336### Parameters
1337
1338<table>  <tr>    <td><a name='SkMatrix_setSkewY_v'><code><strong>v</strong></code></a></td>
1339    <td>vertical skew factor to store</td>
1340  </tr>
1341</table>
1342
1343### Example
1344
1345<div><fiddle-embed name="b418d15df9829aefcc6aca93a37428bb"></fiddle-embed></div>
1346
1347### See Also
1348
1349<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setSkew'>setSkew</a> <a href='#SkMatrix_setSkewX'>setSkewX</a>
1350
1351<a name='SkMatrix_setSkewX'></a>
1352
1353---
1354
1355<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1356void <a href='#SkMatrix_setSkewX'>setSkewX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1357</pre>
1358
1359Sets horizontal skew factor.
1360
1361### Parameters
1362
1363<table>  <tr>    <td><a name='SkMatrix_setSkewX_v'><code><strong>v</strong></code></a></td>
1364    <td>horizontal skew factor to store</td>
1365  </tr>
1366</table>
1367
1368### Example
1369
1370<div><fiddle-embed name="c7177a6fbc1545be95a5ebca87e0cd0d"></fiddle-embed></div>
1371
1372### See Also
1373
1374<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setSkew'>setSkew</a> <a href='#SkMatrix_setSkewX'>setSkewX</a>
1375
1376<a name='SkMatrix_setTranslateX'></a>
1377
1378---
1379
1380<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1381void <a href='#SkMatrix_setTranslateX'>setTranslateX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1382</pre>
1383
1384Sets horizontal translation.
1385
1386### Parameters
1387
1388<table>  <tr>    <td><a name='SkMatrix_setTranslateX_v'><code><strong>v</strong></code></a></td>
1389    <td>horizontal translation to store</td>
1390  </tr>
1391</table>
1392
1393### Example
1394
1395<div><fiddle-embed name="a18bc2e3607ac3a8e438bcb61fb13130"></fiddle-embed></div>
1396
1397### See Also
1398
1399<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setTranslate'>setTranslate</a> <a href='#SkMatrix_setTranslateY'>setTranslateY</a>
1400
1401<a name='SkMatrix_setTranslateY'></a>
1402
1403---
1404
1405<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1406void <a href='#SkMatrix_setTranslateY'>setTranslateY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1407</pre>
1408
1409Sets vertical translation.
1410
1411### Parameters
1412
1413<table>  <tr>    <td><a name='SkMatrix_setTranslateY_v'><code><strong>v</strong></code></a></td>
1414    <td>vertical translation to store</td>
1415  </tr>
1416</table>
1417
1418### Example
1419
1420<div><fiddle-embed name="34e3c70a72b836abf7f4858d35eecc98"></fiddle-embed></div>
1421
1422### See Also
1423
1424<a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setTranslate'>setTranslate</a> <a href='#SkMatrix_setTranslateX'>setTranslateX</a>
1425
1426<a name='SkMatrix_setPerspX'></a>
1427
1428---
1429
1430<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1431void <a href='#SkMatrix_setPerspX'>setPerspX</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1432</pre>
1433
1434Sets input x-axis perspective factor, which causes <a href='#SkMatrix_mapXY'>mapXY</a>() to vary input x-axis values
1435inversely proportional to input y-axis values.
1436
1437### Parameters
1438
1439<table>  <tr>    <td><a name='SkMatrix_setPerspX_v'><code><strong>v</strong></code></a></td>
1440    <td>perspective factor</td>
1441  </tr>
1442</table>
1443
1444### Example
1445
1446<div><fiddle-embed name="830a9e4e4bb93d25afd83b2fea63929e"></fiddle-embed></div>
1447
1448### See Also
1449
1450<a href='#SkMatrix_getPerspX'>getPerspX</a> <a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a>
1451
1452<a name='SkMatrix_setPerspY'></a>
1453
1454---
1455
1456<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1457void <a href='#SkMatrix_setPerspY'>setPerspY</a>(<a href='undocumented#SkScalar'>SkScalar</a> v)
1458</pre>
1459
1460Sets input y-axis perspective factor, which causes <a href='#SkMatrix_mapXY'>mapXY</a>() to vary input y-axis values
1461inversely proportional to input x-axis values.
1462
1463### Parameters
1464
1465<table>  <tr>    <td><a name='SkMatrix_setPerspY_v'><code><strong>v</strong></code></a></td>
1466    <td>perspective factor</td>
1467  </tr>
1468</table>
1469
1470### Example
1471
1472<div><fiddle-embed name="aeb258b7922c1a11b698b00f562182ec"></fiddle-embed></div>
1473
1474### See Also
1475
1476<a href='#SkMatrix_getPerspY'>getPerspY</a> <a href='#SkMatrix_set'>set</a> <a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a>
1477
1478<a name='SkMatrix_setAll'></a>
1479
1480---
1481
1482<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1483void <a href='#SkMatrix_setAll'>setAll</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleX, <a href='undocumented#SkScalar'>SkScalar</a> skewX, <a href='undocumented#SkScalar'>SkScalar</a> transX, <a href='undocumented#SkScalar'>SkScalar</a> skewY, <a href='undocumented#SkScalar'>SkScalar</a> scaleY,
1484            <a href='undocumented#SkScalar'>SkScalar</a> transY, <a href='undocumented#SkScalar'>SkScalar</a> persp0, <a href='undocumented#SkScalar'>SkScalar</a> persp1, <a href='undocumented#SkScalar'>SkScalar</a> persp2)
1485</pre>
1486
1487Sets all values from parameters. Sets <a href='SkMatrix_Reference#Matrix'>matrix</a> to:
1488
1489| <a href='#SkMatrix_setAll_scaleX'>scaleX</a>  <a href='#SkMatrix_setAll_skewX'>skewX</a> <a href='#SkMatrix_setAll_transX'>transX</a> |
1490|  <a href='#SkMatrix_setAll_skewY'>skewY</a> <a href='#SkMatrix_setAll_scaleY'>scaleY</a> <a href='#SkMatrix_setAll_transY'>transY</a> |
1491| <a href='#SkMatrix_setAll_persp0'>persp0</a> <a href='#SkMatrix_setAll_persp1'>persp1</a> <a href='#SkMatrix_setAll_persp2'>persp2</a> |
1492
1493### Parameters
1494
1495<table>  <tr>    <td><a name='SkMatrix_setAll_scaleX'><code><strong>scaleX</strong></code></a></td>
1496    <td>horizontal scale factor to store</td>
1497  </tr>
1498  <tr>    <td><a name='SkMatrix_setAll_skewX'><code><strong>skewX</strong></code></a></td>
1499    <td>horizontal skew factor to store</td>
1500  </tr>
1501  <tr>    <td><a name='SkMatrix_setAll_transX'><code><strong>transX</strong></code></a></td>
1502    <td>horizontal translation to store</td>
1503  </tr>
1504  <tr>    <td><a name='SkMatrix_setAll_skewY'><code><strong>skewY</strong></code></a></td>
1505    <td>vertical skew factor to store</td>
1506  </tr>
1507  <tr>    <td><a name='SkMatrix_setAll_scaleY'><code><strong>scaleY</strong></code></a></td>
1508    <td>vertical scale factor to store</td>
1509  </tr>
1510  <tr>    <td><a name='SkMatrix_setAll_transY'><code><strong>transY</strong></code></a></td>
1511    <td>vertical translation to store</td>
1512  </tr>
1513  <tr>    <td><a name='SkMatrix_setAll_persp0'><code><strong>persp0</strong></code></a></td>
1514    <td>input x-axis values perspective factor to store</td>
1515  </tr>
1516  <tr>    <td><a name='SkMatrix_setAll_persp1'><code><strong>persp1</strong></code></a></td>
1517    <td>input y-axis values perspective factor to store</td>
1518  </tr>
1519  <tr>    <td><a name='SkMatrix_setAll_persp2'><code><strong>persp2</strong></code></a></td>
1520    <td>perspective scale factor to store</td>
1521  </tr>
1522</table>
1523
1524### Example
1525
1526<div><fiddle-embed name="95ccfc2a89ce593e6b7a9f992a844bc0"></fiddle-embed></div>
1527
1528### See Also
1529
1530<a href='#SkMatrix_set9'>set9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a>
1531
1532<a name='SkMatrix_get9'></a>
1533
1534---
1535
1536<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1537void <a href='#SkMatrix_get9'>get9</a>(<a href='undocumented#SkScalar'>SkScalar</a> buffer[9])const
1538</pre>
1539
1540Copies nine <a href='undocumented#Scalar'>scalar</a> values contained by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> into <a href='#SkMatrix_get9_buffer'>buffer</a>, in member value
1541ascending order: <a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>,
1542<a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>, <a href='#SkMatrix_kMPersp2'>kMPersp2</a>.
1543
1544### Parameters
1545
1546<table>  <tr>    <td><a name='SkMatrix_get9_buffer'><code><strong>buffer</strong></code></a></td>
1547    <td>storage for nine <a href='undocumented#Scalar'>scalar</a> values</td>
1548  </tr>
1549</table>
1550
1551### Example
1552
1553<div><fiddle-embed name="379fc375e011050b54ed9df83c0996a7">
1554
1555#### Example Output
1556
1557~~~~
1558{4, 0, 3},
1559{0, 5, 4},
1560{0, 0, 1}
1561~~~~
1562
1563</fiddle-embed></div>
1564
1565### See Also
1566
1567<a href='#SkMatrix_set9'>set9</a>
1568
1569<a name='SkMatrix_set9'></a>
1570
1571---
1572
1573<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1574void <a href='#SkMatrix_set9'>set9</a>(const <a href='undocumented#SkScalar'>SkScalar</a> buffer[9])
1575</pre>
1576
1577Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to nine <a href='undocumented#Scalar'>scalar</a> values in <a href='#SkMatrix_set9_buffer'>buffer</a>, in member value ascending order:
1578<a href='#SkMatrix_kMScaleX'>kMScaleX</a>, <a href='#SkMatrix_kMSkewX'>kMSkewX</a>, <a href='#SkMatrix_kMTransX'>kMTransX</a>, <a href='#SkMatrix_kMSkewY'>kMSkewY</a>, <a href='#SkMatrix_kMScaleY'>kMScaleY</a>, <a href='#SkMatrix_kMTransY'>kMTransY</a>, <a href='#SkMatrix_kMPersp0'>kMPersp0</a>, <a href='#SkMatrix_kMPersp1'>kMPersp1</a>,
1579<a href='#SkMatrix_kMPersp2'>kMPersp2</a>.
1580
1581Sets <a href='SkMatrix_Reference#Matrix'>matrix</a> to:
1582
1583| <a href='#SkMatrix_set9_buffer'>buffer</a>[0] <a href='#SkMatrix_set9_buffer'>buffer</a>[1] <a href='#SkMatrix_set9_buffer'>buffer</a>[2] |
1584| <a href='#SkMatrix_set9_buffer'>buffer</a>[3] <a href='#SkMatrix_set9_buffer'>buffer</a>[4] <a href='#SkMatrix_set9_buffer'>buffer</a>[5] |
1585| <a href='#SkMatrix_set9_buffer'>buffer</a>[6] <a href='#SkMatrix_set9_buffer'>buffer</a>[7] <a href='#SkMatrix_set9_buffer'>buffer</a>[8] |
1586
1587In the future, <a href='#SkMatrix_set9'>set9</a> followed by <a href='#SkMatrix_get9'>get9</a> may not return the same values. Since <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
1588maps non-homogeneous coordinates, scaling all nine values produces an equivalent
1589transformation, possibly improving precision.
1590
1591### Parameters
1592
1593<table>  <tr>    <td><a name='SkMatrix_set9_buffer'><code><strong>buffer</strong></code></a></td>
1594    <td>nine <a href='undocumented#Scalar'>scalar</a> values</td>
1595  </tr>
1596</table>
1597
1598### Example
1599
1600<div><fiddle-embed name="ec5de0d23e5fe28ba7628625d1402e85"></fiddle-embed></div>
1601
1602### See Also
1603
1604<a href='#SkMatrix_setAll'>setAll</a> <a href='#SkMatrix_get9'>get9</a> <a href='#SkMatrix_MakeAll'>MakeAll</a>
1605
1606<a name='SkMatrix_reset'></a>
1607
1608---
1609
1610<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1611void <a href='#SkMatrix_reset'>reset()</a>
1612</pre>
1613
1614Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to identity; which has no effect on mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a>. Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
1615
1616| 1 0 0 |
1617| 0 1 0 |
1618| 0 0 1 |
1619
1620Also called <a href='#SkMatrix_setIdentity'>setIdentity</a>(); use the one that provides better inline
1621documentation.
1622
1623### Example
1624
1625<div><fiddle-embed name="ca94f7922bc37ef03bbc51ad70536fcf">
1626
1627#### Example Output
1628
1629~~~~
1630m.isIdentity(): true
1631~~~~
1632
1633</fiddle-embed></div>
1634
1635### See Also
1636
1637<a href='#SkMatrix_isIdentity'>isIdentity</a> <a href='#SkMatrix_setIdentity'>setIdentity</a>
1638
1639<a name='SkMatrix_setIdentity'></a>
1640
1641---
1642
1643<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1644void <a href='#SkMatrix_setIdentity'>setIdentity</a>()
1645</pre>
1646
1647Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to identity; which has no effect on mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a>. Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
1648
1649| 1 0 0 |
1650| 0 1 0 |
1651| 0 0 1 |
1652
1653Also called <a href='#SkMatrix_reset'>reset()</a>; use the one that provides better inline
1654documentation.
1655
1656### Example
1657
1658<div><fiddle-embed name="3979c865bb482e6ef1fafc71e56bbb91">
1659
1660#### Example Output
1661
1662~~~~
1663m.isIdentity(): true
1664~~~~
1665
1666</fiddle-embed></div>
1667
1668### See Also
1669
1670<a href='#SkMatrix_isIdentity'>isIdentity</a> <a href='#SkMatrix_reset'>reset</a>
1671
1672<a name='SkMatrix_setTranslate'></a>
1673
1674---
1675
1676<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1677void <a href='#SkMatrix_setTranslate'>setTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy)
1678</pre>
1679
1680Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to translate by (<a href='#SkMatrix_setTranslate_dx'>dx</a>, <a href='#SkMatrix_setTranslate_dy'>dy</a>).
1681
1682### Parameters
1683
1684<table>  <tr>    <td><a name='SkMatrix_setTranslate_dx'><code><strong>dx</strong></code></a></td>
1685    <td>horizontal translation</td>
1686  </tr>
1687  <tr>    <td><a name='SkMatrix_setTranslate_dy'><code><strong>dy</strong></code></a></td>
1688    <td>vertical translation</td>
1689  </tr>
1690</table>
1691
1692### Example
1693
1694<div><fiddle-embed name="63ca62985741b1bccb5e8b9cf734874e"></fiddle-embed></div>
1695
1696### See Also
1697
1698<a href='#SkMatrix_setTranslateX'>setTranslateX</a> <a href='#SkMatrix_setTranslateY'>setTranslateY</a>
1699
1700<a name='SkMatrix_setTranslate_2'></a>
1701
1702---
1703
1704<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1705void <a href='#SkMatrix_setTranslate'>setTranslate</a>(const <a href='SkPoint_Reference#SkVector'>SkVector</a>& v)
1706</pre>
1707
1708Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to translate by (<a href='#SkMatrix_setTranslate_2_v'>v</a>.<a href='#SkPoint_fX'>fX</a>, <a href='#SkMatrix_setTranslate_2_v'>v</a>.<a href='#SkPoint_fY'>fY</a>).
1709
1710### Parameters
1711
1712<table>  <tr>    <td><a name='SkMatrix_setTranslate_2_v'><code><strong>v</strong></code></a></td>
1713    <td><a href='SkPoint_Reference#Vector'>vector</a> containing horizontal and vertical translation</td>
1714  </tr>
1715</table>
1716
1717### Example
1718
1719<div><fiddle-embed name="ccfc734aff2ddea0b097c83f5621de5e"></fiddle-embed></div>
1720
1721### See Also
1722
1723<a href='#SkMatrix_setTranslateX'>setTranslateX</a> <a href='#SkMatrix_setTranslateY'>setTranslateY</a> <a href='#SkMatrix_MakeTrans'>MakeTrans</a>
1724
1725<a name='SkMatrix_setScale'></a>
1726
1727---
1728
1729<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1730void <a href='#SkMatrix_setScale'>setScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
1731</pre>
1732
1733Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to scale by <a href='#SkMatrix_setScale_sx'>sx</a> and <a href='#SkMatrix_setScale_sy'>sy</a>, about a pivot <a href='SkPoint_Reference#Point'>point</a> at (<a href='#SkMatrix_setScale_px'>px</a>, <a href='#SkMatrix_setScale_py'>py</a>).
1734The pivot <a href='SkPoint_Reference#Point'>point</a> is unchanged when mapped with <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
1735
1736### Parameters
1737
1738<table>  <tr>    <td><a name='SkMatrix_setScale_sx'><code><strong>sx</strong></code></a></td>
1739    <td>horizontal scale factor</td>
1740  </tr>
1741  <tr>    <td><a name='SkMatrix_setScale_sy'><code><strong>sy</strong></code></a></td>
1742    <td>vertical scale factor</td>
1743  </tr>
1744  <tr>    <td><a name='SkMatrix_setScale_px'><code><strong>px</strong></code></a></td>
1745    <td>pivot on x-axis</td>
1746  </tr>
1747  <tr>    <td><a name='SkMatrix_setScale_py'><code><strong>py</strong></code></a></td>
1748    <td>pivot on y-axis</td>
1749  </tr>
1750</table>
1751
1752### Example
1753
1754<div><fiddle-embed name="4565a0792058178c88e0a129a87272d6"></fiddle-embed></div>
1755
1756### See Also
1757
1758<a href='#SkMatrix_setScaleX'>setScaleX</a> <a href='#SkMatrix_setScaleY'>setScaleY</a> <a href='#SkMatrix_MakeScale'>MakeScale</a> <a href='#SkMatrix_preScale'>preScale</a> <a href='#SkMatrix_postScale'>postScale</a>
1759
1760<a name='SkMatrix_setScale_2'></a>
1761
1762---
1763
1764<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1765void <a href='#SkMatrix_setScale'>setScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy)
1766</pre>
1767
1768Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to scale by <a href='#SkMatrix_setScale_2_sx'>sx</a> and <a href='#SkMatrix_setScale_2_sy'>sy</a> about at pivot <a href='SkPoint_Reference#Point'>point</a> at (0, 0).
1769
1770### Parameters
1771
1772<table>  <tr>    <td><a name='SkMatrix_setScale_2_sx'><code><strong>sx</strong></code></a></td>
1773    <td>horizontal scale factor</td>
1774  </tr>
1775  <tr>    <td><a name='SkMatrix_setScale_2_sy'><code><strong>sy</strong></code></a></td>
1776    <td>vertical scale factor</td>
1777  </tr>
1778</table>
1779
1780### Example
1781
1782<div><fiddle-embed name="1579d0cc109c26e69f66f73abd35fb0e"></fiddle-embed></div>
1783
1784### See Also
1785
1786<a href='#SkMatrix_setScaleX'>setScaleX</a> <a href='#SkMatrix_setScaleY'>setScaleY</a> <a href='#SkMatrix_MakeScale'>MakeScale</a> <a href='#SkMatrix_preScale'>preScale</a> <a href='#SkMatrix_postScale'>postScale</a>
1787
1788<a name='SkMatrix_setRotate'></a>
1789
1790---
1791
1792<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1793void <a href='#SkMatrix_setRotate'>setRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
1794</pre>
1795
1796Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to rotate by <a href='#SkMatrix_setRotate_degrees'>degrees</a> about a pivot <a href='SkPoint_Reference#Point'>point</a> at (<a href='#SkMatrix_setRotate_px'>px</a>, <a href='#SkMatrix_setRotate_py'>py</a>).
1797The pivot <a href='SkPoint_Reference#Point'>point</a> is unchanged when mapped with <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
1798
1799Positive <a href='#SkMatrix_setRotate_degrees'>degrees</a> rotates clockwise.
1800
1801### Parameters
1802
1803<table>  <tr>    <td><a name='SkMatrix_setRotate_degrees'><code><strong>degrees</strong></code></a></td>
1804    <td>angle of axes relative to upright axes</td>
1805  </tr>
1806  <tr>    <td><a name='SkMatrix_setRotate_px'><code><strong>px</strong></code></a></td>
1807    <td>pivot on x-axis</td>
1808  </tr>
1809  <tr>    <td><a name='SkMatrix_setRotate_py'><code><strong>py</strong></code></a></td>
1810    <td>pivot on y-axis</td>
1811  </tr>
1812</table>
1813
1814### Example
1815
1816<div><fiddle-embed name="8c28db3add9cd0177225088f6df6bbb5"></fiddle-embed></div>
1817
1818### See Also
1819
1820<a href='#SkMatrix_setSinCos'>setSinCos</a> <a href='#SkMatrix_preRotate'>preRotate</a> <a href='#SkMatrix_postRotate'>postRotate</a>
1821
1822<a name='SkMatrix_setRotate_2'></a>
1823
1824---
1825
1826<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1827void <a href='#SkMatrix_setRotate'>setRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees)
1828</pre>
1829
1830Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to rotate by <a href='#SkMatrix_setRotate_2_degrees'>degrees</a> about a pivot <a href='SkPoint_Reference#Point'>point</a> at (0, 0).
1831Positive <a href='#SkMatrix_setRotate_2_degrees'>degrees</a> rotates clockwise.
1832
1833### Parameters
1834
1835<table>  <tr>    <td><a name='SkMatrix_setRotate_2_degrees'><code><strong>degrees</strong></code></a></td>
1836    <td>angle of axes relative to upright axes</td>
1837  </tr>
1838</table>
1839
1840### Example
1841
1842<div><fiddle-embed name="93efb9d191bf1b9710c173513e014d6c"></fiddle-embed></div>
1843
1844### See Also
1845
1846<a href='#SkMatrix_setSinCos'>setSinCos</a> <a href='#SkMatrix_preRotate'>preRotate</a> <a href='#SkMatrix_postRotate'>postRotate</a>
1847
1848<a name='SkMatrix_setSinCos'></a>
1849
1850---
1851
1852<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1853void <a href='#SkMatrix_setSinCos'>setSinCos</a>(<a href='undocumented#SkScalar'>SkScalar</a> sinValue, <a href='undocumented#SkScalar'>SkScalar</a> cosValue, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
1854</pre>
1855
1856Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to rotate by <a href='#SkMatrix_setSinCos_sinValue'>sinValue</a> and <a href='#SkMatrix_setSinCos_cosValue'>cosValue</a>, about a pivot <a href='SkPoint_Reference#Point'>point</a> at (<a href='#SkMatrix_setSinCos_px'>px</a>, <a href='#SkMatrix_setSinCos_py'>py</a>).
1857The pivot <a href='SkPoint_Reference#Point'>point</a> is unchanged when mapped with <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
1858
1859<a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkMatrix_setSinCos_sinValue'>sinValue</a>, <a href='#SkMatrix_setSinCos_cosValue'>cosValue</a>) describes the angle of rotation relative to (0, 1).
1860<a href='SkPoint_Reference#Vector'>Vector</a> length specifies scale.
1861
1862### Parameters
1863
1864<table>  <tr>    <td><a name='SkMatrix_setSinCos_sinValue'><code><strong>sinValue</strong></code></a></td>
1865    <td>rotation <a href='SkPoint_Reference#Vector'>vector</a> x-axis component</td>
1866  </tr>
1867  <tr>    <td><a name='SkMatrix_setSinCos_cosValue'><code><strong>cosValue</strong></code></a></td>
1868    <td>rotation <a href='SkPoint_Reference#Vector'>vector</a> y-axis component</td>
1869  </tr>
1870  <tr>    <td><a name='SkMatrix_setSinCos_px'><code><strong>px</strong></code></a></td>
1871    <td>pivot on x-axis</td>
1872  </tr>
1873  <tr>    <td><a name='SkMatrix_setSinCos_py'><code><strong>py</strong></code></a></td>
1874    <td>pivot on y-axis</td>
1875  </tr>
1876</table>
1877
1878### Example
1879
1880<div><fiddle-embed name="187e1d9228e2e4341ef820bd77b6fda9"></fiddle-embed></div>
1881
1882### See Also
1883
1884<a href='#SkMatrix_setRotate'>setRotate</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_setRSXform'>setRSXform</a>
1885
1886<a name='SkMatrix_setSinCos_2'></a>
1887
1888---
1889
1890<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1891void <a href='#SkMatrix_setSinCos'>setSinCos</a>(<a href='undocumented#SkScalar'>SkScalar</a> sinValue, <a href='undocumented#SkScalar'>SkScalar</a> cosValue)
1892</pre>
1893
1894Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to rotate by <a href='#SkMatrix_setSinCos_2_sinValue'>sinValue</a> and <a href='#SkMatrix_setSinCos_2_cosValue'>cosValue</a>, about a pivot <a href='SkPoint_Reference#Point'>point</a> at (0, 0).
1895
1896<a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkMatrix_setSinCos_2_sinValue'>sinValue</a>, <a href='#SkMatrix_setSinCos_2_cosValue'>cosValue</a>) describes the angle of rotation relative to (0, 1).
1897<a href='SkPoint_Reference#Vector'>Vector</a> length specifies scale.
1898
1899### Parameters
1900
1901<table>  <tr>    <td><a name='SkMatrix_setSinCos_2_sinValue'><code><strong>sinValue</strong></code></a></td>
1902    <td>rotation <a href='SkPoint_Reference#Vector'>vector</a> x-axis component</td>
1903  </tr>
1904  <tr>    <td><a name='SkMatrix_setSinCos_2_cosValue'><code><strong>cosValue</strong></code></a></td>
1905    <td>rotation <a href='SkPoint_Reference#Vector'>vector</a> y-axis component</td>
1906  </tr>
1907</table>
1908
1909### Example
1910
1911<div><fiddle-embed name="e37a94a53c959951b059fcd624639ef6"><div><a href='SkCanvas_Reference#Canvas'>Canvas</a> needs offset after applying <a href='SkMatrix_Reference#Matrix'>Matrix</a> to pivot about <a href='SkRect_Reference#Rect'>Rect</a> center.
1912</div></fiddle-embed></div>
1913
1914### See Also
1915
1916<a href='#SkMatrix_setRotate'>setRotate</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_setRSXform'>setRSXform</a>
1917
1918<a name='SkMatrix_setRSXform'></a>
1919
1920---
1921
1922<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1923<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_setRSXform'>setRSXform</a>(const <a href='undocumented#SkRSXform'>SkRSXform</a>& rsxForm)
1924</pre>
1925
1926Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to rotate, scale, and translate using a compressed <a href='SkMatrix_Reference#Matrix'>matrix</a> form.
1927
1928<a href='SkPoint_Reference#Vector'>Vector</a> (<a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.<a href='#SkRSXform_fSSin'>fSSin</a>, <a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.<a href='#SkRSXform_fSCos'>fSCos</a>) describes the angle of rotation relative
1929to (0, 1). <a href='SkPoint_Reference#Vector'>Vector</a> length specifies scale. Mapped <a href='SkPoint_Reference#Point'>point</a> is rotated and scaled
1930by <a href='SkPoint_Reference#Vector'>vector</a>, then translated by (<a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.<a href='#SkRSXform_fTx'>fTx</a>, <a href='#SkMatrix_setRSXform_rsxForm'>rsxForm</a>.<a href='#SkRSXform_fTy'>fTy</a>).
1931
1932### Parameters
1933
1934<table>  <tr>    <td><a name='SkMatrix_setRSXform_rsxForm'><code><strong>rsxForm</strong></code></a></td>
1935    <td>compressed <a href='undocumented#SkRSXform'>SkRSXform</a> <a href='SkMatrix_Reference#Matrix'>matrix</a></td>
1936  </tr>
1937</table>
1938
1939### Return Value
1940
1941reference to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
1942
1943### Example
1944
1945<div><fiddle-embed name="c3f5faddca466f78278b32b88fd5f5eb"><div><a href='SkCanvas_Reference#Canvas'>Canvas</a> needs offset after applying <a href='SkMatrix_Reference#Matrix'>Matrix</a> to pivot about <a href='SkRect_Reference#Rect'>Rect</a> center.
1946</div></fiddle-embed></div>
1947
1948### See Also
1949
1950<a href='#SkMatrix_setSinCos'>setSinCos</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_setTranslate'>setTranslate</a>
1951
1952<a name='SkMatrix_setSkew'></a>
1953
1954---
1955
1956<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1957void <a href='#SkMatrix_setSkew'>setSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
1958</pre>
1959
1960Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to skew by <a href='#SkMatrix_setSkew_kx'>kx</a> and <a href='#SkMatrix_setSkew_ky'>ky</a>, about a pivot <a href='SkPoint_Reference#Point'>point</a> at (<a href='#SkMatrix_setSkew_px'>px</a>, <a href='#SkMatrix_setSkew_py'>py</a>).
1961The pivot <a href='SkPoint_Reference#Point'>point</a> is unchanged when mapped with <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
1962
1963### Parameters
1964
1965<table>  <tr>    <td><a name='SkMatrix_setSkew_kx'><code><strong>kx</strong></code></a></td>
1966    <td>horizontal skew factor</td>
1967  </tr>
1968  <tr>    <td><a name='SkMatrix_setSkew_ky'><code><strong>ky</strong></code></a></td>
1969    <td>vertical skew factor</td>
1970  </tr>
1971  <tr>    <td><a name='SkMatrix_setSkew_px'><code><strong>px</strong></code></a></td>
1972    <td>pivot on x-axis</td>
1973  </tr>
1974  <tr>    <td><a name='SkMatrix_setSkew_py'><code><strong>py</strong></code></a></td>
1975    <td>pivot on y-axis</td>
1976  </tr>
1977</table>
1978
1979### Example
1980
1981<div><fiddle-embed name="55e0431adc6c5b1987ebb8123cc10342"></fiddle-embed></div>
1982
1983### See Also
1984
1985<a href='#SkMatrix_setSkewX'>setSkewX</a> <a href='#SkMatrix_setSkewY'>setSkewY</a> <a href='#SkMatrix_preSkew'>preSkew</a> <a href='#SkMatrix_postSkew'>postSkew</a>
1986
1987<a name='SkMatrix_setSkew_2'></a>
1988
1989---
1990
1991<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
1992void <a href='#SkMatrix_setSkew'>setSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky)
1993</pre>
1994
1995Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to skew by <a href='#SkMatrix_setSkew_2_kx'>kx</a> and <a href='#SkMatrix_setSkew_2_ky'>ky</a>, about a pivot <a href='SkPoint_Reference#Point'>point</a> at (0, 0).
1996
1997### Parameters
1998
1999<table>  <tr>    <td><a name='SkMatrix_setSkew_2_kx'><code><strong>kx</strong></code></a></td>
2000    <td>horizontal skew factor</td>
2001  </tr>
2002  <tr>    <td><a name='SkMatrix_setSkew_2_ky'><code><strong>ky</strong></code></a></td>
2003    <td>vertical skew factor</td>
2004  </tr>
2005</table>
2006
2007### Example
2008
2009<div><fiddle-embed name="05be7844e9afdd7b9bfc31c5423a70a2"></fiddle-embed></div>
2010
2011### See Also
2012
2013<a href='#SkMatrix_setSkewX'>setSkewX</a> <a href='#SkMatrix_setSkewY'>setSkewY</a> <a href='#SkMatrix_preSkew'>preSkew</a> <a href='#SkMatrix_postSkew'>postSkew</a>
2014
2015<a name='SkMatrix_setConcat'></a>
2016
2017---
2018
2019<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2020void <a href='#SkMatrix_setConcat'>setConcat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b)
2021</pre>
2022
2023Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_setConcat_a'>a</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_setConcat_b'>b</a>. Either <a href='#SkMatrix_setConcat_a'>a</a> or <a href='#SkMatrix_setConcat_b'>b</a> may be this.
2024
2025Given:
2026
2027| A B C |      | J K L |
2028<a href='#SkMatrix_setConcat_a'>a</a> = | D E F |, <a href='#SkMatrix_setConcat_b'>b</a> = | M N O |
2029| G H <a href='#SkMatrix_I'>I</a> |      | P Q R |
2030
2031sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2032
2033| A B C |   | J K L |   | AJ+BM+CP AK+BN+CQ AL+BO+CR |
2034<a href='#SkMatrix_setConcat_a'>a</a> * <a href='#SkMatrix_setConcat_b'>b</a> = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
2035| G H <a href='#SkMatrix_I'>I</a> |   | P Q R |   | GJ+HM+IP GK+HN+IQ GL+HO+IR |
2036
2037### Parameters
2038
2039<table>  <tr>    <td><a name='SkMatrix_setConcat_a'><code><strong>a</strong></code></a></td>
2040    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> on  left side of multiply expression</td>
2041  </tr>
2042  <tr>    <td><a name='SkMatrix_setConcat_b'><code><strong>b</strong></code></a></td>
2043    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> on  right side of multiply expression</td>
2044  </tr>
2045</table>
2046
2047### Example
2048
2049<div><fiddle-embed name="0381a10ac69bdefdf9d15b47cbb9fefe"><div><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> creates perspective <a href='SkMatrix_Reference#Matrix'>matrices</a>, one the inverse of the other.
2050Multiplying the <a href='SkMatrix_Reference#Matrix'>matrix</a> by its inverse turns into an identity <a href='SkMatrix_Reference#Matrix'>matrix</a>.
2051</div></fiddle-embed></div>
2052
2053### See Also
2054
2055<a href='#SkMatrix_Concat'>Concat</a> <a href='#SkMatrix_preConcat'>preConcat</a> <a href='#SkMatrix_postConcat'>postConcat</a> <a href='SkCanvas_Reference#SkCanvas'>SkCanvas</a>::<a href='#SkCanvas_concat'>concat</a>
2056
2057<a name='SkMatrix_preTranslate'></a>
2058
2059---
2060
2061<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2062void <a href='#SkMatrix_preTranslate'>preTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy)
2063</pre>
2064
2065Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from translation (<a href='#SkMatrix_preTranslate_dx'>dx</a>, <a href='#SkMatrix_preTranslate_dy'>dy</a>).
2066This can be thought of as moving the <a href='SkPoint_Reference#Point'>point</a> to be mapped before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2067
2068Given:
2069
2070| A B C |               | 1 0 <a href='#SkMatrix_preTranslate_dx'>dx</a> |
2071<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  T(<a href='#SkMatrix_preTranslate_dx'>dx</a>, <a href='#SkMatrix_preTranslate_dy'>dy</a>) = | 0 1 <a href='#SkMatrix_preTranslate_dy'>dy</a> |
2072| G H <a href='#SkMatrix_I'>I</a> |               | 0 0  1 |
2073
2074sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2075
2076| A B C | | 1 0 <a href='#SkMatrix_preTranslate_dx'>dx</a> |   | A B A*<a href='#SkMatrix_preTranslate_dx'>dx</a>+B*<a href='#SkMatrix_preTranslate_dy'>dy</a>+C |
2077<a href='SkMatrix_Reference#Matrix'>Matrix</a> * T(<a href='#SkMatrix_preTranslate_dx'>dx</a>, <a href='#SkMatrix_preTranslate_dy'>dy</a>) = | D E F | | 0 1 <a href='#SkMatrix_preTranslate_dy'>dy</a> | = | D E D*<a href='#SkMatrix_preTranslate_dx'>dx</a>+E*<a href='#SkMatrix_preTranslate_dy'>dy</a>+F |
2078| G H <a href='#SkMatrix_I'>I</a> | | 0 0  1 |   | G H G*<a href='#SkMatrix_preTranslate_dx'>dx</a>+H*<a href='#SkMatrix_preTranslate_dy'>dy</a>+<a href='#SkMatrix_I'>I</a> |
2079
2080### Parameters
2081
2082<table>  <tr>    <td><a name='SkMatrix_preTranslate_dx'><code><strong>dx</strong></code></a></td>
2083    <td>x-axis translation before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a></td>
2084  </tr>
2085  <tr>    <td><a name='SkMatrix_preTranslate_dy'><code><strong>dy</strong></code></a></td>
2086    <td>y-axis translation before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a></td>
2087  </tr>
2088</table>
2089
2090### Example
2091
2092<div><fiddle-embed name="f75a9b629aa6c51ed888f8799b5ba5f7"></fiddle-embed></div>
2093
2094### See Also
2095
2096<a href='#SkMatrix_postTranslate'>postTranslate</a> <a href='#SkMatrix_setTranslate'>setTranslate</a> <a href='#SkMatrix_MakeTrans'>MakeTrans</a>
2097
2098<a name='SkMatrix_preScale'></a>
2099
2100---
2101
2102<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2103void <a href='#SkMatrix_preScale'>preScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
2104</pre>
2105
2106Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from scaling by (<a href='#SkMatrix_preScale_sx'>sx</a>, <a href='#SkMatrix_preScale_sy'>sy</a>)
2107about pivot <a href='SkPoint_Reference#Point'>point</a> (<a href='#SkMatrix_preScale_px'>px</a>, <a href='#SkMatrix_preScale_py'>py</a>).
2108This can be thought of as scaling about a pivot <a href='SkPoint_Reference#Point'>point</a> before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2109
2110Given:
2111
2112| A B C |                       | <a href='#SkMatrix_preScale_sx'>sx</a>  0 dx |
2113<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  S(<a href='#SkMatrix_preScale_sx'>sx</a>, <a href='#SkMatrix_preScale_sy'>sy</a>, <a href='#SkMatrix_preScale_px'>px</a>, <a href='#SkMatrix_preScale_py'>py</a>) = |  0 <a href='#SkMatrix_preScale_sy'>sy</a> dy |
2114| G H <a href='#SkMatrix_I'>I</a> |                       |  0  0  1 |
2115
2116where
2117
2118dx = <a href='#SkMatrix_preScale_px'>px</a> - <a href='#SkMatrix_preScale_sx'>sx</a> * <a href='#SkMatrix_preScale_px'>px</a>
2119dy = <a href='#SkMatrix_preScale_py'>py</a> - <a href='#SkMatrix_preScale_sy'>sy</a> * <a href='#SkMatrix_preScale_py'>py</a>
2120
2121sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2122
2123| A B C | | <a href='#SkMatrix_preScale_sx'>sx</a>  0 dx |   | A*<a href='#SkMatrix_preScale_sx'>sx</a> B*<a href='#SkMatrix_preScale_sy'>sy</a> A*dx+B*dy+C |
2124<a href='SkMatrix_Reference#Matrix'>Matrix</a> * S(<a href='#SkMatrix_preScale_sx'>sx</a>, <a href='#SkMatrix_preScale_sy'>sy</a>, <a href='#SkMatrix_preScale_px'>px</a>, <a href='#SkMatrix_preScale_py'>py</a>) = | D E F | |  0 <a href='#SkMatrix_preScale_sy'>sy</a> dy | = | D*<a href='#SkMatrix_preScale_sx'>sx</a> E*<a href='#SkMatrix_preScale_sy'>sy</a> D*dx+E*dy+F |
2125| G H <a href='#SkMatrix_I'>I</a> | |  0  0  1 |   | G*<a href='#SkMatrix_preScale_sx'>sx</a> H*<a href='#SkMatrix_preScale_sy'>sy</a> G*dx+H*dy+<a href='#SkMatrix_I'>I</a> |
2126
2127### Parameters
2128
2129<table>  <tr>    <td><a name='SkMatrix_preScale_sx'><code><strong>sx</strong></code></a></td>
2130    <td>horizontal scale factor</td>
2131  </tr>
2132  <tr>    <td><a name='SkMatrix_preScale_sy'><code><strong>sy</strong></code></a></td>
2133    <td>vertical scale factor</td>
2134  </tr>
2135  <tr>    <td><a name='SkMatrix_preScale_px'><code><strong>px</strong></code></a></td>
2136    <td>pivot on x-axis</td>
2137  </tr>
2138  <tr>    <td><a name='SkMatrix_preScale_py'><code><strong>py</strong></code></a></td>
2139    <td>pivot on y-axis</td>
2140  </tr>
2141</table>
2142
2143### Example
2144
2145<div><fiddle-embed name="2531f8d1e05d7b6dc22f3efcd2fb84e4"></fiddle-embed></div>
2146
2147### See Also
2148
2149<a href='#SkMatrix_postScale'>postScale</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>
2150
2151<a name='SkMatrix_preScale_2'></a>
2152
2153---
2154
2155<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2156void <a href='#SkMatrix_preScale'>preScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy)
2157</pre>
2158
2159Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from scaling by (<a href='#SkMatrix_preScale_2_sx'>sx</a>, <a href='#SkMatrix_preScale_2_sy'>sy</a>)
2160about pivot <a href='SkPoint_Reference#Point'>point</a> (0, 0).
2161This can be thought of as scaling about the origin before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2162
2163Given:
2164
2165| A B C |               | <a href='#SkMatrix_preScale_2_sx'>sx</a>  0  0 |
2166<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  S(<a href='#SkMatrix_preScale_2_sx'>sx</a>, <a href='#SkMatrix_preScale_2_sy'>sy</a>) = |  0 <a href='#SkMatrix_preScale_2_sy'>sy</a>  0 |
2167| G H <a href='#SkMatrix_I'>I</a> |               |  0  0  1 |
2168
2169sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2170
2171| A B C | | <a href='#SkMatrix_preScale_2_sx'>sx</a>  0  0 |   | A*<a href='#SkMatrix_preScale_2_sx'>sx</a> B*<a href='#SkMatrix_preScale_2_sy'>sy</a> C |
2172<a href='SkMatrix_Reference#Matrix'>Matrix</a> * S(<a href='#SkMatrix_preScale_2_sx'>sx</a>, <a href='#SkMatrix_preScale_2_sy'>sy</a>) = | D E F | |  0 <a href='#SkMatrix_preScale_2_sy'>sy</a>  0 | = | D*<a href='#SkMatrix_preScale_2_sx'>sx</a> E*<a href='#SkMatrix_preScale_2_sy'>sy</a> F |
2173| G H <a href='#SkMatrix_I'>I</a> | |  0  0  1 |   | G*<a href='#SkMatrix_preScale_2_sx'>sx</a> H*<a href='#SkMatrix_preScale_2_sy'>sy</a> <a href='#SkMatrix_I'>I</a> |
2174
2175### Parameters
2176
2177<table>  <tr>    <td><a name='SkMatrix_preScale_2_sx'><code><strong>sx</strong></code></a></td>
2178    <td>horizontal scale factor</td>
2179  </tr>
2180  <tr>    <td><a name='SkMatrix_preScale_2_sy'><code><strong>sy</strong></code></a></td>
2181    <td>vertical scale factor</td>
2182  </tr>
2183</table>
2184
2185### Example
2186
2187<div><fiddle-embed name="3edbdea8e43d06086abf33ec4a9b415b"></fiddle-embed></div>
2188
2189### See Also
2190
2191<a href='#SkMatrix_postScale'>postScale</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>
2192
2193<a name='SkMatrix_preRotate'></a>
2194
2195---
2196
2197<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2198void <a href='#SkMatrix_preRotate'>preRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
2199</pre>
2200
2201Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from rotating by <a href='#SkMatrix_preRotate_degrees'>degrees</a>
2202about pivot <a href='SkPoint_Reference#Point'>point</a> (<a href='#SkMatrix_preRotate_px'>px</a>, <a href='#SkMatrix_preRotate_py'>py</a>).
2203This can be thought of as rotating about a pivot <a href='SkPoint_Reference#Point'>point</a> before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2204
2205Positive <a href='#SkMatrix_preRotate_degrees'>degrees</a> rotates clockwise.
2206
2207Given:
2208
2209| A B C |                        | c -s dx |
2210<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  R(<a href='#SkMatrix_preRotate_degrees'>degrees</a>, <a href='#SkMatrix_preRotate_px'>px</a>, <a href='#SkMatrix_preRotate_py'>py</a>) = | s  c dy |
2211| G H <a href='#SkMatrix_I'>I</a> |                        | 0  0  1 |
2212
2213where
2214
2215c  = cos(<a href='#SkMatrix_preRotate_degrees'>degrees</a>)
2216s  = sin(<a href='#SkMatrix_preRotate_degrees'>degrees</a>)
2217dx =  s * <a href='#SkMatrix_preRotate_py'>py</a> + (1 - c) * <a href='#SkMatrix_preRotate_px'>px</a>
2218dy = -s * <a href='#SkMatrix_preRotate_px'>px</a> + (1 - c) * <a href='#SkMatrix_preRotate_py'>py</a>
2219
2220sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2221
2222| A B C | | c -s dx |   | Ac+Bs -As+Bc A*dx+B*dy+C |
2223<a href='SkMatrix_Reference#Matrix'>Matrix</a> * R(<a href='#SkMatrix_preRotate_degrees'>degrees</a>, <a href='#SkMatrix_preRotate_px'>px</a>, <a href='#SkMatrix_preRotate_py'>py</a>) = | D E F | | s  c dy | = | Dc+Es -Ds+Ec D*dx+E*dy+F |
2224| G H <a href='#SkMatrix_I'>I</a> | | 0  0  1 |   | Gc+Hs -Gs+Hc G*dx+H*dy+<a href='#SkMatrix_I'>I</a> |
2225
2226### Parameters
2227
2228<table>  <tr>    <td><a name='SkMatrix_preRotate_degrees'><code><strong>degrees</strong></code></a></td>
2229    <td>angle of axes relative to upright axes</td>
2230  </tr>
2231  <tr>    <td><a name='SkMatrix_preRotate_px'><code><strong>px</strong></code></a></td>
2232    <td>pivot on x-axis</td>
2233  </tr>
2234  <tr>    <td><a name='SkMatrix_preRotate_py'><code><strong>py</strong></code></a></td>
2235    <td>pivot on y-axis</td>
2236  </tr>
2237</table>
2238
2239### Example
2240
2241<div><fiddle-embed name="a70bb18d67c06a20ab514e7a47924e5a"></fiddle-embed></div>
2242
2243### See Also
2244
2245<a href='#SkMatrix_postRotate'>postRotate</a> <a href='#SkMatrix_setRotate'>setRotate</a>
2246
2247<a name='SkMatrix_preRotate_2'></a>
2248
2249---
2250
2251<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2252void <a href='#SkMatrix_preRotate'>preRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees)
2253</pre>
2254
2255Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from rotating by <a href='#SkMatrix_preRotate_2_degrees'>degrees</a>
2256about pivot <a href='SkPoint_Reference#Point'>point</a> (0, 0).
2257This can be thought of as rotating about the origin before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2258
2259Positive <a href='#SkMatrix_preRotate_2_degrees'>degrees</a> rotates clockwise.
2260
2261Given:
2262
2263| A B C |                        | c -s 0 |
2264<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  R(<a href='#SkMatrix_preRotate_2_degrees'>degrees</a>, px, py) = | s  c 0 |
2265| G H <a href='#SkMatrix_I'>I</a> |                        | 0  0 1 |
2266
2267where
2268
2269c  = cos(<a href='#SkMatrix_preRotate_2_degrees'>degrees</a>)
2270s  = sin(<a href='#SkMatrix_preRotate_2_degrees'>degrees</a>)
2271
2272sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2273
2274| A B C | | c -s 0 |   | Ac+Bs -As+Bc C |
2275<a href='SkMatrix_Reference#Matrix'>Matrix</a> * R(<a href='#SkMatrix_preRotate_2_degrees'>degrees</a>, px, py) = | D E F | | s  c 0 | = | Dc+Es -Ds+Ec F |
2276| G H <a href='#SkMatrix_I'>I</a> | | 0  0 1 |   | Gc+Hs -Gs+Hc <a href='#SkMatrix_I'>I</a> |
2277
2278### Parameters
2279
2280<table>  <tr>    <td><a name='SkMatrix_preRotate_2_degrees'><code><strong>degrees</strong></code></a></td>
2281    <td>angle of axes relative to upright axes</td>
2282  </tr>
2283</table>
2284
2285### Example
2286
2287<div><fiddle-embed name="5acd49bd931c79a808dd6c7cc0e92f72"></fiddle-embed></div>
2288
2289### See Also
2290
2291<a href='#SkMatrix_postRotate'>postRotate</a> <a href='#SkMatrix_setRotate'>setRotate</a>
2292
2293<a name='SkMatrix_preSkew'></a>
2294
2295---
2296
2297<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2298void <a href='#SkMatrix_preSkew'>preSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
2299</pre>
2300
2301Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from skewing by (<a href='#SkMatrix_preSkew_kx'>kx</a>, <a href='#SkMatrix_preSkew_ky'>ky</a>)
2302about pivot <a href='SkPoint_Reference#Point'>point</a> (<a href='#SkMatrix_preSkew_px'>px</a>, <a href='#SkMatrix_preSkew_py'>py</a>).
2303This can be thought of as skewing about a pivot <a href='SkPoint_Reference#Point'>point</a> before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2304
2305Given:
2306
2307| A B C |                       |  1 <a href='#SkMatrix_preSkew_kx'>kx</a> dx |
2308<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  K(<a href='#SkMatrix_preSkew_kx'>kx</a>, <a href='#SkMatrix_preSkew_ky'>ky</a>, <a href='#SkMatrix_preSkew_px'>px</a>, <a href='#SkMatrix_preSkew_py'>py</a>) = | <a href='#SkMatrix_preSkew_ky'>ky</a>  1 dy |
2309| G H <a href='#SkMatrix_I'>I</a> |                       |  0  0  1 |
2310
2311where
2312
2313dx = -<a href='#SkMatrix_preSkew_kx'>kx</a> * <a href='#SkMatrix_preSkew_py'>py</a>
2314dy = -<a href='#SkMatrix_preSkew_ky'>ky</a> * <a href='#SkMatrix_preSkew_px'>px</a>
2315
2316sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2317
2318| A B C | |  1 <a href='#SkMatrix_preSkew_kx'>kx</a> dx |   | A+B*<a href='#SkMatrix_preSkew_ky'>ky</a> A*<a href='#SkMatrix_preSkew_kx'>kx</a>+B A*dx+B*dy+C |
2319<a href='SkMatrix_Reference#Matrix'>Matrix</a> * K(<a href='#SkMatrix_preSkew_kx'>kx</a>, <a href='#SkMatrix_preSkew_ky'>ky</a>, <a href='#SkMatrix_preSkew_px'>px</a>, <a href='#SkMatrix_preSkew_py'>py</a>) = | D E F | | <a href='#SkMatrix_preSkew_ky'>ky</a>  1 dy | = | D+E*<a href='#SkMatrix_preSkew_ky'>ky</a> D*<a href='#SkMatrix_preSkew_kx'>kx</a>+E D*dx+E*dy+F |
2320| G H <a href='#SkMatrix_I'>I</a> | |  0  0  1 |   | G+H*<a href='#SkMatrix_preSkew_ky'>ky</a> G*<a href='#SkMatrix_preSkew_kx'>kx</a>+H G*dx+H*dy+<a href='#SkMatrix_I'>I</a> |
2321
2322### Parameters
2323
2324<table>  <tr>    <td><a name='SkMatrix_preSkew_kx'><code><strong>kx</strong></code></a></td>
2325    <td>horizontal skew factor</td>
2326  </tr>
2327  <tr>    <td><a name='SkMatrix_preSkew_ky'><code><strong>ky</strong></code></a></td>
2328    <td>vertical skew factor</td>
2329  </tr>
2330  <tr>    <td><a name='SkMatrix_preSkew_px'><code><strong>px</strong></code></a></td>
2331    <td>pivot on x-axis</td>
2332  </tr>
2333  <tr>    <td><a name='SkMatrix_preSkew_py'><code><strong>py</strong></code></a></td>
2334    <td>pivot on y-axis</td>
2335  </tr>
2336</table>
2337
2338### Example
2339
2340<div><fiddle-embed name="199a18ad61d702664ce6df1d7037aa48"></fiddle-embed></div>
2341
2342### See Also
2343
2344<a href='#SkMatrix_postSkew'>postSkew</a> <a href='#SkMatrix_setSkew'>setSkew</a>
2345
2346<a name='SkMatrix_preSkew_2'></a>
2347
2348---
2349
2350<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2351void <a href='#SkMatrix_preSkew'>preSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky)
2352</pre>
2353
2354Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from skewing by (<a href='#SkMatrix_preSkew_2_kx'>kx</a>, <a href='#SkMatrix_preSkew_2_ky'>ky</a>)
2355about pivot <a href='SkPoint_Reference#Point'>point</a> (0, 0).
2356This can be thought of as skewing about the origin before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2357
2358Given:
2359
2360| A B C |               |  1 <a href='#SkMatrix_preSkew_2_kx'>kx</a> 0 |
2361<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  K(<a href='#SkMatrix_preSkew_2_kx'>kx</a>, <a href='#SkMatrix_preSkew_2_ky'>ky</a>) = | <a href='#SkMatrix_preSkew_2_ky'>ky</a>  1 0 |
2362| G H <a href='#SkMatrix_I'>I</a> |               |  0  0 1 |
2363
2364sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2365
2366| A B C | |  1 <a href='#SkMatrix_preSkew_2_kx'>kx</a> 0 |   | A+B*<a href='#SkMatrix_preSkew_2_ky'>ky</a> A*<a href='#SkMatrix_preSkew_2_kx'>kx</a>+B C |
2367<a href='SkMatrix_Reference#Matrix'>Matrix</a> * K(<a href='#SkMatrix_preSkew_2_kx'>kx</a>, <a href='#SkMatrix_preSkew_2_ky'>ky</a>) = | D E F | | <a href='#SkMatrix_preSkew_2_ky'>ky</a>  1 0 | = | D+E*<a href='#SkMatrix_preSkew_2_ky'>ky</a> D*<a href='#SkMatrix_preSkew_2_kx'>kx</a>+E F |
2368| G H <a href='#SkMatrix_I'>I</a> | |  0  0 1 |   | G+H*<a href='#SkMatrix_preSkew_2_ky'>ky</a> G*<a href='#SkMatrix_preSkew_2_kx'>kx</a>+H <a href='#SkMatrix_I'>I</a> |
2369
2370### Parameters
2371
2372<table>  <tr>    <td><a name='SkMatrix_preSkew_2_kx'><code><strong>kx</strong></code></a></td>
2373    <td>horizontal skew factor</td>
2374  </tr>
2375  <tr>    <td><a name='SkMatrix_preSkew_2_ky'><code><strong>ky</strong></code></a></td>
2376    <td>vertical skew factor</td>
2377  </tr>
2378</table>
2379
2380### Example
2381
2382<div><fiddle-embed name="e100c543869fe8fd516ba69de79444ba"></fiddle-embed></div>
2383
2384### See Also
2385
2386<a href='#SkMatrix_postSkew'>postSkew</a> <a href='#SkMatrix_setSkew'>setSkew</a>
2387
2388<a name='SkMatrix_preConcat'></a>
2389
2390---
2391
2392<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2393void <a href='#SkMatrix_preConcat'>preConcat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& other)
2394</pre>
2395
2396Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_preConcat_other'>other</a>.
2397This can be thought of mapping by <a href='#SkMatrix_preConcat_other'>other</a> before applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2398
2399Given:
2400
2401| A B C |          | J K L |
2402<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |, <a href='#SkMatrix_preConcat_other'>other</a> = | M N O |
2403| G H <a href='#SkMatrix_I'>I</a> |          | P Q R |
2404
2405sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2406
2407| A B C |   | J K L |   | AJ+BM+CP AK+BN+CQ AL+BO+CR |
2408<a href='SkMatrix_Reference#Matrix'>Matrix</a> * <a href='#SkMatrix_preConcat_other'>other</a> = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
2409| G H <a href='#SkMatrix_I'>I</a> |   | P Q R |   | GJ+HM+IP GK+HN+IQ GL+HO+IR |
2410
2411### Parameters
2412
2413<table>  <tr>    <td><a name='SkMatrix_preConcat_other'><code><strong>other</strong></code></a></td>
2414    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> on  right side of multiply expression</td>
2415  </tr>
2416</table>
2417
2418### Example
2419
2420<div><fiddle-embed name="b07e62298e7b0ab5683db199faffceb2"><div><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> creates perspective <a href='SkMatrix_Reference#Matrix'>matrices</a>, one the inverse of the <a href='#SkMatrix_preConcat_other'>other</a>.
2421Multiplying the <a href='SkMatrix_Reference#Matrix'>matrix</a> by its inverse turns into an identity <a href='SkMatrix_Reference#Matrix'>matrix</a>.
2422</div></fiddle-embed></div>
2423
2424### See Also
2425
2426<a href='#SkMatrix_postConcat'>postConcat</a> <a href='#SkMatrix_setConcat'>setConcat</a> <a href='#SkMatrix_Concat'>Concat</a>
2427
2428<a name='SkMatrix_postTranslate'></a>
2429
2430---
2431
2432<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2433void <a href='#SkMatrix_postTranslate'>postTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy)
2434</pre>
2435
2436Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from translation (<a href='#SkMatrix_postTranslate_dx'>dx</a>, <a href='#SkMatrix_postTranslate_dy'>dy</a>) multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2437This can be thought of as moving the <a href='SkPoint_Reference#Point'>point</a> to be mapped after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2438
2439Given:
2440
2441| J K L |               | 1 0 <a href='#SkMatrix_postTranslate_dx'>dx</a> |
2442<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  T(<a href='#SkMatrix_postTranslate_dx'>dx</a>, <a href='#SkMatrix_postTranslate_dy'>dy</a>) = | 0 1 <a href='#SkMatrix_postTranslate_dy'>dy</a> |
2443| P Q R |               | 0 0  1 |
2444
2445sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2446
2447| 1 0 <a href='#SkMatrix_postTranslate_dx'>dx</a> | | J K L |   | J+<a href='#SkMatrix_postTranslate_dx'>dx</a>*P K+<a href='#SkMatrix_postTranslate_dx'>dx</a>*Q L+<a href='#SkMatrix_postTranslate_dx'>dx</a>*R |
2448T(<a href='#SkMatrix_postTranslate_dx'>dx</a>, <a href='#SkMatrix_postTranslate_dy'>dy</a>) * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = | 0 1 <a href='#SkMatrix_postTranslate_dy'>dy</a> | | M N O | = | M+<a href='#SkMatrix_postTranslate_dy'>dy</a>*P N+<a href='#SkMatrix_postTranslate_dy'>dy</a>*Q O+<a href='#SkMatrix_postTranslate_dy'>dy</a>*R |
2449| 0 0  1 | | P Q R |   |      P      Q      R |
2450
2451### Parameters
2452
2453<table>  <tr>    <td><a name='SkMatrix_postTranslate_dx'><code><strong>dx</strong></code></a></td>
2454    <td>x-axis translation after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a></td>
2455  </tr>
2456  <tr>    <td><a name='SkMatrix_postTranslate_dy'><code><strong>dy</strong></code></a></td>
2457    <td>y-axis translation after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a></td>
2458  </tr>
2459</table>
2460
2461### Example
2462
2463<div><fiddle-embed name="f5144ef4bd7cea294fad2f756ed335af"><div>Compare with <a href='#SkMatrix_preTranslate'>preTranslate</a> example.
2464</div></fiddle-embed></div>
2465
2466### See Also
2467
2468<a href='#SkMatrix_preTranslate'>preTranslate</a> <a href='#SkMatrix_setTranslate'>setTranslate</a> <a href='#SkMatrix_MakeTrans'>MakeTrans</a>
2469
2470<a name='SkMatrix_postScale'></a>
2471
2472---
2473
2474<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2475void <a href='#SkMatrix_postScale'>postScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
2476</pre>
2477
2478Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from scaling by (<a href='#SkMatrix_postScale_sx'>sx</a>, <a href='#SkMatrix_postScale_sy'>sy</a>) about pivot <a href='SkPoint_Reference#Point'>point</a>
2479(<a href='#SkMatrix_postScale_px'>px</a>, <a href='#SkMatrix_postScale_py'>py</a>), multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2480This can be thought of as scaling about a pivot <a href='SkPoint_Reference#Point'>point</a> after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2481
2482Given:
2483
2484| J K L |                       | <a href='#SkMatrix_postScale_sx'>sx</a>  0 dx |
2485<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  S(<a href='#SkMatrix_postScale_sx'>sx</a>, <a href='#SkMatrix_postScale_sy'>sy</a>, <a href='#SkMatrix_postScale_px'>px</a>, <a href='#SkMatrix_postScale_py'>py</a>) = |  0 <a href='#SkMatrix_postScale_sy'>sy</a> dy |
2486| P Q R |                       |  0  0  1 |
2487
2488where
2489
2490dx = <a href='#SkMatrix_postScale_px'>px</a> - <a href='#SkMatrix_postScale_sx'>sx</a> * <a href='#SkMatrix_postScale_px'>px</a>
2491dy = <a href='#SkMatrix_postScale_py'>py</a> - <a href='#SkMatrix_postScale_sy'>sy</a> * <a href='#SkMatrix_postScale_py'>py</a>
2492
2493sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2494
2495| <a href='#SkMatrix_postScale_sx'>sx</a>  0 dx | | J K L |   | <a href='#SkMatrix_postScale_sx'>sx</a>*J+dx*P <a href='#SkMatrix_postScale_sx'>sx</a>*K+dx*Q <a href='#SkMatrix_postScale_sx'>sx</a>*L+dx+R |
2496S(<a href='#SkMatrix_postScale_sx'>sx</a>, <a href='#SkMatrix_postScale_sy'>sy</a>, <a href='#SkMatrix_postScale_px'>px</a>, <a href='#SkMatrix_postScale_py'>py</a>) * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = |  0 <a href='#SkMatrix_postScale_sy'>sy</a> dy | | M N O | = | <a href='#SkMatrix_postScale_sy'>sy</a>*M+dy*P <a href='#SkMatrix_postScale_sy'>sy</a>*N+dy*Q <a href='#SkMatrix_postScale_sy'>sy</a>*O+dy*R |
2497|  0  0  1 | | P Q R |   |         P         Q         R |
2498
2499### Parameters
2500
2501<table>  <tr>    <td><a name='SkMatrix_postScale_sx'><code><strong>sx</strong></code></a></td>
2502    <td>horizontal scale factor</td>
2503  </tr>
2504  <tr>    <td><a name='SkMatrix_postScale_sy'><code><strong>sy</strong></code></a></td>
2505    <td>vertical scale factor</td>
2506  </tr>
2507  <tr>    <td><a name='SkMatrix_postScale_px'><code><strong>px</strong></code></a></td>
2508    <td>pivot on x-axis</td>
2509  </tr>
2510  <tr>    <td><a name='SkMatrix_postScale_py'><code><strong>py</strong></code></a></td>
2511    <td>pivot on y-axis</td>
2512  </tr>
2513</table>
2514
2515### Example
2516
2517<div><fiddle-embed name="ed3aa18ba0ea95c85cc49aa3829fe384"></fiddle-embed></div>
2518
2519### See Also
2520
2521<a href='#SkMatrix_preScale'>preScale</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>
2522
2523<a name='SkMatrix_postScale_2'></a>
2524
2525---
2526
2527<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2528void <a href='#SkMatrix_postScale'>postScale</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy)
2529</pre>
2530
2531Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from scaling by (<a href='#SkMatrix_postScale_2_sx'>sx</a>, <a href='#SkMatrix_postScale_2_sy'>sy</a>) about pivot <a href='SkPoint_Reference#Point'>point</a>
2532(0, 0), multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2533This can be thought of as scaling about the origin after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2534
2535Given:
2536
2537| J K L |               | <a href='#SkMatrix_postScale_2_sx'>sx</a>  0  0 |
2538<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  S(<a href='#SkMatrix_postScale_2_sx'>sx</a>, <a href='#SkMatrix_postScale_2_sy'>sy</a>) = |  0 <a href='#SkMatrix_postScale_2_sy'>sy</a>  0 |
2539| P Q R |               |  0  0  1 |
2540
2541sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2542
2543| <a href='#SkMatrix_postScale_2_sx'>sx</a>  0  0 | | J K L |   | <a href='#SkMatrix_postScale_2_sx'>sx</a>*J <a href='#SkMatrix_postScale_2_sx'>sx</a>*K <a href='#SkMatrix_postScale_2_sx'>sx</a>*L |
2544S(<a href='#SkMatrix_postScale_2_sx'>sx</a>, <a href='#SkMatrix_postScale_2_sy'>sy</a>) * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = |  0 <a href='#SkMatrix_postScale_2_sy'>sy</a>  0 | | M N O | = | <a href='#SkMatrix_postScale_2_sy'>sy</a>*M <a href='#SkMatrix_postScale_2_sy'>sy</a>*N <a href='#SkMatrix_postScale_2_sy'>sy</a>*O |
2545|  0  0  1 | | P Q R |   |    P    Q    R |
2546
2547### Parameters
2548
2549<table>  <tr>    <td><a name='SkMatrix_postScale_2_sx'><code><strong>sx</strong></code></a></td>
2550    <td>horizontal scale factor</td>
2551  </tr>
2552  <tr>    <td><a name='SkMatrix_postScale_2_sy'><code><strong>sy</strong></code></a></td>
2553    <td>vertical scale factor</td>
2554  </tr>
2555</table>
2556
2557### Example
2558
2559<div><fiddle-embed name="1931017698766a67d3a26423453b8095"></fiddle-embed></div>
2560
2561### See Also
2562
2563<a href='#SkMatrix_preScale'>preScale</a> <a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>
2564
2565<a name='SkMatrix_postIDiv'></a>
2566
2567---
2568
2569<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2570bool <a href='#SkMatrix_postIDiv'>postIDiv</a>(int divx, int divy)
2571</pre>
2572
2573Sets <a href='SkMatrix_Reference#Matrix'>Matrix</a> to <a href='SkMatrix_Reference#Matrix'>Matrix</a> constructed from scaling by (1/<a href='#SkMatrix_postIDiv_divx'>divx</a>, 1/<a href='#SkMatrix_postIDiv_divy'>divy</a>),
2574multiplied by <a href='SkMatrix_Reference#Matrix'>Matrix</a>.
2575
2576Returns false if either <a href='#SkMatrix_postIDiv_divx'>divx</a> or <a href='#SkMatrix_postIDiv_divy'>divy</a> is zero.
2577
2578Given:
2579
2580<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
2581         | J K L |                   | sx  0  0 |
2582Matrix = | M N O |,  I(divx, divy) = |  0 sy  0 |
2583         | P Q R |                   |  0  0  1 |
2584</pre>
2585
2586where
2587
2588<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
2589sx = 1 / divx
2590sy = 1 / divy
2591</pre>
2592
2593sets <a href='SkMatrix_Reference#Matrix'>Matrix</a> to:
2594
2595<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
2596                         | sx  0  0 | | J K L |   | sx*J sx*K sx*L |
2597I(divx, divy) * Matrix = |  0 sy  0 | | M N O | = | sy*M sy*N sy*O |
2598                         |  0  0  1 | | P Q R |   |    P    Q    R |
2599</pre>
2600
2601### Parameters
2602
2603<table>  <tr>    <td><a name='SkMatrix_postIDiv_divx'><code><strong>divx</strong></code></a></td>
2604    <td>integer divisor for inverse scale on x-axis</td>
2605  </tr>
2606  <tr>    <td><a name='SkMatrix_postIDiv_divy'><code><strong>divy</strong></code></a></td>
2607    <td>integer divisor for inverse scale on y-axis</td>
2608  </tr>
2609</table>
2610
2611### Return Value
2612
2613true on successful scale
2614
2615### Example
2616
2617<div><fiddle-embed name="e6ad0bd2999613d9e4758b661d45070c"></fiddle-embed></div>
2618
2619### See Also
2620
2621<a href='#SkMatrix_postScale'>postScale</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>
2622
2623<a name='SkMatrix_postRotate'></a>
2624
2625---
2626
2627<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2628void <a href='#SkMatrix_postRotate'>postRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
2629</pre>
2630
2631Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from rotating by <a href='#SkMatrix_postRotate_degrees'>degrees</a> about pivot <a href='SkPoint_Reference#Point'>point</a>
2632(<a href='#SkMatrix_postRotate_px'>px</a>, <a href='#SkMatrix_postRotate_py'>py</a>), multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2633This can be thought of as rotating about a pivot <a href='SkPoint_Reference#Point'>point</a> after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2634
2635Positive <a href='#SkMatrix_postRotate_degrees'>degrees</a> rotates clockwise.
2636
2637Given:
2638
2639| J K L |                        | c -s dx |
2640<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  R(<a href='#SkMatrix_postRotate_degrees'>degrees</a>, <a href='#SkMatrix_postRotate_px'>px</a>, <a href='#SkMatrix_postRotate_py'>py</a>) = | s  c dy |
2641| P Q R |                        | 0  0  1 |
2642
2643where
2644
2645c  = cos(<a href='#SkMatrix_postRotate_degrees'>degrees</a>)
2646s  = sin(<a href='#SkMatrix_postRotate_degrees'>degrees</a>)
2647dx =  s * <a href='#SkMatrix_postRotate_py'>py</a> + (1 - c) * <a href='#SkMatrix_postRotate_px'>px</a>
2648dy = -s * <a href='#SkMatrix_postRotate_px'>px</a> + (1 - c) * <a href='#SkMatrix_postRotate_py'>py</a>
2649
2650sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2651
2652|c -s dx| |J K L|   |cJ-sM+dx*P cK-sN+dx*Q cL-sO+dx+R|
2653R(<a href='#SkMatrix_postRotate_degrees'>degrees</a>, <a href='#SkMatrix_postRotate_px'>px</a>, <a href='#SkMatrix_postRotate_py'>py</a>) * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = |s  c dy| |M N O| = |sJ+cM+dy*P sK+cN+dy*Q sL+cO+dy*R|
2654|0  0  1| |P Q R|   |         P          Q          R|
2655
2656### Parameters
2657
2658<table>  <tr>    <td><a name='SkMatrix_postRotate_degrees'><code><strong>degrees</strong></code></a></td>
2659    <td>angle of axes relative to upright axes</td>
2660  </tr>
2661  <tr>    <td><a name='SkMatrix_postRotate_px'><code><strong>px</strong></code></a></td>
2662    <td>pivot on x-axis</td>
2663  </tr>
2664  <tr>    <td><a name='SkMatrix_postRotate_py'><code><strong>py</strong></code></a></td>
2665    <td>pivot on y-axis</td>
2666  </tr>
2667</table>
2668
2669### Example
2670
2671<div><fiddle-embed name="e09194ee48a81e7b375ade473d340f0d"></fiddle-embed></div>
2672
2673### See Also
2674
2675<a href='#SkMatrix_preRotate'>preRotate</a> <a href='#SkMatrix_setRotate'>setRotate</a>
2676
2677<a name='SkMatrix_postRotate_2'></a>
2678
2679---
2680
2681<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2682void <a href='#SkMatrix_postRotate'>postRotate</a>(<a href='undocumented#SkScalar'>SkScalar</a> degrees)
2683</pre>
2684
2685Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from rotating by <a href='#SkMatrix_postRotate_2_degrees'>degrees</a> about pivot <a href='SkPoint_Reference#Point'>point</a>
2686(0, 0), multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2687This can be thought of as rotating about the origin after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2688
2689Positive <a href='#SkMatrix_postRotate_2_degrees'>degrees</a> rotates clockwise.
2690
2691Given:
2692
2693| J K L |                        | c -s 0 |
2694<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  R(<a href='#SkMatrix_postRotate_2_degrees'>degrees</a>, px, py) = | s  c 0 |
2695| P Q R |                        | 0  0 1 |
2696
2697where
2698
2699c  = cos(<a href='#SkMatrix_postRotate_2_degrees'>degrees</a>)
2700s  = sin(<a href='#SkMatrix_postRotate_2_degrees'>degrees</a>)
2701
2702sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2703
2704| c -s dx | | J K L |   | cJ-sM cK-sN cL-sO |
2705R(<a href='#SkMatrix_postRotate_2_degrees'>degrees</a>, px, py) * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = | s  c dy | | M N O | = | sJ+cM sK+cN sL+cO |
2706| 0  0  1 | | P Q R |   |     P     Q     R |
2707
2708### Parameters
2709
2710<table>  <tr>    <td><a name='SkMatrix_postRotate_2_degrees'><code><strong>degrees</strong></code></a></td>
2711    <td>angle of axes relative to upright axes</td>
2712  </tr>
2713</table>
2714
2715### Example
2716
2717<div><fiddle-embed name="52e4c53e26971af5576b30de60fa70c2"></fiddle-embed></div>
2718
2719### See Also
2720
2721<a href='#SkMatrix_preRotate'>preRotate</a> <a href='#SkMatrix_setRotate'>setRotate</a>
2722
2723<a name='SkMatrix_postSkew'></a>
2724
2725---
2726
2727<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2728void <a href='#SkMatrix_postSkew'>postSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky, <a href='undocumented#SkScalar'>SkScalar</a> px, <a href='undocumented#SkScalar'>SkScalar</a> py)
2729</pre>
2730
2731Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from skewing by (<a href='#SkMatrix_postSkew_kx'>kx</a>, <a href='#SkMatrix_postSkew_ky'>ky</a>) about pivot <a href='SkPoint_Reference#Point'>point</a>
2732(<a href='#SkMatrix_postSkew_px'>px</a>, <a href='#SkMatrix_postSkew_py'>py</a>), multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2733This can be thought of as skewing about a pivot <a href='SkPoint_Reference#Point'>point</a> after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2734
2735Given:
2736
2737| J K L |                       |  1 <a href='#SkMatrix_postSkew_kx'>kx</a> dx |
2738<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  K(<a href='#SkMatrix_postSkew_kx'>kx</a>, <a href='#SkMatrix_postSkew_ky'>ky</a>, <a href='#SkMatrix_postSkew_px'>px</a>, <a href='#SkMatrix_postSkew_py'>py</a>) = | <a href='#SkMatrix_postSkew_ky'>ky</a>  1 dy |
2739| P Q R |                       |  0  0  1 |
2740
2741where
2742
2743dx = -<a href='#SkMatrix_postSkew_kx'>kx</a> * <a href='#SkMatrix_postSkew_py'>py</a>
2744dy = -<a href='#SkMatrix_postSkew_ky'>ky</a> * <a href='#SkMatrix_postSkew_px'>px</a>
2745
2746sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2747
2748| 1 <a href='#SkMatrix_postSkew_kx'>kx</a> dx| |J K L|   |J+<a href='#SkMatrix_postSkew_kx'>kx</a>*M+dx*P K+<a href='#SkMatrix_postSkew_kx'>kx</a>*N+dx*Q L+<a href='#SkMatrix_postSkew_kx'>kx</a>*O+dx+R|
2749K(<a href='#SkMatrix_postSkew_kx'>kx</a>, <a href='#SkMatrix_postSkew_ky'>ky</a>, <a href='#SkMatrix_postSkew_px'>px</a>, <a href='#SkMatrix_postSkew_py'>py</a>) * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = |<a href='#SkMatrix_postSkew_ky'>ky</a>  1 dy| |M N O| = |<a href='#SkMatrix_postSkew_ky'>ky</a>*J+M+dy*P <a href='#SkMatrix_postSkew_ky'>ky</a>*K+N+dy*Q <a href='#SkMatrix_postSkew_ky'>ky</a>*L+O+dy*R|
2750| 0  0  1| |P Q R|   |          P           Q           R|
2751
2752### Parameters
2753
2754<table>  <tr>    <td><a name='SkMatrix_postSkew_kx'><code><strong>kx</strong></code></a></td>
2755    <td>horizontal skew factor</td>
2756  </tr>
2757  <tr>    <td><a name='SkMatrix_postSkew_ky'><code><strong>ky</strong></code></a></td>
2758    <td>vertical skew factor</td>
2759  </tr>
2760  <tr>    <td><a name='SkMatrix_postSkew_px'><code><strong>px</strong></code></a></td>
2761    <td>pivot on x-axis</td>
2762  </tr>
2763  <tr>    <td><a name='SkMatrix_postSkew_py'><code><strong>py</strong></code></a></td>
2764    <td>pivot on y-axis</td>
2765  </tr>
2766</table>
2767
2768### Example
2769
2770<div><fiddle-embed name="8c34ae3a2b7e2742bb969819737365ec"></fiddle-embed></div>
2771
2772### See Also
2773
2774<a href='#SkMatrix_preSkew'>preSkew</a> <a href='#SkMatrix_setSkew'>setSkew</a>
2775
2776<a name='SkMatrix_postSkew_2'></a>
2777
2778---
2779
2780<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2781void <a href='#SkMatrix_postSkew'>postSkew</a>(<a href='undocumented#SkScalar'>SkScalar</a> kx, <a href='undocumented#SkScalar'>SkScalar</a> ky)
2782</pre>
2783
2784Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> constructed from skewing by (<a href='#SkMatrix_postSkew_2_kx'>kx</a>, <a href='#SkMatrix_postSkew_2_ky'>ky</a>) about pivot <a href='SkPoint_Reference#Point'>point</a>
2785(0, 0), multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2786This can be thought of as skewing about the origin after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2787
2788Given:
2789
2790| J K L |               |  1 <a href='#SkMatrix_postSkew_2_kx'>kx</a> 0 |
2791<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  K(<a href='#SkMatrix_postSkew_2_kx'>kx</a>, <a href='#SkMatrix_postSkew_2_ky'>ky</a>) = | <a href='#SkMatrix_postSkew_2_ky'>ky</a>  1 0 |
2792| P Q R |               |  0  0 1 |
2793
2794sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2795
2796|  1 <a href='#SkMatrix_postSkew_2_kx'>kx</a> 0 | | J K L |   | J+<a href='#SkMatrix_postSkew_2_kx'>kx</a>*M K+<a href='#SkMatrix_postSkew_2_kx'>kx</a>*N L+<a href='#SkMatrix_postSkew_2_kx'>kx</a>*O |
2797K(<a href='#SkMatrix_postSkew_2_kx'>kx</a>, <a href='#SkMatrix_postSkew_2_ky'>ky</a>) * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = | <a href='#SkMatrix_postSkew_2_ky'>ky</a>  1 0 | | M N O | = | <a href='#SkMatrix_postSkew_2_ky'>ky</a>*J+M <a href='#SkMatrix_postSkew_2_ky'>ky</a>*K+N <a href='#SkMatrix_postSkew_2_ky'>ky</a>*L+O |
2798|  0  0 1 | | P Q R |   |      P      Q      R |
2799
2800### Parameters
2801
2802<table>  <tr>    <td><a name='SkMatrix_postSkew_2_kx'><code><strong>kx</strong></code></a></td>
2803    <td>horizontal skew factor</td>
2804  </tr>
2805  <tr>    <td><a name='SkMatrix_postSkew_2_ky'><code><strong>ky</strong></code></a></td>
2806    <td>vertical skew factor</td>
2807  </tr>
2808</table>
2809
2810### Example
2811
2812<div><fiddle-embed name="3aa2603225dff72ac53dd359f897f494"></fiddle-embed></div>
2813
2814### See Also
2815
2816<a href='#SkMatrix_preSkew'>preSkew</a> <a href='#SkMatrix_setSkew'>setSkew</a>
2817
2818<a name='SkMatrix_postConcat'></a>
2819
2820---
2821
2822<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2823void <a href='#SkMatrix_postConcat'>postConcat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& other)
2824</pre>
2825
2826Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_postConcat_other'>other</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2827This can be thought of mapping by <a href='#SkMatrix_postConcat_other'>other</a> after applying <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
2828
2829Given:
2830
2831| J K L |           | A B C |
2832<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | M N O |,  <a href='#SkMatrix_postConcat_other'>other</a> = | D E F |
2833| P Q R |           | G H <a href='#SkMatrix_I'>I</a> |
2834
2835sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2836
2837| A B C |   | J K L |   | AJ+BM+CP AK+BN+CQ AL+BO+CR |
2838<a href='#SkMatrix_postConcat_other'>other</a> * <a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
2839| G H <a href='#SkMatrix_I'>I</a> |   | P Q R |   | GJ+HM+IP GK+HN+IQ GL+HO+IR |
2840
2841### Parameters
2842
2843<table>  <tr>    <td><a name='SkMatrix_postConcat_other'><code><strong>other</strong></code></a></td>
2844    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> on  left side of multiply expression</td>
2845  </tr>
2846</table>
2847
2848### Example
2849
2850<div><fiddle-embed name="e4226c55d9bdbc119264bd372b2b9835"></fiddle-embed></div>
2851
2852### See Also
2853
2854<a href='#SkMatrix_preConcat'>preConcat</a> <a href='#SkMatrix_setConcat'>setConcat</a> <a href='#SkMatrix_Concat'>Concat</a>
2855
2856<a name='SkMatrix_ScaleToFit'></a>
2857
2858---
2859
2860<pre style="padding: 1em 1em 1em 1em;width: 62.5em; background-color: #f0f0f0">
2861    enum <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> {
2862        <a href='#SkMatrix_kFill_ScaleToFit'>kFill_ScaleToFit</a>,
2863        <a href='#SkMatrix_kStart_ScaleToFit'>kStart_ScaleToFit</a>,
2864        <a href='#SkMatrix_kCenter_ScaleToFit'>kCenter_ScaleToFit</a>,
2865        <a href='#SkMatrix_kEnd_ScaleToFit'>kEnd_ScaleToFit</a>,
2866    };
2867</pre>
2868
2869<a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> describes how <a href='SkMatrix_Reference#Matrix'>Matrix</a> is constructed to map one <a href='SkRect_Reference#Rect'>Rect</a> to another.
2870<a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> may allow <a href='SkMatrix_Reference#Matrix'>Matrix</a> to have unequal horizontal and vertical scaling,
2871or may restrict <a href='SkMatrix_Reference#Matrix'>Matrix</a> to square scaling. If restricted, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> specifies
2872how <a href='SkMatrix_Reference#Matrix'>Matrix</a> maps to the side or center of the destination <a href='SkRect_Reference#Rect'>Rect</a>.
2873
2874### Constants
2875
2876<table style='border-collapse: collapse; width: 62.5em'>
2877  <tr><th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Const</th>
2878<th style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>Value</th>
2879<th style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>Description</th></tr>
2880  <tr style='background-color: #f0f0f0; '>
2881    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kFill_ScaleToFit'><code>SkMatrix::kFill_ScaleToFit</code></a></td>
2882    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>0</td>
2883    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
2884Computes <a href='SkMatrix_Reference#Matrix'>Matrix</a> that scales about x-axis and y-axis independently, so that
2885source <a href='SkRect_Reference#Rect'>Rect</a> is mapped to completely fill destination <a href='SkRect_Reference#Rect'>Rect</a>. The aspect ratio
2886of source <a href='SkRect_Reference#Rect'>Rect</a> may change.
2887</td>
2888  </tr>
2889  <tr>
2890    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kStart_ScaleToFit'><code>SkMatrix::kStart_ScaleToFit</code></a></td>
2891    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>1</td>
2892    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
2893Computes <a href='SkMatrix_Reference#Matrix'>Matrix</a> that maintains source <a href='SkRect_Reference#Rect'>Rect</a> aspect ratio, mapping source <a href='SkRect_Reference#Rect'>Rect</a>
2894width or height to destination <a href='SkRect_Reference#Rect'>Rect</a>. Aligns mapping to left and top edges
2895of destination <a href='SkRect_Reference#Rect'>Rect</a>.
2896</td>
2897  </tr>
2898  <tr style='background-color: #f0f0f0; '>
2899    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kCenter_ScaleToFit'><code>SkMatrix::kCenter_ScaleToFit</code></a></td>
2900    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>2</td>
2901    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
2902Computes <a href='SkMatrix_Reference#Matrix'>Matrix</a> that maintains source <a href='SkRect_Reference#Rect'>Rect</a> aspect ratio, mapping source <a href='SkRect_Reference#Rect'>Rect</a>
2903width or height to destination <a href='SkRect_Reference#Rect'>Rect</a>. Aligns mapping to center of destination
2904<a href='SkRect_Reference#Rect'>Rect</a>.
2905</td>
2906  </tr>
2907  <tr>
2908    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '><a name='SkMatrix_kEnd_ScaleToFit'><code>SkMatrix::kEnd_ScaleToFit</code></a></td>
2909    <td style='text-align: center; border: 2px solid #dddddd; padding: 8px; '>3</td>
2910    <td style='text-align: left; border: 2px solid #dddddd; padding: 8px; '>
2911Computes <a href='SkMatrix_Reference#Matrix'>Matrix</a> that maintains source <a href='SkRect_Reference#Rect'>Rect</a> aspect ratio, mapping source <a href='SkRect_Reference#Rect'>Rect</a>
2912width or height to destination <a href='SkRect_Reference#Rect'>Rect</a>. Aligns mapping to right and bottom
2913edges of destination <a href='SkRect_Reference#Rect'>Rect</a>.
2914</td>
2915  </tr>
2916</table>
2917
2918### Example
2919
2920<div><fiddle-embed name="17c3070b31b700ea8f52e48af9a66b6e"></fiddle-embed></div>
2921
2922### See Also
2923
2924<a href='#SkMatrix_setRectToRect'>setRectToRect</a> <a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a> <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a>
2925
2926<a name='SkMatrix_setRectToRect'></a>
2927
2928---
2929
2930<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2931bool <a href='#SkMatrix_setRectToRect'>setRectToRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> stf)
2932</pre>
2933
2934Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to scale and translate <a href='#SkMatrix_setRectToRect_src'>src</a> <a href='SkRect_Reference#SkRect'>SkRect</a> to <a href='#SkMatrix_setRectToRect_dst'>dst</a> <a href='SkRect_Reference#SkRect'>SkRect</a>. <a href='#SkMatrix_setRectToRect_stf'>stf</a> selects whether
2935mapping completely fills <a href='#SkMatrix_setRectToRect_dst'>dst</a> or preserves the aspect ratio, and how to align
2936<a href='#SkMatrix_setRectToRect_src'>src</a> within <a href='#SkMatrix_setRectToRect_dst'>dst</a>. Returns false if <a href='#SkMatrix_setRectToRect_src'>src</a> is empty, and sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to identity.
2937Returns true if <a href='#SkMatrix_setRectToRect_dst'>dst</a> is empty, and sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
2938
2939| 0 0 0 |
2940| 0 0 0 |
2941| 0 0 1 |
2942
2943### Parameters
2944
2945<table>  <tr>    <td><a name='SkMatrix_setRectToRect_src'><code><strong>src</strong></code></a></td>
2946    <td><a href='SkRect_Reference#SkRect'>SkRect</a> to map from</td>
2947  </tr>
2948  <tr>    <td><a name='SkMatrix_setRectToRect_dst'><code><strong>dst</strong></code></a></td>
2949    <td><a href='SkRect_Reference#SkRect'>SkRect</a> to map to</td>
2950  </tr>
2951  <tr>    <td><a name='SkMatrix_setRectToRect_stf'><code><strong>stf</strong></code></a></td>
2952    <td>one of: <a href='#SkMatrix_kFill_ScaleToFit'>kFill_ScaleToFit</a>, <a href='#SkMatrix_kStart_ScaleToFit'>kStart_ScaleToFit</a>,</td>
2953  </tr>
2954</table>
2955
2956<a href='#SkMatrix_kCenter_ScaleToFit'>kCenter_ScaleToFit</a>, <a href='#SkMatrix_kEnd_ScaleToFit'>kEnd_ScaleToFit</a>
2957
2958### Return Value
2959
2960true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> can represent <a href='SkRect_Reference#SkRect'>SkRect</a> mapping
2961
2962### Example
2963
2964<div><fiddle-embed name="69cdea599dcaaec35efcb24403f4287b">
2965
2966#### Example Output
2967
2968~~~~
2969src: 0, 0, 0, 0  dst: 0, 0, 0, 0  success: false
2970[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.0000   0.0000   1.0000]
2971src: 0, 0, 0, 0  dst: 5, 6, 8, 9  success: false
2972[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.0000   0.0000   1.0000]
2973src: 1, 2, 3, 4  dst: 0, 0, 0, 0  success: true
2974[  0.0000   0.0000   0.0000][  0.0000   0.0000   0.0000][  0.0000   0.0000   1.0000]
2975src: 1, 2, 3, 4  dst: 5, 6, 8, 9  success: true
2976[  1.5000   0.0000   3.5000][  0.0000   1.5000   3.0000][  0.0000   0.0000   1.0000]
2977~~~~
2978
2979</fiddle-embed></div>
2980
2981### See Also
2982
2983<a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a> <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> <a href='SkRect_Reference#SkRect'>SkRect</a>::<a href='#SkRect_isEmpty'>isEmpty</a>
2984
2985<a name='SkMatrix_MakeRectToRect'></a>
2986
2987---
2988
2989<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
2990static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src, const <a href='SkRect_Reference#SkRect'>SkRect</a>& dst, <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> stf)
2991</pre>
2992
2993Returns <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> set to scale and translate <a href='#SkMatrix_MakeRectToRect_src'>src</a> <a href='SkRect_Reference#SkRect'>SkRect</a> to <a href='#SkMatrix_MakeRectToRect_dst'>dst</a> <a href='SkRect_Reference#SkRect'>SkRect</a>. <a href='#SkMatrix_MakeRectToRect_stf'>stf</a> selects
2994whether mapping completely fills <a href='#SkMatrix_MakeRectToRect_dst'>dst</a> or preserves the aspect ratio, and how to
2995align <a href='#SkMatrix_MakeRectToRect_src'>src</a> within <a href='#SkMatrix_MakeRectToRect_dst'>dst</a>. Returns the identity <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> if <a href='#SkMatrix_MakeRectToRect_src'>src</a> is empty. If <a href='#SkMatrix_MakeRectToRect_dst'>dst</a> is
2996empty, returns <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> set to:
2997
2998| 0 0 0 |
2999| 0 0 0 |
3000| 0 0 1 |
3001
3002### Parameters
3003
3004<table>  <tr>    <td><a name='SkMatrix_MakeRectToRect_src'><code><strong>src</strong></code></a></td>
3005    <td><a href='SkRect_Reference#SkRect'>SkRect</a> to map from</td>
3006  </tr>
3007  <tr>    <td><a name='SkMatrix_MakeRectToRect_dst'><code><strong>dst</strong></code></a></td>
3008    <td><a href='SkRect_Reference#SkRect'>SkRect</a> to map to</td>
3009  </tr>
3010  <tr>    <td><a name='SkMatrix_MakeRectToRect_stf'><code><strong>stf</strong></code></a></td>
3011    <td>one of: <a href='#SkMatrix_kFill_ScaleToFit'>kFill_ScaleToFit</a>, <a href='#SkMatrix_kStart_ScaleToFit'>kStart_ScaleToFit</a>,</td>
3012  </tr>
3013</table>
3014
3015<a href='#SkMatrix_kCenter_ScaleToFit'>kCenter_ScaleToFit</a>, <a href='#SkMatrix_kEnd_ScaleToFit'>kEnd_ScaleToFit</a>
3016
3017### Return Value
3018
3019<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> mapping <a href='#SkMatrix_MakeRectToRect_src'>src</a> to <a href='#SkMatrix_MakeRectToRect_dst'>dst</a>
3020
3021### Example
3022
3023<div><fiddle-embed name="a1d6a6721b39350f81021f71a1b93208">
3024
3025#### Example Output
3026
3027~~~~
3028src: 0, 0, 0, 0  dst: 0, 0, 0, 0
3029[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.0000   0.0000   1.0000]
3030src: 0, 0, 0, 0  dst: 5, 6, 8, 9
3031[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.0000   0.0000   1.0000]
3032src: 1, 2, 3, 4  dst: 0, 0, 0, 0
3033[  0.0000   0.0000   0.0000][  0.0000   0.0000   0.0000][  0.0000   0.0000   1.0000]
3034src: 1, 2, 3, 4  dst: 5, 6, 8, 9
3035[  1.5000   0.0000   3.5000][  0.0000   1.5000   3.0000][  0.0000   0.0000   1.0000]
3036~~~~
3037
3038</fiddle-embed></div>
3039
3040### See Also
3041
3042<a href='#SkMatrix_setRectToRect'>setRectToRect</a> <a href='#SkMatrix_ScaleToFit'>ScaleToFit</a> <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> <a href='SkRect_Reference#SkRect'>SkRect</a>::<a href='#SkRect_isEmpty'>isEmpty</a>
3043
3044<a name='SkMatrix_setPolyToPoly'></a>
3045
3046---
3047
3048<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3049bool <a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a>(const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> src[], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[], int count)
3050</pre>
3051
3052Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to map <a href='#SkMatrix_setPolyToPoly_src'>src</a> to <a href='#SkMatrix_setPolyToPoly_dst'>dst</a>. <a href='#SkMatrix_setPolyToPoly_count'>count</a> must be zero or greater, and four or less.
3053
3054If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is zero, sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to identity and returns true.
3055If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is one, sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to translate and returns true.
3056If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is two or more, sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to map <a href='SkPoint_Reference#SkPoint'>SkPoint</a> if possible; returns false
3057if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> cannot be constructed. If <a href='#SkMatrix_setPolyToPoly_count'>count</a> is four, <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> may include
3058perspective.
3059
3060### Parameters
3061
3062<table>  <tr>    <td><a name='SkMatrix_setPolyToPoly_src'><code><strong>src</strong></code></a></td>
3063    <td><a href='SkPoint_Reference#SkPoint'>SkPoint</a> to map from</td>
3064  </tr>
3065  <tr>    <td><a name='SkMatrix_setPolyToPoly_dst'><code><strong>dst</strong></code></a></td>
3066    <td><a href='SkPoint_Reference#SkPoint'>SkPoint</a> to map to</td>
3067  </tr>
3068  <tr>    <td><a name='SkMatrix_setPolyToPoly_count'><code><strong>count</strong></code></a></td>
3069    <td>number of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> in <a href='#SkMatrix_setPolyToPoly_src'>src</a> and <a href='#SkMatrix_setPolyToPoly_dst'>dst</a></td>
3070  </tr>
3071</table>
3072
3073### Return Value
3074
3075true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> was constructed successfully
3076
3077### Example
3078
3079<div><fiddle-embed name="c851d1313e8909aaea4f0591699fdb7b"></fiddle-embed></div>
3080
3081### See Also
3082
3083<a href='#SkMatrix_setRectToRect'>setRectToRect</a> <a href='#SkMatrix_MakeRectToRect'>MakeRectToRect</a>
3084
3085<a name='SkMatrix_invert'></a>
3086
3087---
3088
3089<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3090bool <a href='#SkMatrix_invert'>invert</a>(<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* inverse)const
3091</pre>
3092
3093Sets <a href='#SkMatrix_invert_inverse'>inverse</a> to reciprocal <a href='SkMatrix_Reference#Matrix'>matrix</a>, returning true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> can be inverted.
3094Geometrically, if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> maps from source to destination, <a href='#SkMatrix_invert_inverse'>inverse</a> <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
3095maps from destination to source. If <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> can not be inverted, <a href='#SkMatrix_invert_inverse'>inverse</a> is
3096unchanged.
3097
3098### Parameters
3099
3100<table>  <tr>    <td><a name='SkMatrix_invert_inverse'><code><strong>inverse</strong></code></a></td>
3101    <td>storage for inverted <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>; may be nullptr</td>
3102  </tr>
3103</table>
3104
3105### Return Value
3106
3107true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> can be inverted
3108
3109### Example
3110
3111<div><fiddle-embed name="0e03cd9f154603ed4b21ca56d69dae44"></fiddle-embed></div>
3112
3113### See Also
3114
3115<a href='#SkMatrix_Concat'>Concat</a>
3116
3117<a name='SkMatrix_SetAffineIdentity'></a>
3118
3119---
3120
3121<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3122static void <a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a>(<a href='undocumented#SkScalar'>SkScalar</a> affine[6])
3123</pre>
3124
3125Fills <a href='#SkMatrix_SetAffineIdentity_affine'>affine</a> with identity values in column major order.
3126Sets <a href='#SkMatrix_SetAffineIdentity_affine'>affine</a> to:
3127
3128| 1 0 0 |
3129| 0 1 0 |
3130
3131Affine 3 by 2 <a href='SkMatrix_Reference#Matrix'>matrices</a> in column major order are used by OpenGL and XPS.
3132
3133### Parameters
3134
3135<table>  <tr>    <td><a name='SkMatrix_SetAffineIdentity_affine'><code><strong>affine</strong></code></a></td>
3136    <td>storage for 3 by 2 <a href='#SkMatrix_SetAffineIdentity_affine'>affine</a> <a href='SkMatrix_Reference#Matrix'>matrix</a></td>
3137  </tr>
3138</table>
3139
3140### Example
3141
3142<div><fiddle-embed name="e10adbd0bcc940c5d4d872db0e78e892">
3143
3144#### Example Output
3145
3146~~~~
3147ScaleX: 1 SkewY: 0 SkewX: 0 ScaleY: 1 TransX: 0 TransY: 0
3148~~~~
3149
3150</fiddle-embed></div>
3151
3152### See Also
3153
3154<a href='#SkMatrix_setAffine'>setAffine</a> <a href='#SkMatrix_asAffine'>asAffine</a>
3155
3156<a name='SkMatrix_asAffine'></a>
3157
3158---
3159
3160<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3161bool <a href='#SkMatrix_asAffine'>asAffine</a>(<a href='undocumented#SkScalar'>SkScalar</a> affine[6])const
3162</pre>
3163
3164Fills <a href='#SkMatrix_asAffine_affine'>affine</a> in column major order. Sets <a href='#SkMatrix_asAffine_affine'>affine</a> to:
3165
3166| scale-x  skew-x translate-x |
3167| skew-y  scale-y translate-y |
3168
3169If <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contains perspective, returns false and leaves <a href='#SkMatrix_asAffine_affine'>affine</a> unchanged.
3170
3171### Parameters
3172
3173<table>  <tr>    <td><a name='SkMatrix_asAffine_affine'><code><strong>affine</strong></code></a></td>
3174    <td>storage for 3 by 2 <a href='#SkMatrix_asAffine_affine'>affine</a> <a href='SkMatrix_Reference#Matrix'>matrix</a>; may be nullptr</td>
3175  </tr>
3176</table>
3177
3178### Return Value
3179
3180true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> does not contain perspective
3181
3182### Example
3183
3184<div><fiddle-embed name="3325bdf82bd86d9fbc4199f248afa82c">
3185
3186#### Example Output
3187
3188~~~~
3189ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
3190~~~~
3191
3192</fiddle-embed></div>
3193
3194### See Also
3195
3196<a href='#SkMatrix_setAffine'>setAffine</a> <a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a>
3197
3198<a name='SkMatrix_setAffine'></a>
3199
3200---
3201
3202<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3203void <a href='#SkMatrix_setAffine'>setAffine</a>(const <a href='undocumented#SkScalar'>SkScalar</a> affine[6])
3204</pre>
3205
3206Sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to <a href='#SkMatrix_setAffine_affine'>affine</a> values, passed in column major order. Given <a href='#SkMatrix_setAffine_affine'>affine</a>,
3207column, then row, as:
3208
3209| scale-x  skew-x translate-x |
3210|  skew-y scale-y translate-y |
3211
3212<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is set, row, then column, to:
3213
3214| scale-x  skew-x translate-x |
3215|  skew-y scale-y translate-y |
3216|       0       0           1 |
3217
3218### Parameters
3219
3220<table>  <tr>    <td><a name='SkMatrix_setAffine_affine'><code><strong>affine</strong></code></a></td>
3221    <td>3 by 2 <a href='#SkMatrix_setAffine_affine'>affine</a> <a href='SkMatrix_Reference#Matrix'>matrix</a></td>
3222  </tr>
3223</table>
3224
3225### Example
3226
3227<div><fiddle-embed name="f5b6d371c4d65e5b5ac6eebdd4b237d8">
3228
3229#### Example Output
3230
3231~~~~
3232ScaleX: 2 SkewY: 5 SkewX: 3 ScaleY: 6 TransX: 4 TransY: 7
3233[  2.0000   3.0000   4.0000][  5.0000   6.0000   7.0000][  0.0000   0.0000   1.0000]
3234~~~~
3235
3236</fiddle-embed></div>
3237
3238### See Also
3239
3240<a href='#SkMatrix_asAffine'>asAffine</a> <a href='#SkMatrix_SetAffineIdentity'>SetAffineIdentity</a>
3241
3242<a name='Transform'></a>
3243
3244<a name='SkMatrix_mapPoints'></a>
3245
3246---
3247
3248<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3249void <a href='#SkMatrix_mapPoints'>mapPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[], const <a href='SkPoint_Reference#SkPoint'>SkPoint</a> src[], int count)const
3250</pre>
3251
3252Maps <a href='#SkMatrix_mapPoints_src'>src</a>  <a href='SkPath_Reference#Point_Array'>SkPoint array</a> of length <a href='#SkMatrix_mapPoints_count'>count</a> to <a href='#SkMatrix_mapPoints_dst'>dst</a>  <a href='SkPath_Reference#Point_Array'>SkPoint array</a> of equal or greater
3253length. <a href='SkPoint_Reference#SkPoint'>SkPoint</a> are mapped by multiplying each <a href='SkPoint_Reference#SkPoint'>SkPoint</a> by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. Given:
3254
3255| A B C |        | x |
3256<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  pt = | y |
3257| G H <a href='#SkMatrix_I'>I</a> |        | 1 |
3258
3259where
3260
3261for (i = 0; i < <a href='#SkMatrix_mapPoints_count'>count</a>; ++i) {
3262x = <a href='#SkMatrix_mapPoints_src'>src</a>[i].fX
3263y = <a href='#SkMatrix_mapPoints_src'>src</a>[i].fY
3264}
3265
3266each <a href='#SkMatrix_mapPoints_dst'>dst</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> is computed as:
3267
3268|A B C| |x|                               Ax+By+C   Dx+Ey+F
3269<a href='SkMatrix_Reference#Matrix'>Matrix</a> * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+<a href='#SkMatrix_I'>I</a>| = ------- , -------
3270|G H <a href='#SkMatrix_I'>I</a>| |1|                               Gx+Hy+<a href='#SkMatrix_I'>I</a>   Gx+Hy+<a href='#SkMatrix_I'>I</a>
3271
3272<a href='#SkMatrix_mapPoints_src'>src</a> and <a href='#SkMatrix_mapPoints_dst'>dst</a> may <a href='SkPoint_Reference#Point'>point</a> to the same storage.
3273
3274### Parameters
3275
3276<table>  <tr>    <td><a name='SkMatrix_mapPoints_dst'><code><strong>dst</strong></code></a></td>
3277    <td>storage for mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td>
3278  </tr>
3279  <tr>    <td><a name='SkMatrix_mapPoints_src'><code><strong>src</strong></code></a></td>
3280    <td><a href='SkPoint_Reference#SkPoint'>SkPoint</a> to transform</td>
3281  </tr>
3282  <tr>    <td><a name='SkMatrix_mapPoints_count'><code><strong>count</strong></code></a></td>
3283    <td>number of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to transform</td>
3284  </tr>
3285</table>
3286
3287### Example
3288
3289<div><fiddle-embed name="f99dcb00296d0c56b6c0e178e94b3534"></fiddle-embed></div>
3290
3291### See Also
3292
3293<a href='#SkMatrix_mapXY'>mapXY</a> <a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a> <a href='#SkMatrix_mapVectors'>mapVectors</a>
3294
3295<a name='SkMatrix_mapPoints_2'></a>
3296
3297---
3298
3299<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3300void <a href='#SkMatrix_mapPoints'>mapPoints</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> pts[], int count)const
3301</pre>
3302
3303Maps <a href='#SkMatrix_mapPoints_2_pts'>pts</a>  <a href='SkPath_Reference#Point_Array'>SkPoint array</a> of length <a href='#SkMatrix_mapPoints_2_count'>count</a> in place. <a href='SkPoint_Reference#SkPoint'>SkPoint</a> are mapped by multiplying
3304each <a href='SkPoint_Reference#SkPoint'>SkPoint</a> by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. Given:
3305
3306| A B C |        | x |
3307<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  pt = | y |
3308| G H <a href='#SkMatrix_I'>I</a> |        | 1 |
3309
3310where
3311
3312for (i = 0; i < <a href='#SkMatrix_mapPoints_2_count'>count</a>; ++i) {
3313x = <a href='#SkMatrix_mapPoints_2_pts'>pts</a>[i].fX
3314y = <a href='#SkMatrix_mapPoints_2_pts'>pts</a>[i].fY
3315}
3316
3317each resulting <a href='#SkMatrix_mapPoints_2_pts'>pts</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> is computed as:
3318
3319|A B C| |x|                               Ax+By+C   Dx+Ey+F
3320<a href='SkMatrix_Reference#Matrix'>Matrix</a> * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+<a href='#SkMatrix_I'>I</a>| = ------- , -------
3321|G H <a href='#SkMatrix_I'>I</a>| |1|                               Gx+Hy+<a href='#SkMatrix_I'>I</a>   Gx+Hy+<a href='#SkMatrix_I'>I</a>
3322
3323### Parameters
3324
3325<table>  <tr>    <td><a name='SkMatrix_mapPoints_2_pts'><code><strong>pts</strong></code></a></td>
3326    <td>storage for mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td>
3327  </tr>
3328  <tr>    <td><a name='SkMatrix_mapPoints_2_count'><code><strong>count</strong></code></a></td>
3329    <td>number of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to transform</td>
3330  </tr>
3331</table>
3332
3333### Example
3334
3335<div><fiddle-embed name="428ca171ae3bd0d3f992458ac598b97b"></fiddle-embed></div>
3336
3337### See Also
3338
3339<a href='#SkMatrix_mapXY'>mapXY</a> <a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a> <a href='#SkMatrix_mapVectors'>mapVectors</a>
3340
3341<a name='SkMatrix_mapHomogeneousPoints'></a>
3342
3343---
3344
3345<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3346void <a href='#SkMatrix_mapHomogeneousPoints'>mapHomogeneousPoints</a>(<a href='undocumented#SkPoint3'>SkPoint3</a> dst[], const <a href='undocumented#SkPoint3'>SkPoint3</a> src[], int count)const
3347</pre>
3348
3349Maps <a href='#SkMatrix_mapHomogeneousPoints_src'>src</a> <a href='undocumented#SkPoint3'>SkPoint3</a> array of length <a href='#SkMatrix_mapHomogeneousPoints_count'>count</a> to <a href='#SkMatrix_mapHomogeneousPoints_dst'>dst</a> <a href='undocumented#SkPoint3'>SkPoint3</a> array, which must of length <a href='#SkMatrix_mapHomogeneousPoints_count'>count</a> or
3350greater. <a href='undocumented#SkPoint3'>SkPoint3</a> array is mapped by multiplying each <a href='undocumented#SkPoint3'>SkPoint3</a> by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. Given:
3351
3352| A B C |         | x |
3353<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  <a href='#SkMatrix_mapHomogeneousPoints_src'>src</a> = | y |
3354| G H <a href='#SkMatrix_I'>I</a> |         | z |
3355
3356each resulting <a href='#SkMatrix_mapHomogeneousPoints_dst'>dst</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> is computed as:
3357
3358|A B C| |x|
3359<a href='SkMatrix_Reference#Matrix'>Matrix</a> * <a href='#SkMatrix_mapHomogeneousPoints_src'>src</a> = |D E F| |y| = |Ax+By+Cz Dx+Ey+Fz Gx+Hy+Iz|
3360|G H <a href='#SkMatrix_I'>I</a>| |z|
3361
3362### Parameters
3363
3364<table>  <tr>    <td><a name='SkMatrix_mapHomogeneousPoints_dst'><code><strong>dst</strong></code></a></td>
3365    <td>storage for mapped <a href='undocumented#SkPoint3'>SkPoint3</a> array</td>
3366  </tr>
3367  <tr>    <td><a name='SkMatrix_mapHomogeneousPoints_src'><code><strong>src</strong></code></a></td>
3368    <td><a href='undocumented#SkPoint3'>SkPoint3</a> array to transform</td>
3369  </tr>
3370  <tr>    <td><a name='SkMatrix_mapHomogeneousPoints_count'><code><strong>count</strong></code></a></td>
3371    <td>items in <a href='undocumented#SkPoint3'>SkPoint3</a> array to transform</td>
3372  </tr>
3373</table>
3374
3375### Example
3376
3377<div><fiddle-embed name="d56f93e4bc763c7ba4914321ed07a8b5"></fiddle-embed></div>
3378
3379### See Also
3380
3381<a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_mapXY'>mapXY</a> <a href='#SkMatrix_mapVectors'>mapVectors</a>
3382
3383<a name='SkMatrix_mapXY'></a>
3384
3385---
3386
3387<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3388void <a href='#SkMatrix_mapXY'>mapXY</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y, <a href='SkPoint_Reference#SkPoint'>SkPoint</a>* result)const
3389</pre>
3390
3391Maps <a href='SkPoint_Reference#SkPoint'>SkPoint</a> (<a href='#SkMatrix_mapXY_x'>x</a>, <a href='#SkMatrix_mapXY_y'>y</a>) to <a href='#SkMatrix_mapXY_result'>result</a>. <a href='SkPoint_Reference#SkPoint'>SkPoint</a> is mapped by multiplying by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. Given:
3392
3393| A B C |        | <a href='#SkMatrix_mapXY_x'>x</a> |
3394<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  pt = | <a href='#SkMatrix_mapXY_y'>y</a> |
3395| G H <a href='#SkMatrix_I'>I</a> |        | 1 |
3396
3397<a href='#SkMatrix_mapXY_result'>result</a> is computed as:
3398
3399|A B C| |<a href='#SkMatrix_mapXY_x'>x</a>|                               Ax+By+C   Dx+Ey+F
3400<a href='SkMatrix_Reference#Matrix'>Matrix</a> * pt = |D E F| |<a href='#SkMatrix_mapXY_y'>y</a>| = |Ax+By+C Dx+Ey+F Gx+Hy+<a href='#SkMatrix_I'>I</a>| = ------- , -------
3401|G H <a href='#SkMatrix_I'>I</a>| |1|                               Gx+Hy+<a href='#SkMatrix_I'>I</a>   Gx+Hy+<a href='#SkMatrix_I'>I</a>
3402
3403### Parameters
3404
3405<table>  <tr>    <td><a name='SkMatrix_mapXY_x'><code><strong>x</strong></code></a></td>
3406    <td>x-axis value of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to map</td>
3407  </tr>
3408  <tr>    <td><a name='SkMatrix_mapXY_y'><code><strong>y</strong></code></a></td>
3409    <td>y-axis value of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to map</td>
3410  </tr>
3411  <tr>    <td><a name='SkMatrix_mapXY_result'><code><strong>result</strong></code></a></td>
3412    <td>storage for mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td>
3413  </tr>
3414</table>
3415
3416### Example
3417
3418<div><fiddle-embed name="9e50185d502dc6903783679a84106089"></fiddle-embed></div>
3419
3420### See Also
3421
3422<a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_mapVectors'>mapVectors</a>
3423
3424<a name='SkMatrix_mapXY_2'></a>
3425
3426---
3427
3428<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3429<a href='SkPoint_Reference#SkPoint'>SkPoint</a> <a href='#SkMatrix_mapXY'>mapXY</a>(<a href='undocumented#SkScalar'>SkScalar</a> x, <a href='undocumented#SkScalar'>SkScalar</a> y)const
3430</pre>
3431
3432Returns <a href='SkPoint_Reference#SkPoint'>SkPoint</a> (<a href='#SkMatrix_mapXY_2_x'>x</a>, <a href='#SkMatrix_mapXY_2_y'>y</a>) multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. Given:
3433
3434| A B C |        | <a href='#SkMatrix_mapXY_2_x'>x</a> |
3435<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  pt = | <a href='#SkMatrix_mapXY_2_y'>y</a> |
3436| G H <a href='#SkMatrix_I'>I</a> |        | 1 |
3437
3438result is computed as:
3439
3440|A B C| |<a href='#SkMatrix_mapXY_2_x'>x</a>|                               Ax+By+C   Dx+Ey+F
3441<a href='SkMatrix_Reference#Matrix'>Matrix</a> * pt = |D E F| |<a href='#SkMatrix_mapXY_2_y'>y</a>| = |Ax+By+C Dx+Ey+F Gx+Hy+<a href='#SkMatrix_I'>I</a>| = ------- , -------
3442|G H <a href='#SkMatrix_I'>I</a>| |1|                               Gx+Hy+<a href='#SkMatrix_I'>I</a>   Gx+Hy+<a href='#SkMatrix_I'>I</a>
3443
3444### Parameters
3445
3446<table>  <tr>    <td><a name='SkMatrix_mapXY_2_x'><code><strong>x</strong></code></a></td>
3447    <td>x-axis value of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to map</td>
3448  </tr>
3449  <tr>    <td><a name='SkMatrix_mapXY_2_y'><code><strong>y</strong></code></a></td>
3450    <td>y-axis value of <a href='SkPoint_Reference#SkPoint'>SkPoint</a> to map</td>
3451  </tr>
3452</table>
3453
3454### Return Value
3455
3456mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a>
3457
3458### Example
3459
3460<div><fiddle-embed name="b1ead09c67a177ab8eace12b061610a7"></fiddle-embed></div>
3461
3462### See Also
3463
3464<a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_mapVectors'>mapVectors</a>
3465
3466<a name='SkMatrix_mapVectors'></a>
3467
3468---
3469
3470<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3471void <a href='#SkMatrix_mapVectors'>mapVectors</a>(<a href='SkPoint_Reference#SkVector'>SkVector</a> dst[], const <a href='SkPoint_Reference#SkVector'>SkVector</a> src[], int count)const
3472</pre>
3473
3474Maps <a href='#SkMatrix_mapVectors_src'>src</a> <a href='SkPoint_Reference#Vector'>vector</a> array of length <a href='#SkMatrix_mapVectors_count'>count</a> to <a href='SkPoint_Reference#Vector'>vector</a>  <a href='SkPath_Reference#Point_Array'>SkPoint array</a> of equal or greater
3475length. <a href='SkPoint_Reference#Vector'>Vectors</a> are mapped by multiplying each <a href='SkPoint_Reference#Vector'>vector</a> by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>, treating
3476<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> translation as zero. Given:
3477
3478| A B 0 |         | x |
3479<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E 0 |,  <a href='#SkMatrix_mapVectors_src'>src</a> = | y |
3480| G H <a href='#SkMatrix_I'>I</a> |         | 1 |
3481
3482where
3483
3484for (i = 0; i < <a href='#SkMatrix_mapVectors_count'>count</a>; ++i) {
3485x = <a href='#SkMatrix_mapVectors_src'>src</a>[i].fX
3486y = <a href='#SkMatrix_mapVectors_src'>src</a>[i].fY
3487}
3488
3489each <a href='#SkMatrix_mapVectors_dst'>dst</a> <a href='SkPoint_Reference#Vector'>vector</a> is computed as:
3490
3491|A B 0| |x|                            Ax+By     Dx+Ey
3492<a href='SkMatrix_Reference#Matrix'>Matrix</a> * <a href='#SkMatrix_mapVectors_src'>src</a> = |D E 0| |y| = |Ax+By Dx+Ey Gx+Hy+<a href='#SkMatrix_I'>I</a>| = ------- , -------
3493|G H <a href='#SkMatrix_I'>I</a>| |1|                           Gx+Hy+<a href='#SkMatrix_I'>I</a>   Gx+Hy+<a href='#SkMatrix_I'>I</a>
3494
3495<a href='#SkMatrix_mapVectors_src'>src</a> and <a href='#SkMatrix_mapVectors_dst'>dst</a> may <a href='SkPoint_Reference#Point'>point</a> to the same storage.
3496
3497### Parameters
3498
3499<table>  <tr>    <td><a name='SkMatrix_mapVectors_dst'><code><strong>dst</strong></code></a></td>
3500    <td>storage for mapped <a href='SkPoint_Reference#Vector'>vectors</a></td>
3501  </tr>
3502  <tr>    <td><a name='SkMatrix_mapVectors_src'><code><strong>src</strong></code></a></td>
3503    <td><a href='SkPoint_Reference#Vector'>vectors</a> to transform</td>
3504  </tr>
3505  <tr>    <td><a name='SkMatrix_mapVectors_count'><code><strong>count</strong></code></a></td>
3506    <td>number of <a href='SkPoint_Reference#Vector'>vectors</a> to transform</td>
3507  </tr>
3508</table>
3509
3510### Example
3511
3512<div><fiddle-embed name="918a9778c3d7d5cb306692784399f6dc"></fiddle-embed></div>
3513
3514### See Also
3515
3516<a href='#SkMatrix_mapVector'>mapVector</a> <a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_mapXY'>mapXY</a>
3517
3518<a name='SkMatrix_mapVectors_2'></a>
3519
3520---
3521
3522<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3523void <a href='#SkMatrix_mapVectors'>mapVectors</a>(<a href='SkPoint_Reference#SkVector'>SkVector</a> vecs[], int count)const
3524</pre>
3525
3526Maps <a href='#SkMatrix_mapVectors_2_vecs'>vecs</a> <a href='SkPoint_Reference#Vector'>vector</a> array of length <a href='#SkMatrix_mapVectors_2_count'>count</a> in place, multiplying each <a href='SkPoint_Reference#Vector'>vector</a> by
3527<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>, treating <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> translation as zero. Given:
3528
3529| A B 0 |         | x |
3530<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E 0 |,  vec = | y |
3531| G H <a href='#SkMatrix_I'>I</a> |         | 1 |
3532
3533where
3534
3535for (i = 0; i < <a href='#SkMatrix_mapVectors_2_count'>count</a>; ++i) {
3536x = <a href='#SkMatrix_mapVectors_2_vecs'>vecs</a>[i].fX
3537y = <a href='#SkMatrix_mapVectors_2_vecs'>vecs</a>[i].fY
3538}
3539
3540each result <a href='SkPoint_Reference#Vector'>vector</a> is computed as:
3541
3542|A B 0| |x|                            Ax+By     Dx+Ey
3543<a href='SkMatrix_Reference#Matrix'>Matrix</a> * vec = |D E 0| |y| = |Ax+By Dx+Ey Gx+Hy+<a href='#SkMatrix_I'>I</a>| = ------- , -------
3544|G H <a href='#SkMatrix_I'>I</a>| |1|                           Gx+Hy+<a href='#SkMatrix_I'>I</a>   Gx+Hy+<a href='#SkMatrix_I'>I</a>
3545
3546### Parameters
3547
3548<table>  <tr>    <td><a name='SkMatrix_mapVectors_2_vecs'><code><strong>vecs</strong></code></a></td>
3549    <td><a href='SkPoint_Reference#Vector'>vectors</a> to transform, and storage for mapped <a href='SkPoint_Reference#Vector'>vectors</a></td>
3550  </tr>
3551  <tr>    <td><a name='SkMatrix_mapVectors_2_count'><code><strong>count</strong></code></a></td>
3552    <td>number of <a href='SkPoint_Reference#Vector'>vectors</a> to transform</td>
3553  </tr>
3554</table>
3555
3556### Example
3557
3558<div><fiddle-embed name="5754501a00a1323e76353fb53153e939"></fiddle-embed></div>
3559
3560### See Also
3561
3562<a href='#SkMatrix_mapVector'>mapVector</a> <a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_mapXY'>mapXY</a>
3563
3564<a name='SkMatrix_mapVector'></a>
3565
3566---
3567
3568<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3569void <a href='#SkMatrix_mapVector'>mapVector</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy, <a href='SkPoint_Reference#SkVector'>SkVector</a>* result)const
3570</pre>
3571
3572Maps <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkMatrix_mapVector_dx'>dx</a>, <a href='#SkMatrix_mapVector_dy'>dy</a>) to <a href='#SkMatrix_mapVector_result'>result</a>. <a href='SkPoint_Reference#Vector'>Vector</a> is mapped by multiplying by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>,
3573treating <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> translation as zero. Given:
3574
3575| A B 0 |         | <a href='#SkMatrix_mapVector_dx'>dx</a> |
3576<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E 0 |,  vec = | <a href='#SkMatrix_mapVector_dy'>dy</a> |
3577| G H <a href='#SkMatrix_I'>I</a> |         |  1 |
3578
3579each <a href='#SkMatrix_mapVector_result'>result</a> <a href='SkPoint_Reference#Vector'>vector</a> is computed as:
3580
3581|A B 0| |<a href='#SkMatrix_mapVector_dx'>dx</a>|                                        A*<a href='#SkMatrix_mapVector_dx'>dx</a>+B*<a href='#SkMatrix_mapVector_dy'>dy</a>     D*<a href='#SkMatrix_mapVector_dx'>dx</a>+E*<a href='#SkMatrix_mapVector_dy'>dy</a>
3582<a href='SkMatrix_Reference#Matrix'>Matrix</a> * vec = |D E 0| |<a href='#SkMatrix_mapVector_dy'>dy</a>| = |A*<a href='#SkMatrix_mapVector_dx'>dx</a>+B*<a href='#SkMatrix_mapVector_dy'>dy</a> D*<a href='#SkMatrix_mapVector_dx'>dx</a>+E*<a href='#SkMatrix_mapVector_dy'>dy</a> G*<a href='#SkMatrix_mapVector_dx'>dx</a>+H*<a href='#SkMatrix_mapVector_dy'>dy</a>+<a href='#SkMatrix_I'>I</a>| = ----------- , -----------
3583|G H <a href='#SkMatrix_I'>I</a>| | 1|                                       G*<a href='#SkMatrix_mapVector_dx'>dx</a>+H*<a href='#SkMatrix_mapVector_dy'>dy</a>+<a href='#SkMatrix_I'>I</a>   G*<a href='#SkMatrix_mapVector_dx'>dx</a>+*dHy+<a href='#SkMatrix_I'>I</a>
3584
3585### Parameters
3586
3587<table>  <tr>    <td><a name='SkMatrix_mapVector_dx'><code><strong>dx</strong></code></a></td>
3588    <td>x-axis value of <a href='SkPoint_Reference#Vector'>vector</a> to map</td>
3589  </tr>
3590  <tr>    <td><a name='SkMatrix_mapVector_dy'><code><strong>dy</strong></code></a></td>
3591    <td>y-axis value of <a href='SkPoint_Reference#Vector'>vector</a> to map</td>
3592  </tr>
3593  <tr>    <td><a name='SkMatrix_mapVector_result'><code><strong>result</strong></code></a></td>
3594    <td>storage for mapped <a href='SkPoint_Reference#Vector'>vector</a></td>
3595  </tr>
3596</table>
3597
3598### Example
3599
3600<div><fiddle-embed name="aed143fc6cd0bce4ed029b98d1e61f2d"></fiddle-embed></div>
3601
3602### See Also
3603
3604<a href='#SkMatrix_mapVectors'>mapVectors</a> <a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_mapXY'>mapXY</a>
3605
3606<a name='SkMatrix_mapVector_2'></a>
3607
3608---
3609
3610<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3611<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkMatrix_mapVector'>mapVector</a>(<a href='undocumented#SkScalar'>SkScalar</a> dx, <a href='undocumented#SkScalar'>SkScalar</a> dy)const
3612</pre>
3613
3614Returns <a href='SkPoint_Reference#Vector'>vector</a> (<a href='#SkMatrix_mapVector_2_dx'>dx</a>, <a href='#SkMatrix_mapVector_2_dy'>dy</a>) multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>, treating <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> translation as zero.
3615Given:
3616
3617| A B 0 |         | <a href='#SkMatrix_mapVector_2_dx'>dx</a> |
3618<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E 0 |,  vec = | <a href='#SkMatrix_mapVector_2_dy'>dy</a> |
3619| G H <a href='#SkMatrix_I'>I</a> |         |  1 |
3620
3621each result <a href='SkPoint_Reference#Vector'>vector</a> is computed as:
3622
3623|A B 0| |<a href='#SkMatrix_mapVector_2_dx'>dx</a>|                                        A*<a href='#SkMatrix_mapVector_2_dx'>dx</a>+B*<a href='#SkMatrix_mapVector_2_dy'>dy</a>     D*<a href='#SkMatrix_mapVector_2_dx'>dx</a>+E*<a href='#SkMatrix_mapVector_2_dy'>dy</a>
3624<a href='SkMatrix_Reference#Matrix'>Matrix</a> * vec = |D E 0| |<a href='#SkMatrix_mapVector_2_dy'>dy</a>| = |A*<a href='#SkMatrix_mapVector_2_dx'>dx</a>+B*<a href='#SkMatrix_mapVector_2_dy'>dy</a> D*<a href='#SkMatrix_mapVector_2_dx'>dx</a>+E*<a href='#SkMatrix_mapVector_2_dy'>dy</a> G*<a href='#SkMatrix_mapVector_2_dx'>dx</a>+H*<a href='#SkMatrix_mapVector_2_dy'>dy</a>+<a href='#SkMatrix_I'>I</a>| = ----------- , -----------
3625|G H <a href='#SkMatrix_I'>I</a>| | 1|                                       G*<a href='#SkMatrix_mapVector_2_dx'>dx</a>+H*<a href='#SkMatrix_mapVector_2_dy'>dy</a>+<a href='#SkMatrix_I'>I</a>   G*<a href='#SkMatrix_mapVector_2_dx'>dx</a>+*dHy+<a href='#SkMatrix_I'>I</a>
3626
3627### Parameters
3628
3629<table>  <tr>    <td><a name='SkMatrix_mapVector_2_dx'><code><strong>dx</strong></code></a></td>
3630    <td>x-axis value of <a href='SkPoint_Reference#Vector'>vector</a> to map</td>
3631  </tr>
3632  <tr>    <td><a name='SkMatrix_mapVector_2_dy'><code><strong>dy</strong></code></a></td>
3633    <td>y-axis value of <a href='SkPoint_Reference#Vector'>vector</a> to map</td>
3634  </tr>
3635</table>
3636
3637### Return Value
3638
3639mapped <a href='SkPoint_Reference#Vector'>vector</a>
3640
3641### Example
3642
3643<div><fiddle-embed name="8bf1518db3f369696cd3065b541a8bd7"></fiddle-embed></div>
3644
3645### See Also
3646
3647<a href='#SkMatrix_mapVectors'>mapVectors</a> <a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_mapXY'>mapXY</a>
3648
3649<a name='SkMatrix_mapRect'></a>
3650
3651---
3652
3653<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3654bool <a href='#SkMatrix_mapRect'>mapRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* dst, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src)const
3655</pre>
3656
3657Sets <a href='#SkMatrix_mapRect_dst'>dst</a> to bounds of <a href='#SkMatrix_mapRect_src'>src</a> corners mapped by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
3658Returns true if mapped corners are <a href='#SkMatrix_mapRect_dst'>dst</a> corners.
3659
3660Returned value is the same as calling <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>().
3661
3662### Parameters
3663
3664<table>  <tr>    <td><a name='SkMatrix_mapRect_dst'><code><strong>dst</strong></code></a></td>
3665    <td>storage for bounds of mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td>
3666  </tr>
3667  <tr>    <td><a name='SkMatrix_mapRect_src'><code><strong>src</strong></code></a></td>
3668    <td><a href='SkRect_Reference#SkRect'>SkRect</a> to map</td>
3669  </tr>
3670</table>
3671
3672### Return Value
3673
3674true if <a href='#SkMatrix_mapRect_dst'>dst</a> is equivalent to mapped <a href='#SkMatrix_mapRect_src'>src</a>
3675
3676### Example
3677
3678<div><fiddle-embed name="dbcf928b035a31ca69c99392e2e2cca9"></fiddle-embed></div>
3679
3680### See Also
3681
3682<a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>
3683
3684<a name='SkMatrix_mapRect_2'></a>
3685
3686---
3687
3688<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3689bool <a href='#SkMatrix_mapRect'>mapRect</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* <a href='SkRect_Reference#Rect'>rect</a>)const
3690</pre>
3691
3692Sets <a href='#SkMatrix_mapRect_2_rect'>rect</a> to bounds of <a href='#SkMatrix_mapRect_2_rect'>rect</a> corners mapped by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
3693Returns true if mapped corners are computed <a href='#SkMatrix_mapRect_2_rect'>rect</a> corners.
3694
3695Returned value is the same as calling <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>().
3696
3697### Parameters
3698
3699<table>  <tr>    <td><a name='SkMatrix_mapRect_2_rect'><code><strong>rect</strong></code></a></td>
3700    <td>rectangle to map, and storage for bounds of mapped corners</td>
3701  </tr>
3702</table>
3703
3704### Return Value
3705
3706true if result is equivalent to mapped <a href='#SkMatrix_mapRect_2_rect'>rect</a>
3707
3708### Example
3709
3710<div><fiddle-embed name="5fafd0bd23d1ed37425b970b4a3c6cc9"></fiddle-embed></div>
3711
3712### See Also
3713
3714<a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a> <a href='#SkMatrix_mapPoints'>mapPoints</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>
3715
3716<a name='SkMatrix_mapRect_3'></a>
3717
3718---
3719
3720<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3721<a href='SkRect_Reference#SkRect'>SkRect</a> <a href='#SkMatrix_mapRect'>mapRect</a>(const <a href='SkRect_Reference#SkRect'>SkRect</a>& src)const
3722</pre>
3723
3724Returns bounds of <a href='#SkMatrix_mapRect_3_src'>src</a> corners mapped by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
3725
3726### Parameters
3727
3728<table>  <tr>    <td><a name='SkMatrix_mapRect_3_src'><code><strong>src</strong></code></a></td>
3729    <td>rectangle to map</td>
3730  </tr>
3731</table>
3732
3733### Return Value
3734
3735mapped bounds
3736
3737### Example
3738
3739<div><fiddle-embed name="3b7b1f884437ab450f986234e4aec27f"></fiddle-embed></div>
3740
3741### See Also
3742
3743<a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a> <a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a>
3744
3745<a name='SkMatrix_mapRectToQuad'></a>
3746
3747---
3748
3749<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3750void <a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a>(<a href='SkPoint_Reference#SkPoint'>SkPoint</a> dst[4], const <a href='SkRect_Reference#SkRect'>SkRect</a>& <a href='SkRect_Reference#Rect'>rect</a>)const
3751</pre>
3752
3753Maps four corners of <a href='#SkMatrix_mapRectToQuad_rect'>rect</a> to <a href='#SkMatrix_mapRectToQuad_dst'>dst</a>. <a href='SkPoint_Reference#SkPoint'>SkPoint</a> are mapped by multiplying each
3754<a href='#SkMatrix_mapRectToQuad_rect'>rect</a> corner by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. <a href='#SkMatrix_mapRectToQuad_rect'>rect</a> corner is processed in this order:
3755(<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fTop'>fTop</a>), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fRight'>fRight</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fTop'>fTop</a>), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fRight'>fRight</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fBottom'>fBottom</a>),
3756(<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fBottom'>fBottom</a>).
3757
3758<a href='#SkMatrix_mapRectToQuad_rect'>rect</a> may be empty: <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fLeft'>fLeft</a> may be greater than or equal to <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fRight'>fRight</a>;
3759<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fTop'>fTop</a> may be greater than or equal to <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fBottom'>fBottom</a>.
3760
3761Given:
3762
3763| A B C |        | x |
3764<a href='SkMatrix_Reference#Matrix'>Matrix</a> = | D E F |,  pt = | y |
3765| G H <a href='#SkMatrix_I'>I</a> |        | 1 |
3766
3767where pt is initialized from each of (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fTop'>fTop</a>),
3768(<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fRight'>fRight</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fTop'>fTop</a>), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fRight'>fRight</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fBottom'>fBottom</a>), (<a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fLeft'>fLeft</a>, <a href='#SkMatrix_mapRectToQuad_rect'>rect</a>.<a href='#SkRect_fBottom'>fBottom</a>),
3769each <a href='#SkMatrix_mapRectToQuad_dst'>dst</a> <a href='SkPoint_Reference#SkPoint'>SkPoint</a> is computed as:
3770
3771|A B C| |x|                               Ax+By+C   Dx+Ey+F
3772<a href='SkMatrix_Reference#Matrix'>Matrix</a> * pt = |D E F| |y| = |Ax+By+C Dx+Ey+F Gx+Hy+<a href='#SkMatrix_I'>I</a>| = ------- , -------
3773|G H <a href='#SkMatrix_I'>I</a>| |1|                               Gx+Hy+<a href='#SkMatrix_I'>I</a>   Gx+Hy+<a href='#SkMatrix_I'>I</a>
3774
3775### Parameters
3776
3777<table>  <tr>    <td><a name='SkMatrix_mapRectToQuad_dst'><code><strong>dst</strong></code></a></td>
3778    <td>storage for mapped corner <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td>
3779  </tr>
3780  <tr>    <td><a name='SkMatrix_mapRectToQuad_rect'><code><strong>rect</strong></code></a></td>
3781    <td><a href='SkRect_Reference#SkRect'>SkRect</a> to map</td>
3782  </tr>
3783</table>
3784
3785### Example
3786
3787<div><fiddle-embed name="c69cd2a590b5733c3cbc92cb9ceed3f5"></fiddle-embed></div>
3788
3789### See Also
3790
3791<a href='#SkMatrix_mapRect'>mapRect</a> <a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a>
3792
3793<a name='SkMatrix_mapRectScaleTranslate'></a>
3794
3795---
3796
3797<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3798void <a href='#SkMatrix_mapRectScaleTranslate'>mapRectScaleTranslate</a>(<a href='SkRect_Reference#SkRect'>SkRect</a>* dst, const <a href='SkRect_Reference#SkRect'>SkRect</a>& src)const
3799</pre>
3800
3801Sets <a href='#SkMatrix_mapRectScaleTranslate_dst'>dst</a> to bounds of <a href='#SkMatrix_mapRectScaleTranslate_src'>src</a> corners mapped by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. If <a href='SkMatrix_Reference#Matrix'>matrix</a> contains
3802elements other than scale or translate: asserts if SK_DEBUG is defined;
3803otherwise, results are undefined.
3804
3805### Parameters
3806
3807<table>  <tr>    <td><a name='SkMatrix_mapRectScaleTranslate_dst'><code><strong>dst</strong></code></a></td>
3808    <td>storage for bounds of mapped <a href='SkPoint_Reference#SkPoint'>SkPoint</a></td>
3809  </tr>
3810  <tr>    <td><a name='SkMatrix_mapRectScaleTranslate_src'><code><strong>src</strong></code></a></td>
3811    <td><a href='SkRect_Reference#SkRect'>SkRect</a> to map</td>
3812  </tr>
3813</table>
3814
3815### Example
3816
3817<div><fiddle-embed name="62bc26989c2b4c2a54d516596a71dd97"></fiddle-embed></div>
3818
3819### See Also
3820
3821<a href='#SkMatrix_mapRect'>mapRect</a> <a href='#SkMatrix_mapRectToQuad'>mapRectToQuad</a> <a href='#SkMatrix_isScaleTranslate'>isScaleTranslate</a> <a href='#SkMatrix_rectStaysRect'>rectStaysRect</a>
3822
3823<a name='SkMatrix_mapRadius'></a>
3824
3825---
3826
3827<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3828<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_mapRadius'>mapRadius</a>(<a href='undocumented#SkScalar'>SkScalar</a> radius)const
3829</pre>
3830
3831Returns geometric mean <a href='#SkMatrix_mapRadius_radius'>radius</a> of ellipse formed by constructing <a href='undocumented#Circle'>circle</a> of
3832<a href='undocumented#Size'>size</a> <a href='#SkMatrix_mapRadius_radius'>radius</a>, and mapping constructed <a href='undocumented#Circle'>circle</a> with <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. The result squared is
3833equal to the major axis length times the minor axis length.
3834Result is not meaningful if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contains perspective elements.
3835
3836### Parameters
3837
3838<table>  <tr>    <td><a name='SkMatrix_mapRadius_radius'><code><strong>radius</strong></code></a></td>
3839    <td><a href='undocumented#Circle'>circle</a> <a href='undocumented#Size'>size</a> to map</td>
3840  </tr>
3841</table>
3842
3843### Return Value
3844
3845average mapped <a href='#SkMatrix_mapRadius_radius'>radius</a>
3846
3847### Example
3848
3849<div><fiddle-embed name="6d6f2082fcf59d9f02bfb1758b87db69"><div>The area enclosed by a square with sides equal to mappedRadius is the same as
3850the area enclosed by the ellipse major and minor axes.
3851</div></fiddle-embed></div>
3852
3853### See Also
3854
3855<a href='#SkMatrix_mapVector'>mapVector</a>
3856
3857<a name='SkMatrix_isFixedStepInX'></a>
3858
3859---
3860
3861<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3862bool <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a>()const
3863</pre>
3864
3865Returns true if a unit step on x-axis at some y-axis value mapped through <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
3866can be represented by a constant <a href='SkPoint_Reference#Vector'>vector</a>. Returns true if <a href='#SkMatrix_getType'>getType</a>() returns
3867<a href='#SkMatrix_kIdentity_Mask'>kIdentity_Mask</a>, or combinations of: <a href='#SkMatrix_kTranslate_Mask'>kTranslate_Mask</a>, <a href='#SkMatrix_kScale_Mask'>kScale_Mask</a>, and <a href='#SkMatrix_kAffine_Mask'>kAffine_Mask</a>.
3868
3869May return true if <a href='#SkMatrix_getType'>getType</a>() returns <a href='#SkMatrix_kPerspective_Mask'>kPerspective_Mask</a>, but only when <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
3870does not include rotation or skewing along the y-axis.
3871
3872### Return Value
3873
3874true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> does not have complex perspective
3875
3876### Example
3877
3878<div><fiddle-embed name="ab57b232acef69f26de9cb23d23c8a1a">
3879
3880#### Example Output
3881
3882~~~~
3883[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.0000   0.0000   1.0000]
3884isFixedStepInX: true
3885[  1.0000   0.0000   0.0000][  0.0000   2.0000   0.0000][  0.0000   0.0000   1.0000]
3886isFixedStepInX: true
3887[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.0000   0.1000   1.0000]
3888isFixedStepInX: true
3889[  1.0000   0.0000   0.0000][  0.0000   2.0000   0.0000][  0.0000   0.1000   1.0000]
3890isFixedStepInX: true
3891[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.1000   0.0000   1.0000]
3892isFixedStepInX: false
3893[  1.0000   0.0000   0.0000][  0.0000   2.0000   0.0000][  0.1000   0.0000   1.0000]
3894isFixedStepInX: false
3895[  1.0000   0.0000   0.0000][  0.0000   1.0000   0.0000][  0.1000   0.1000   1.0000]
3896isFixedStepInX: false
3897[  1.0000   0.0000   0.0000][  0.0000   2.0000   0.0000][  0.1000   0.1000   1.0000]
3898isFixedStepInX: false
3899~~~~
3900
3901</fiddle-embed></div>
3902
3903### See Also
3904
3905<a href='#SkMatrix_fixedStepInX'>fixedStepInX</a> <a href='#SkMatrix_getType'>getType</a>
3906
3907<a name='SkMatrix_fixedStepInX'></a>
3908
3909---
3910
3911<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3912<a href='SkPoint_Reference#SkVector'>SkVector</a> <a href='#SkMatrix_fixedStepInX'>fixedStepInX</a>(<a href='undocumented#SkScalar'>SkScalar</a> y)const
3913</pre>
3914
3915Returns <a href='SkPoint_Reference#Vector'>vector</a> representing a unit step on x-axis at <a href='#SkMatrix_fixedStepInX_y'>y</a> mapped through <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>.
3916If <a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a>() is false, returned value is undefined.
3917
3918### Parameters
3919
3920<table>  <tr>    <td><a name='SkMatrix_fixedStepInX_y'><code><strong>y</strong></code></a></td>
3921    <td>position of <a href='undocumented#Line'>line</a> parallel to x-axis</td>
3922  </tr>
3923</table>
3924
3925### Return Value
3926
3927<a href='SkPoint_Reference#Vector'>vector</a> advance of mapped unit step on x-axis
3928
3929### Example
3930
3931<div><fiddle-embed name="fad6b92b21b1e1deeae61978cec2d232"></fiddle-embed></div>
3932
3933### See Also
3934
3935<a href='#SkMatrix_isFixedStepInX'>isFixedStepInX</a> <a href='#SkMatrix_getType'>getType</a>
3936
3937<a name='SkMatrix_cheapEqualTo'></a>
3938
3939---
3940
3941<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3942bool <a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& m)const
3943</pre>
3944
3945Returns true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> equals <a href='#SkMatrix_cheapEqualTo_m'>m</a>, using an efficient comparison.
3946
3947Returns false when the sign of zero values is the different; when one
3948<a href='SkMatrix_Reference#Matrix'>matrix</a> has positive zero value and the other has negative zero value.
3949
3950Returns true even when both <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contain NaN.
3951
3952NaN never equals any value, including itself. To improve performance, NaN values
3953are treated as bit patterns that are equal if their bit patterns are equal.
3954
3955### Parameters
3956
3957<table>  <tr>    <td><a name='SkMatrix_cheapEqualTo_m'><code><strong>m</strong></code></a></td>
3958    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to compare</td>
3959  </tr>
3960</table>
3961
3962### Return Value
3963
3964true if <a href='#SkMatrix_cheapEqualTo_m'>m</a> and <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> are represented by identical bit patterns
3965
3966### Example
3967
3968<div><fiddle-embed name="39016b3cfc6bbabb09348a53822ce508">
3969
3970#### Example Output
3971
3972~~~~
3973identity: a == b a.cheapEqualTo(b): true
3974neg zero: a == b a.cheapEqualTo(b): false
3975one NaN: a != b a.cheapEqualTo(b): false
3976both NaN: a != b a.cheapEqualTo(b): true
3977~~~~
3978
3979</fiddle-embed></div>
3980
3981### See Also
3982
3983<a href='#SkMatrix_equal_operator'>operator==</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b)
3984
3985<a name='SkMatrix_equal_operator'></a>
3986
3987---
3988
3989<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
3990bool <a href='#SkMatrix_equal_operator'>operator==</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b)
3991</pre>
3992
3993Compares <a href='#SkMatrix_equal_operator_a'>a</a> and <a href='#SkMatrix_equal_operator_b'>b</a>; returns true if <a href='#SkMatrix_equal_operator_a'>a</a> and <a href='#SkMatrix_equal_operator_b'>b</a> are numerically equal. Returns true
3994even if sign of zero values are different. Returns false if either <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
3995contains NaN, even if the other <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> also contains NaN.
3996
3997### Parameters
3998
3999<table>  <tr>    <td><a name='SkMatrix_equal_operator_a'><code><strong>a</strong></code></a></td>
4000    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to compare</td>
4001  </tr>
4002  <tr>    <td><a name='SkMatrix_equal_operator_b'><code><strong>b</strong></code></a></td>
4003    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to compare</td>
4004  </tr>
4005</table>
4006
4007### Return Value
4008
4009true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_equal_operator_a'>a</a> and <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_equal_operator_b'>b</a> are numerically equal
4010
4011### Example
4012
4013<div><fiddle-embed name="3902859150b0f0c4aeb1f25d00434baa">
4014
4015#### Example Output
4016
4017~~~~
4018identity: a == b a.cheapEqualTo(b): true
4019~~~~
4020
4021</fiddle-embed></div>
4022
4023### See Also
4024
4025<a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a> <a href='#SkMatrix_notequal_operator'>operator!=</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_equal_operator_a'>a</a>, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_equal_operator_b'>b</a>)
4026
4027<a name='SkMatrix_notequal_operator'></a>
4028
4029---
4030
4031<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4032bool <a href='#SkMatrix_notequal_operator'>operator!=</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b)
4033</pre>
4034
4035Compares <a href='#SkMatrix_notequal_operator_a'>a</a> and <a href='#SkMatrix_notequal_operator_b'>b</a>; returns true if <a href='#SkMatrix_notequal_operator_a'>a</a> and <a href='#SkMatrix_notequal_operator_b'>b</a> are not numerically equal. Returns false
4036even if sign of zero values are different. Returns true if either <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
4037contains NaN, even if the other <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> also contains NaN.
4038
4039### Parameters
4040
4041<table>  <tr>    <td><a name='SkMatrix_notequal_operator_a'><code><strong>a</strong></code></a></td>
4042    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to compare</td>
4043  </tr>
4044  <tr>    <td><a name='SkMatrix_notequal_operator_b'><code><strong>b</strong></code></a></td>
4045    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to compare</td>
4046  </tr>
4047</table>
4048
4049### Return Value
4050
4051true if <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_notequal_operator_a'>a</a> and <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_notequal_operator_b'>b</a> are numerically not equal
4052
4053### Example
4054
4055<div><fiddle-embed name="088ab41f877599f980a99523749b0afd"></fiddle-embed></div>
4056
4057### See Also
4058
4059<a href='#SkMatrix_cheapEqualTo'>cheapEqualTo</a> <a href='#SkMatrix_equal_operator'>operator==</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_notequal_operator_a'>a</a>, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_notequal_operator_b'>b</a>)
4060
4061<a name='Utility'></a>
4062
4063<a name='SkMatrix_dump'></a>
4064
4065---
4066
4067<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4068void <a href='#SkMatrix_dump'>dump()</a>const
4069</pre>
4070
4071Writes <a href='undocumented#Text'>text</a> representation of <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to standard output. Floating <a href='SkPoint_Reference#Point'>point</a> values
4072are written with limited precision; it may not be possible to reconstruct
4073original <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> from output.
4074
4075### Example
4076
4077<div><fiddle-embed name="8d72a4818e5a9188348f6c08ab5d8a40">
4078
4079#### Example Output
4080
4081~~~~
4082[  0.7071  -0.7071   0.0000][  0.7071   0.7071   0.0000][  0.0000   0.0000   1.0000]
4083[  0.7071  -0.7071   0.0000][  0.7071   0.7071   0.0000][  0.0000   0.0000   1.0000]
4084matrix != nearlyEqual
4085~~~~
4086
4087</fiddle-embed></div>
4088
4089### See Also
4090
4091<a href='SkPath_Reference#SkPath'>SkPath</a>::<a href='#SkPath_dump'>dump</a>
4092
4093<a name='SkMatrix_getMinScale'></a>
4094
4095---
4096
4097<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4098<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getMinScale'>getMinScale</a>()const
4099</pre>
4100
4101Returns the minimum scaling factor of <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> by decomposing the scaling and
4102skewing elements.
4103Returns -1 if scale factor overflows or <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contains perspective.
4104
4105### Return Value
4106
4107minimum scale factor
4108
4109### Example
4110
4111<div><fiddle-embed name="1d6f67904c88a806c3731879e9af4ae5">
4112
4113#### Example Output
4114
4115~~~~
4116matrix.getMinScale() 24
4117~~~~
4118
4119</fiddle-embed></div>
4120
4121### See Also
4122
4123<a href='#SkMatrix_getMaxScale'>getMaxScale</a> <a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a>
4124
4125<a name='SkMatrix_getMaxScale'></a>
4126
4127---
4128
4129<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4130<a href='undocumented#SkScalar'>SkScalar</a> <a href='#SkMatrix_getMaxScale'>getMaxScale</a>()const
4131</pre>
4132
4133Returns the maximum scaling factor of <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> by decomposing the scaling and
4134skewing elements.
4135Returns -1 if scale factor overflows or <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> contains perspective.
4136
4137### Return Value
4138
4139maximum scale factor
4140
4141### Example
4142
4143<div><fiddle-embed name="3fee4364929899649cf9efc37897e964">
4144
4145#### Example Output
4146
4147~~~~
4148matrix.getMaxScale() 42
4149~~~~
4150
4151</fiddle-embed></div>
4152
4153### See Also
4154
4155<a href='#SkMatrix_getMinScale'>getMinScale</a> <a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a>
4156
4157<a name='SkMatrix_getMinMaxScales'></a>
4158
4159---
4160
4161<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4162bool <a href='#SkMatrix_getMinMaxScales'>getMinMaxScales</a>(<a href='undocumented#SkScalar'>SkScalar</a> scaleFactors[2])const
4163</pre>
4164
4165Sets <a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a>[0] to the minimum scaling factor, and <a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a>[1] to the
4166maximum scaling factor. Scaling factors are computed by decomposing
4167the <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> scaling and skewing elements.
4168
4169Returns true if <a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a> are found; otherwise, returns false and sets
4170<a href='#SkMatrix_getMinMaxScales_scaleFactors'>scaleFactors</a> to undefined values.
4171
4172### Parameters
4173
4174<table>  <tr>    <td><a name='SkMatrix_getMinMaxScales_scaleFactors'><code><strong>scaleFactors</strong></code></a></td>
4175    <td>storage for minimum and maximum scale factors</td>
4176  </tr>
4177</table>
4178
4179### Return Value
4180
4181true if scale factors were computed correctly
4182
4183### Example
4184
4185<div><fiddle-embed name="13adba0ecf5f82247cf051b4fa4d8a9c">
4186
4187#### Example Output
4188
4189~~~~
4190matrix.getMinMaxScales() false 2 2
4191~~~~
4192
4193</fiddle-embed></div>
4194
4195### See Also
4196
4197<a href='#SkMatrix_getMinScale'>getMinScale</a> <a href='#SkMatrix_getMaxScale'>getMaxScale</a>
4198
4199<a name='SkMatrix_decomposeScale'></a>
4200
4201---
4202
4203<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4204bool <a href='#SkMatrix_decomposeScale'>decomposeScale</a>(<a href='undocumented#SkSize'>SkSize</a>* scale, <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>* remaining = nullptr)const
4205</pre>
4206
4207Decomposes <a href='SkMatrix_Reference#Matrix'>Matrix</a> into <a href='#SkMatrix_decomposeScale_scale'>scale</a> components and whatever remains. Returns false if
4208<a href='SkMatrix_Reference#Matrix'>Matrix</a> could not be decomposed.
4209
4210Sets <a href='#SkMatrix_decomposeScale_scale'>scale</a> to portion of <a href='SkMatrix_Reference#Matrix'>Matrix</a> that <a href='#SkMatrix_decomposeScale_scale'>scale</a> axes. Sets <a href='#SkMatrix_decomposeScale_remaining'>remaining</a> to <a href='SkMatrix_Reference#Matrix'>Matrix</a>
4211with scaling factored out. <a href='#SkMatrix_decomposeScale_remaining'>remaining</a> may be passed as nullptr
4212to determine if <a href='SkMatrix_Reference#Matrix'>Matrix</a> can be decomposed without computing remainder.
4213
4214Returns true if <a href='#SkMatrix_decomposeScale_scale'>scale</a> components are found. <a href='#SkMatrix_decomposeScale_scale'>scale</a> and <a href='#SkMatrix_decomposeScale_remaining'>remaining</a> are
4215unchanged if <a href='SkMatrix_Reference#Matrix'>Matrix</a> contains perspective; <a href='#SkMatrix_decomposeScale_scale'>scale</a> factors are not finite, or
4216are nearly zero.
4217
4218On success: <code><a href='SkMatrix_Reference#Matrix'>Matrix</a> = <a href='#SkMatrix_decomposeScale_scale'>scale</a> * Remaining</code>.
4219
4220### Parameters
4221
4222<table>  <tr>    <td><a name='SkMatrix_decomposeScale_scale'><code><strong>scale</strong></code></a></td>
4223    <td>axes scaling factors; may be nullptr</td>
4224  </tr>
4225  <tr>    <td><a name='SkMatrix_decomposeScale_remaining'><code><strong>remaining</strong></code></a></td>
4226    <td><a href='SkMatrix_Reference#Matrix'>Matrix</a> without scaling; may be nullptr</td>
4227  </tr>
4228</table>
4229
4230### Return Value
4231
4232true if <a href='#SkMatrix_decomposeScale_scale'>scale</a> can be computed
4233
4234### Example
4235
4236<div><fiddle-embed name="139b874da0a3ede1f3df88119085c0aa">
4237
4238#### Example Output
4239
4240~~~~
4241[  0.0000  -0.2500   0.0000][  0.5000   0.0000   0.0000][  0.0000   0.0000   1.0000]
4242success: true  scale: 0.5, 0.25
4243[  0.0000  -0.5000   0.0000][  2.0000   0.0000   0.0000][  0.0000   0.0000   1.0000]
4244[  0.0000  -0.2500   0.0000][  0.5000   0.0000   0.0000][  0.0000   0.0000   1.0000]
4245~~~~
4246
4247</fiddle-embed></div>
4248
4249### See Also
4250
4251<a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_MakeScale'>MakeScale</a>
4252
4253<a name='SkMatrix_I'></a>
4254
4255---
4256
4257<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4258static const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_I'>I</a>()
4259</pre>
4260
4261Returns reference to const identity <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>. Returned <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is set to:
4262
4263| 1 0 0 |
4264| 0 1 0 |
4265| 0 0 1 |
4266
4267### Return Value
4268
4269const identity <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
4270
4271### Example
4272
4273<div><fiddle-embed name="d961d91020f19037204a8c3fd8cb1060">
4274
4275#### Example Output
4276
4277~~~~
4278m1 == m2
4279m2 == m3
4280~~~~
4281
4282</fiddle-embed></div>
4283
4284### See Also
4285
4286<a href='#SkMatrix_reset'>reset()</a> <a href='#SkMatrix_setIdentity'>setIdentity</a>
4287
4288<a name='SkMatrix_InvalidMatrix'></a>
4289
4290---
4291
4292<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4293static const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& <a href='#SkMatrix_InvalidMatrix'>InvalidMatrix</a>()
4294</pre>
4295
4296Returns reference to a const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> with invalid values. Returned <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> is set
4297to:
4298
4299| <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> |
4300| <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> |
4301| <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> <a href='undocumented#SK_ScalarMax'>SK_ScalarMax</a> |
4302
4303### Return Value
4304
4305const invalid <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>
4306
4307### Example
4308
4309<div><fiddle-embed name="af0b72360c1c7a25b4754bfa47011dd5">
4310
4311#### Example Output
4312
4313~~~~
4314scaleX 3.40282e+38
4315~~~~
4316
4317</fiddle-embed></div>
4318
4319### See Also
4320
4321<a href='#SkMatrix_getType'>getType</a>
4322
4323<a name='SkMatrix_Concat'></a>
4324
4325---
4326
4327<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4328static <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_Concat'>Concat</a>(const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& a, const <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a>& b)
4329</pre>
4330
4331Returns <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_Concat_a'>a</a> multiplied by <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> <a href='#SkMatrix_Concat_b'>b</a>.
4332
4333Given:
4334
4335| A B C |      | J K L |
4336<a href='#SkMatrix_Concat_a'>a</a> = | D E F |, <a href='#SkMatrix_Concat_b'>b</a> = | M N O |
4337| G H <a href='#SkMatrix_I'>I</a> |      | P Q R |
4338
4339sets <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> to:
4340
4341| A B C |   | J K L |   | AJ+BM+CP AK+BN+CQ AL+BO+CR |
4342<a href='#SkMatrix_Concat_a'>a</a> * <a href='#SkMatrix_Concat_b'>b</a> = | D E F | * | M N O | = | DJ+EM+FP DK+EN+FQ DL+EO+FR |
4343| G H <a href='#SkMatrix_I'>I</a> |   | P Q R |   | GJ+HM+IP GK+HN+IQ GL+HO+IR |
4344
4345### Parameters
4346
4347<table>  <tr>    <td><a name='SkMatrix_Concat_a'><code><strong>a</strong></code></a></td>
4348    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> on  left side of multiply expression</td>
4349  </tr>
4350  <tr>    <td><a name='SkMatrix_Concat_b'><code><strong>b</strong></code></a></td>
4351    <td><a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> on  right side of multiply expression</td>
4352  </tr>
4353</table>
4354
4355### Return Value
4356
4357<a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> computed from <a href='#SkMatrix_Concat_a'>a</a> times <a href='#SkMatrix_Concat_b'>b</a>
4358
4359### Example
4360
4361<div><fiddle-embed name="6b4562c7052da94f3d5b2412dca41946"><div><a href='#SkMatrix_setPolyToPoly'>setPolyToPoly</a> creates perspective <a href='SkMatrix_Reference#Matrix'>matrices</a>, one the inverse of the other.
4362Multiplying the <a href='SkMatrix_Reference#Matrix'>matrix</a> by its inverse turns into an identity <a href='SkMatrix_Reference#Matrix'>matrix</a>.
4363</div></fiddle-embed></div>
4364
4365### See Also
4366
4367<a href='#SkMatrix_preConcat'>preConcat</a> <a href='#SkMatrix_postConcat'>postConcat</a>
4368
4369<a name='SkMatrix_dirtyMatrixTypeCache'></a>
4370
4371---
4372
4373<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4374void <a href='#SkMatrix_dirtyMatrixTypeCache'>dirtyMatrixTypeCache</a>()
4375</pre>
4376
4377Sets internal cache to unknown state. Use to force update after repeated
4378modifications to <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> element reference returned by <a href='#SkMatrix_array1_operator'>operator[]</a>(int index).
4379
4380### Example
4381
4382<div><fiddle-embed name="f4365ef332f51f7fd25040e0771ba9a2">
4383
4384#### Example Output
4385
4386~~~~
4387with identity matrix: x = 24
4388after skew x mod:     x = 24
4389after 2nd skew x mod: x = 24
4390after dirty cache:    x = 66
4391~~~~
4392
4393</fiddle-embed></div>
4394
4395### See Also
4396
4397<a href='#SkMatrix_array1_operator'>operator[]</a>(int index) <a href='#SkMatrix_getType'>getType</a>
4398
4399<a name='SkMatrix_setScaleTranslate'></a>
4400
4401---
4402
4403<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4404void <a href='#SkMatrix_setScaleTranslate'>setScaleTranslate</a>(<a href='undocumented#SkScalar'>SkScalar</a> sx, <a href='undocumented#SkScalar'>SkScalar</a> sy, <a href='undocumented#SkScalar'>SkScalar</a> tx, <a href='undocumented#SkScalar'>SkScalar</a> ty)
4405</pre>
4406
4407Initializes <a href='SkMatrix_Reference#SkMatrix'>SkMatrix</a> with scale and translate elements.
4408
4409| <a href='#SkMatrix_setScaleTranslate_sx'>sx</a>  0 <a href='#SkMatrix_setScaleTranslate_tx'>tx</a> |
4410|  0 <a href='#SkMatrix_setScaleTranslate_sy'>sy</a> <a href='#SkMatrix_setScaleTranslate_ty'>ty</a> |
4411|  0  0  1 |
4412
4413### Parameters
4414
4415<table>  <tr>    <td><a name='SkMatrix_setScaleTranslate_sx'><code><strong>sx</strong></code></a></td>
4416    <td>horizontal scale factor to store</td>
4417  </tr>
4418  <tr>    <td><a name='SkMatrix_setScaleTranslate_sy'><code><strong>sy</strong></code></a></td>
4419    <td>vertical scale factor to store</td>
4420  </tr>
4421  <tr>    <td><a name='SkMatrix_setScaleTranslate_tx'><code><strong>tx</strong></code></a></td>
4422    <td>horizontal translation to store</td>
4423  </tr>
4424  <tr>    <td><a name='SkMatrix_setScaleTranslate_ty'><code><strong>ty</strong></code></a></td>
4425    <td>vertical translation to store</td>
4426  </tr>
4427</table>
4428
4429### Example
4430
4431<div><fiddle-embed name="fed43797f13796529cb6731385d6f8f3">
4432
4433#### Example Output
4434
4435~~~~
4436[  1.0000   0.0000   3.0000][  0.0000   2.0000   4.0000][  0.0000   0.0000   1.0000]
4437~~~~
4438
4439</fiddle-embed></div>
4440
4441### See Also
4442
4443<a href='#SkMatrix_setScale'>setScale</a> <a href='#SkMatrix_preTranslate'>preTranslate</a> <a href='#SkMatrix_postTranslate'>postTranslate</a>
4444
4445<a name='SkMatrix_isFinite'></a>
4446
4447---
4448
4449<pre style="padding: 1em 1em 1em 1em; width: 62.5em;background-color: #f0f0f0">
4450bool <a href='#SkMatrix_isFinite'>isFinite</a>()const
4451</pre>
4452
4453Returns true if all elements of the <a href='SkMatrix_Reference#Matrix'>matrix</a> are finite. Returns false if any
4454element is infinity, or NaN.
4455
4456### Return Value
4457
4458true if <a href='SkMatrix_Reference#Matrix'>matrix</a> has only finite elements
4459
4460### Example
4461
4462<div><fiddle-embed name="bc6c6f6a5df770287120d87f81b922eb">
4463
4464#### Example Output
4465
4466~~~~
4467[  1.0000   0.0000      nan][  0.0000   1.0000   0.0000][  0.0000   0.0000   1.0000]
4468matrix is finite: false
4469matrix != matrix
4470~~~~
4471
4472</fiddle-embed></div>
4473
4474### See Also
4475
4476operator==
4477
4478