Home | History | Annotate | Download | only in core

Lines Matching full:fmat

40     fMat[kMScaleX] = fMat[kMScaleY] = SK_Scalar1;
41 fMat[kMSkewX] = fMat[kMSkewY] =
42 fMat[kMTransX] = fMat[kMTransY] =
43 fMat[kMPersp0] = fMat[kMPersp1] = 0;
44 fMat[kMPersp2] = kMatrix22Elem;
74 if (SkScalarAs2sCompliment(fMat[kMPersp0]) |
75 SkScalarAs2sCompliment(fMat[kMPersp1]) |
76 (SkScalarAs2sCompliment(fMat[kMPersp2]) - kPersp1Int)) {
80 if (SkScalarAs2sCompliment(fMat[kMTransX]) |
81 SkScalarAs2sCompliment(fMat[kMTransY])) {
85 int m00 = SkScalarAs2sCompliment(fMat[SkMatrix::kMScaleX]);
86 int m01 = SkScalarAs2sCompliment(fMat[SkMatrix::kMSkewX]);
87 int m10 = SkScalarAs2sCompliment(fMat[SkMatrix::kMSkewY]);
88 int m11 = SkScalarAs2sCompliment(fMat[SkMatrix::kMScaleY]);
124 fMat[kMTransX] = dx;
125 fMat[kMTransY] = dy;
127 fMat[kMScaleX] = fMat[kMScaleY] = SK_Scalar1;
128 fMat[kMSkewX] = fMat[kMSkewY] =
129 fMat[kMPersp0] = fMat[kMPersp1] = 0;
130 fMat[kMPersp2] = kMatrix22Elem;
146 fMat[kMTransX] += SkScalarMul(fMat[kMScaleX], dx) +
147 SkScalarMul(fMat[kMSkewX], dy);
148 fMat[kMTransY] += SkScalarMul(fMat[kMSkewY], dx) +
149 SkScalarMul(fMat[kMScaleY], dy);
164 fMat[kMTransX] += dx;
165 fMat[kMTransY] += dy;
174 fMat[kMScaleX] = sx;
175 fMat[kMScaleY] = sy;
176 fMat[kMTransX] = px - SkScalarMul(sx, px);
177 fMat[kMTransY] = py - SkScalarMul(sy, py);
178 fMat[kMPersp2] = kMatrix22Elem;
180 fMat[kMSkewX] = fMat[kMSkewY] =
181 fMat[kMPersp0] = fMat[kMPersp1] = 0;
187 fMat[kMScaleX] = sx;
188 fMat[kMScaleY] = sy;
189 fMat[kMPersp2] = kMatrix22Elem;
191 fMat[kMTransX] = fMat[kMTransY] =
192 fMat[kMSkewX] = fMat[kMSkewY] =
193 fMat[kMPersp0] = fMat[kMPersp1] = 0;
243 fMat[kMScaleX] = roundidiv(fMat[kMScaleX], divx);
244 fMat[kMSkewX] = roundidiv(fMat[kMSkewX], divx);
245 fMat[kMTransX] = roundidiv(fMat[kMTransX], divx);
247 fMat[kMScaleY] = roundidiv(fMat[kMScaleY], divy);
248 fMat[kMSkewY] = roundidiv(fMat[kMSkewY], divy);
249 fMat[kMTransY] = roundidiv(fMat[kMTransY], divy);
254 fMat[kMScaleX] *= invX;
255 fMat[kMSkewX] *= invX;
256 fMat[kMTransX] *= invX;
258 fMat[kMScaleY] *= invY;
259 fMat[kMSkewY] *= invY;
260 fMat[kMTransY] *= invY;
273 fMat[kMScaleX] = cosV;
274 fMat[kMSkewX] = -sinV;
275 fMat[kMTransX] = SkScalarMul(sinV, py) + SkScalarMul(oneMinusCosV, px);
277 fMat[kMSkewY] = sinV;
278 fMat[kMScaleY] = cosV;
279 fMat[kMTransY] = SkScalarMul(-sinV, px) + SkScalarMul(oneMinusCosV, py);
281 fMat[kMPersp0] = fMat[kMPersp1] = 0;
282 fMat[kMPersp2] = kMatrix22Elem;
288 fMat[kMScaleX] = cosV;
289 fMat[kMSkewX] = -sinV;
290 fMat[kMTransX] = 0;
292 fMat[kMSkewY] = sinV;
293 fMat[kMScaleY] = cosV;
294 fMat[kMTransY] = 0;
296 fMat[kMPersp0] = fMat[kMPersp1] = 0;
297 fMat[kMPersp2] = kMatrix22Elem;
341 fMat[kMScaleX] = SK_Scalar1;
342 fMat[kMSkewX] = sx;
343 fMat[kMTransX] = SkScalarMul(-sx, py);
345 fMat[kMSkewY] = sy;
346 fMat[kMScaleY] = SK_Scalar1;
347 fMat[kMTransY] = SkScalarMul(-sy, px);
349 fMat[kMPersp0] = fMat[kMPersp1] = 0;
350 fMat[kMPersp2] = kMatrix22Elem;
356 fMat[kMScaleX] = SK_Scalar1;
357 fMat[kMSkewX] = sx;
358 fMat[kMTransX] = 0;
360 fMat[kMSkewY] = sy;
361 fMat[kMScaleY] = SK_Scalar1;
362 fMat[kMTransY] = 0;
364 fMat[kMPersp0] = fMat[kMPersp1] = 0;
365 fMat[kMPersp2] = kMatrix22Elem;
405 sk_bzero(fMat, 8 * sizeof(SkScalar));
443 fMat[kMScaleX] = sx;
444 fMat[kMScaleY] = sy;
445 fMat[kMTransX] = tx;
446 fMat[kMTransY] = ty;
447 fMat[kMSkewX] = fMat[kMSkewY] =
448 fMat[kMPersp0] = fMat[kMPersp1] = 0;
453 fMat[kMPersp2] = kMatrix22Elem;
544 if (!rowcol3(&a.fMat[0], &b.fMat[0], &tmp.fMat[kMScaleX])) {
547 if (!rowcol3(&a.fMat[0], &b.fMat[1], &tmp.fMat[kMSkewX])) {
550 if (!rowcol3(&a.fMat[0], &b.fMat[2], &tmp.fMat[kMTransX])) {
554 if (!rowcol3(&a.fMat[3], &b.fMat[0], &tmp.fMat[kMSkewY])) {
557 if (!rowcol3(&a.fMat[3], &b.fMat[1], &tmp.fMat[kMScaleY])) {
560 if (!rowcol3(&a.fMat[3], &b.fMat[2], &tmp.fMat[kMTransY])) {
564 if (!rowcol3(&a.fMat[6], &b.fMat[0], &tmp.fMat[kMPersp0])) {
567 if (!rowcol3(&a.fMat[6], &b.fMat[1], &tmp.fMat[kMPersp1])) {
570 if (!rowcol3(&a.fMat[6], &b.fMat[2], &tmp.fMat[kMPersp2])) {
574 normalize_perspective(tmp.fMat);
576 if (!fixmuladdmul(a.fMat[kMScaleX], b.fMat[kMScaleX],
577 a.fMat[kMSkewX], b.fMat[kMSkewY], &tmp.fMat[kMScaleX])) {
580 if (!fixmuladdmul(a.fMat[kMScaleX], b.fMat[kMSkewX],
581 a.fMat[kMSkewX], b.fMat[kMScaleY], &tmp.fMat[kMSkewX])) {
584 if (!fixmuladdmul(a.fMat[kMScaleX], b.fMat[kMTransX],
585 a.fMat[kMSkewX], b.fMat[kMTransY], &tmp.fMat[kMTransX])) {
588 if (negifaddoverflows(tmp.fMat[kMTransX], tmp.fMat[kMTransX],
589 a.fMat[kMTransX]) < 0) {
593 if (!fixmuladdmul(a.fMat[kMSkewY], b.fMat[kMScaleX],
594 a.fMat[kMScaleY], b.fMat[kMSkewY], &tmp.fMat[kMSkewY])) {
597 if (!fixmuladdmul(a.fMat[kMSkewY], b.fMat[kMSkewX],
598 a.fMat[kMScaleY], b.fMat[kMScaleY], &tmp.fMat[kMScaleY])) {
601 if (!fixmuladdmul(a.fMat[kMSkewY], b.fMat[kMTransX],
602 a.fMat[kMScaleY], b.fMat[kMTransY], &tmp.fMat[kMTransY])) {
605 if (negifaddoverflows(tmp.fMat[kMTransY], tmp.fMat[kMTransY],
606 a.fMat[kMTransY]) < 0) {
610 tmp.fMat[kMPersp0] = tmp.fMat[kMPersp1] = 0;
611 tmp.fMat[kMPersp2] = kMatrix22Elem;
722 SkDetScalar scale = sk_inv_determinant(fMat, isPersp, &shift);
735 inv->fMat[kMScaleX] = SkScalarMulShift(SkPerspMul(fMat[kMScaleY], fMat[kMPersp2]) - SkPerspMul(fMat[kMTransY], fMat[kMPersp1]), scale, shift);
736 inv->fMat[kMSkewX] = SkScalarMulShift(SkPerspMul(fMat[kMTransX], fMat[kMPersp1]) - SkPerspMul(fMat[kMSkewX], fMat[kMPersp2]), scale, shift);
737 inv->fMat[kMTransX] = SkScalarMulShift(SkScalarMul(fMat[kMSkewX], fMat[kMTransY]) - SkScalarMul(fMat[kMTransX], fMat[kMScaleY]), scale, shift);
739 inv->fMat[kMSkewY] = SkScalarMulShift(SkPerspMul(fMat[kMTransY], fMat[kMPersp0]) - SkPerspMul(fMat[kMSkewY], fMat[kMPersp2]), scale, shift);
740 inv->fMat[kMScaleY] = SkScalarMulShift(SkPerspMul(fMat[kMScaleX], fMat[kMPersp2]) - SkPerspMul(fMat[kMTransX], fMat[kMPersp0]), scale, shift);
741 inv->fMat[kMTransY] = SkScalarMulShift(SkScalarMul(fMat[kMTransX], fMat[kMSkewY]) - SkScalarMul(fMat[kMScaleX], fMat[kMTransY]), scale, shift);
743 inv->fMat[kMPersp0] = SkScalarMulShift(SkScalarMul(fMat[kMSkewY], fMat[kMPersp1]) - SkScalarMul(fMat[kMScaleY], fMat[kMPersp0]), scale, shift);
744 inv->fMat[kMPersp1] = SkScalarMulShift(SkScalarMul(fMat[kMSkewX], fMat[kMPersp0]) - SkScalarMul(fMat[kMScaleX], fMat[kMPersp1]), scale, shift);
745 inv->fMat[kMPersp2] = SkScalarMulShift(SkScalarMul(fMat[kMScaleX], fMat[kMScaleY]) - SkScalarMul(fMat[kMSkewX], fMat[kMSkewY]), scale, shift);
747 if (SkAbs32(inv->fMat[kMPersp2]) > SK_Fixed1) {
752 tmp.div(inv->fMat[kMPersp2], Sk64::kRound_DivOption);
757 inv->fMat[i] = SkFractMul(inv->fMat[i], scale);
760 inv->fMat[kMPersp2] = SkFixedToFract(inv->fMat[kMPersp2]);
769 int32_t value = SkAbs32(fMat[kMScaleY]);
770 value |= SkAbs32(fMat[kMSkewX]);
771 value |= SkAbs32(fMat[kMScaleX]);
772 value |= SkAbs32(fMat[kMSkewY]);
778 set_muladdmul(&tx, fMat[kMSkewX], fMat[kMTransY], -fMat[kMScaleY], fMat[kMTransX]);
779 set_muladdmul(&ty, fMat[kMSkewY], fMat[kMTransX], -fMat[kMScaleX], fMat[kMTransY]);
789 inv->fMat[kMScaleX] = SkMulShift(fMat[kMScaleY], scale, fixedShift);
790 inv->fMat[kMSkewX] = SkMulShift(-fMat[kMSkewX], scale, fixedShift);
791 inv->fMat[kMTransX] = SkMulShift(tx.getShiftRight(33 - clzNumer), scale, sk64shift);
793 inv->fMat[kMSkewY] = SkMulShift(-fMat[kMSkewY], scale, fixedShift);
794 inv->fMat[kMScaleY] = SkMulShift(fMat[kMScaleX], scale, fixedShift);
795 inv->fMat[kMTransY] = SkMulShift(ty.getShiftRight(33 - clzNumer), scale, sk64shift);
797 inv->fMat[kMScaleX] = SkDoubleToFloat(fMat[kMScaleY] * scale);
798 inv->fMat[kMSkewX] = SkDoubleToFloat(-fMat[kMSkewX] * scale);
799 inv->fMat[kMTransX] = mul_diff_scale(fMat[kMSkewX], fMat[kMTransY],
800 fMat[kMScaleY], fMat[kMTransX], scale);
802 inv->fMat[kMSkewY] = SkDoubleToFloat(-fMat[kMSkewY] * scale);
803 inv->fMat[kMScaleY] = SkDoubleToFloat(fMat[kMScaleX] * scale);
804 inv->fMat[kMTransY] = mul_diff_scale(fMat[kMSkewY], fMat[kMTransX],
805 fMat[kMScaleX], fMat[kMTransY], scale);
807 inv->fMat[kMPersp0] = 0;
808 inv->fMat[kMPersp1] = 0;
809 inv->fMat[kMPersp2] = kMatrix22Elem;
835 SkScalar tx = m.fMat[kMTransX];
836 SkScalar ty = m.fMat[kMTransY];
851 SkScalar mx = m.fMat[kMScaleX];
852 SkScalar my = m.fMat[kMScaleY];
867 SkScalar mx = m.fMat[kMScaleX];
868 SkScalar my = m.fMat[kMScaleY];
869 SkScalar tx = m.fMat[kMTransX];
870 SkScalar ty = m.fMat[kMTransY];
885 SkScalar mx = m.fMat[kMScaleX];
886 SkScalar my = m.fMat[kMScaleY];
887 SkScalar kx = m.fMat[kMSkewX];
888 SkScalar ky = m.fMat[kMSkewY];
905 SkScalar mx = m.fMat[kMScaleX];
906 SkScalar my = m.fMat[kMScaleY];
907 SkScalar kx = m.fMat[kMSkewX];
908 SkScalar ky = m.fMat[kMSkewY];
909 SkScalar tx = m.fMat[kMTransX];
910 SkScalar ty = m.fMat[kMTransY];
927 SkFixed persp2 = SkFractToFixed(m.fMat[kMPersp2]);
936 SkScalar x = SkScalarMul(sx, m.fMat[kMScaleX]) +
937 SkScalarMul(sy, m.fMat[kMSkewX]) + m.fMat[kMTransX];
938 SkScalar y = SkScalarMul(sx, m.fMat[kMSkewY]) +
939 SkScalarMul(sy, m.fMat[kMScaleY]) + m.fMat[kMTransY];
941 SkFixed z = SkFractMul(sx, m.fMat[kMPersp0]) +
942 SkFractMul(sy, m.fMat[kMPersp1]) + persp2;
944 float z = SkScalarMul(sx, m.fMat[kMPersp0]) +
945 SkScalarMulAdd(sy, m.fMat[kMPersp1], m.fMat[kMPersp2]);
996 tmp.fMat[kMTransX] = tmp.fMat[kMTransY] = 0;
1038 SkScalar x = SkScalarMul(sx, m.fMat[kMScaleX]) +
1039 SkScalarMul(sy, m.fMat[kMSkewX]) + m.fMat[kMTransX];
1040 SkScalar y = SkScalarMul(sx, m.fMat[kMSkewY]) +
1041 SkScalarMul(sy, m.fMat[kMScaleY]) + m.fMat[kMTransY];
1043 SkFixed z = SkFractMul(sx, m.fMat[kMPersp0]) +
1044 SkFractMul(sy, m.fMat[kMPersp1]) +
1045 SkFractToFixed(m.fMat[kMPersp2]);
1047 float z = SkScalarMul(sx, m.fMat[kMPersp0]) +
1048 SkScalarMul(sy, m.fMat[kMPersp1]) + m.fMat[kMPersp2];
1074 pt->fX = fixmuladdmul(sx, m.fMat[kMScaleX], sy, m.fMat[kMSkewX]) +
1075 m.fMat[kMTransX];
1076 pt->fY = fixmuladdmul(sx, m.fMat[kMSkewY], sy, m.fMat[kMScaleY]) +
1077 m.fMat[kMTransY];
1079 pt->fX = SkScalarMul(sx, m.fMat[kMScaleX]) +
1080 SkScalarMulAdd(sy, m.fMat[kMSkewX], m.fMat[kMTransX]);
1081 pt->fY = SkScalarMul(sx, m.fMat[kMSkewY]) +
1082 SkScalarMulAdd(sy, m.fMat[kMScaleY], m.fMat[kMTransY]);
1089 SkASSERT(0 == m.fMat[kMTransX]);
1090 SkASSERT(0 == m.fMat[kMTransY]);
1093 pt->fX = fixmuladdmul(sx, m.fMat[kMScaleX], sy, m.fMat[kMSkewX]);
1094 pt->fY = fixmuladdmul(sx, m.fMat[kMSkewY], sy, m.fMat[kMScaleY]);
1096 pt->fX = SkScalarMul(sx, m.fMat[kMScaleX]) +
1097 SkScalarMulAdd(sy, m.fMat[kMSkewX], m.fMat[kMTransX]);
1098 pt->fY = SkScalarMul(sx, m.fMat[kMSkewY]) +
1099 SkScalarMulAdd(sy, m.fMat[kMScaleY], m.fMat[kMTransY]);
1108 pt->fX = SkScalarMulAdd(sx, m.fMat[kMScaleX], m.fMat[kMTransX]);
1109 pt->fY = SkScalarMulAdd(sy, m.fMat[kMScaleY], m.fMat[kMTransY]);
1116 SkASSERT(0 == m.fMat[kMTransX]);
1117 SkASSERT(0 == m.fMat[kMTransY]);
1119 pt->fX = SkScalarMul(sx, m.fMat[kMScaleX]);
1120 pt->fY = SkScalarMul(sy, m.fMat[kMScaleY]);
1127 pt->fX = sx + m.fMat[kMTransX];
1128 pt->fY = sy + m.fMat[kMTransY];
1163 if (PerspNearlyZero(fMat[kMPersp0])) {
1165 if (PerspNearlyZero(fMat[kMPersp1]) &&
1166 PerspNearlyZero(fMat[kMPersp2] - kMatrix22Elem)) {
1168 *stepX = SkScalarToFixed(fMat[kMScaleX]);
1171 *stepY = SkScalarToFixed(fMat[kMSkewY]);
1175 SkFixed z = SkFractMul(y, fMat[kMPersp1]) +
1176 SkFractToFixed(fMat[kMPersp2]);
1178 float z = y * fMat[kMPersp1] + fMat[kMPersp2];
1181 *stepX = SkScalarToFixed(SkScalarDiv(fMat[kMScaleX], z));
1184 *stepY = SkScalarToFixed(SkScalarDiv(fMat[kMSkewY], z));
1291 dst->fMat[kMScaleX] = SkFixedDiv(srcPt[1].fY - srcPt[0].fY, scale);
1292 dst->fMat[kMSkewY] = SkFixedDiv(srcPt[0].fX - srcPt[1].fX, scale);
1293 dst->fMat[kMPersp0] = 0;
1294 dst->fMat[kMSkewX] = SkFixedDiv(srcPt[1].fX - srcPt[0].fX, scale);
1295 dst->fMat[kMScaleY] = SkFixedDiv(srcPt[1].fY - srcPt[0].fY, scale);
1296 dst->fMat[kMPersp1] = 0;
1297 dst->fMat[kMTransX] = srcPt[0].fX;
1298 dst->fMat[kMTransY] = srcPt[0].fY;
1299 dst->fMat[kMPersp2] = SK_Fract1;
1308 dst->fMat[kMScaleX] = SkFixedDiv(srcPt[2].fX - srcPt[0].fX, scale.fX);
1309 dst->fMat[kMSkewY] = SkFixedDiv(srcPt[2].fY - srcPt[0].fY, scale.fX);
1310 dst->fMat[kMPersp0] = 0;
1311 dst->fMat[kMSkewX] = SkFixedDiv(srcPt[1].fX - srcPt[0].fX, scale.fY);
1312 dst->fMat[kMScaleY] = SkFixedDiv(srcPt[1].fY - srcPt[0].fY, scale.fY);
1313 dst->fMat[kMPersp1] = 0;
1314 dst->fMat[kMTransX] = srcPt[0].fX;
1315 dst->fMat[kMTransY] = srcPt[0].fY;
1316 dst->fMat[kMPersp2] = SK_Fract1;
1364 dst->fMat[kMScaleX] = SkFixedDiv(SkFractMul(a2, srcPt[3].fX) +
1366 dst->fMat[kMSkewY] = SkFixedDiv(SkFractMul(a2, srcPt[3].fY) +
1368 dst->fMat[kMPersp0] = SkFixedDiv(a2, scale.fX);
1369 dst->fMat[kMSkewX] = SkFixedDiv(SkFractMul(a1, srcPt[1].fX) +
1371 dst->fMat[kMScaleY] = SkFixedDiv(SkFractMul(a1, srcPt[1].fY) +
1373 dst->fMat[kMPersp1] = SkFixedDiv(a1, scale.fY);
1374 dst->fMat[kMTransX] = srcPt[0].fX;
1375 dst->fMat[kMTransY] = srcPt[0].fY;
1376 dst->fMat[kMPersp2] = SK_Fract1;
1422 dst->fMat[kMScaleX] = (srcPt[1].fY - srcPt[0].fY) * invScale;
1423 dst->fMat[kMSkewY] = (srcPt[0].fX - srcPt[1].fX) * invScale;
1424 dst->fMat[kMPersp0] = 0;
1425 dst->fMat[kMSkewX] = (srcPt[1].fX - srcPt[0].fX) * invScale;
1426 dst->fMat[kMScaleY] = (srcPt[1].fY - srcPt[0].fY) * invScale;
1427 dst->fMat[kMPersp1] = 0;
1428 dst->fMat[kMTransX] = srcPt[0].fX;
1429 dst->fMat[kMTransY] = srcPt[0].fY;
1430 dst->fMat[kMPersp2] = 1;
1438 dst->fMat[kMScaleX] = (srcPt[2].fX - srcPt[0].fX) * invScale;
1439 dst->fMat[kMSkewY] = (srcPt[2].fY - srcPt[0].fY) * invScale;
1440 dst->fMat[kMPersp0] = 0;
1443 dst->fMat[kMSkewX] = (srcPt[1].fX - srcPt[0].fX) * invScale;
1444 dst->fMat[kMScaleY] = (srcPt[1].fY - srcPt[0].fY) * invScale;
1445 dst->fMat[kMPersp1] = 0;
1447 dst->fMat[kMTransX] = srcPt[0].fX;
1448 dst->fMat[kMTransY] = srcPt[0].fY;
1449 dst->fMat[kMPersp2] = 1;
1497 dst->fMat[kMScaleX] = SkScalarMul(SkScalarMul(a2, srcPt[3].fX) +
1499 dst->fMat[kMSkewY] = SkScalarMul(SkScalarMul(a2, srcPt[3].fY) +
1501 dst->fMat[kMPersp0] = SkScalarMul(a2, invScale);
1503 dst->fMat[kMSkewX] = SkScalarMul(SkScalarMul(a1, srcPt[1].fX) +
1505 dst->fMat[kMScaleY] = SkScalarMul(SkScalarMul(a1, srcPt[1].fY) +
1507 dst->fMat[kMPersp1] = SkScalarMul(a1, invScale);
1508 dst->fMat[kMTransX] = srcPt[0].fX;
1509 dst->fMat[kMTransY] = srcPt[0].fY;
1510 dst->fMat[kMPersp2] = 1;
1573 memcpy(buffer, fMat, 9 * sizeof(SkScalar));
1579 memcpy(fMat, buffer, 9 * sizeof(SkScalar));
1594 fMat[0], fMat[1], fMat[2], fMat[3], fMat[4], fMat[5],
1595 fMat[6], fMat[7], fMat[8]);
1597 SkFixedToFloat(fMat[0]), SkFixedToFloat(fMat[1]), SkFixedToFloat(fMat[2]),
1598 SkFixedToFloat(fMat[3]), SkFixedToFloat(fMat[4]), SkFixedToFloat(fMat[5]),
1599 SkFractToFloat(fMat[6]), SkFractToFloat(fMat[7]), SkFractToFloat(fMat[8]));
1603 fMat[0], fMat[1], fMat[2], fMat[3], fMat[4], fMat[5],
1604 fMat[6], fMat[7], fMat[8]);