Lines Matching refs:dst
439 bool SkMatrix::setRectToRect(const SkRect& src, const SkRect& dst,
447 if (dst.isEmpty()) {
451 SkScalar tx, sx = SkScalarDiv(dst.width(), src.width());
452 SkScalar ty, sy = SkScalarDiv(dst.height(), src.height());
464 tx = dst.fLeft - SkScalarMul(src.fLeft, sx);
465 ty = dst.fTop - SkScalarMul(src.fTop, sy);
470 diff = dst.width() - SkScalarMul(src.width(), sy);
472 diff = dst.height() - SkScalarMul(src.height(), sy);
718 static void set_muladdmul(Sk64* dst, int32_t a, int32_t b, int32_t c,
721 dst->setMul(a, b);
723 dst->add(tmp);
884 void SkMatrix::Identity_pts(const SkMatrix& m, SkPoint dst[],
888 if (dst != src && count > 0)
889 memcpy(dst, src, count * sizeof(SkPoint));
892 void SkMatrix::Trans_pts(const SkMatrix& m, SkPoint dst[],
900 dst->fY = src->fY + ty;
901 dst->fX = src->fX + tx;
903 dst += 1;
908 void SkMatrix::Scale_pts(const SkMatrix& m, SkPoint dst[],
916 dst->fY = SkScalarMul(src->fY, my);
917 dst->fX = SkScalarMul(src->fX, mx);
919 dst += 1;
924 void SkMatrix::ScaleTrans_pts(const SkMatrix& m, SkPoint dst[],
934 dst->fY = SkScalarMulAdd(src->fY, my, ty);
935 dst->fX = SkScalarMulAdd(src->fX, mx, tx);
937 dst += 1;
942 void SkMatrix::Rot_pts(const SkMatrix& m, SkPoint dst[],
955 dst->fY = SkScalarMul(sx, ky) + SkScalarMul(sy, my);
956 dst->fX = SkScalarMul(sx, mx) + SkScalarMul(sy, kx);
957 dst += 1;
962 void SkMatrix::RotTrans_pts(const SkMatrix& m, SkPoint dst[],
977 dst
978 dst->fX = SkScalarMul(sx, mx) + SkScalarMulAdd(sy, kx, tx);
979 dst += 1;
984 void SkMatrix::Persp_pts(const SkMatrix& m, SkPoint dst[],
1013 dst->fY = SkScalarMul(y, z);
1014 dst->fX = SkScalarMul(x, z);
1015 dst += 1;
1032 void SkMatrix::mapPoints(SkPoint dst[], const SkPoint src[], int count) const {
1033 SkASSERT((dst && src && count > 0) || count == 0);
1035 SkASSERT(src == dst || SkAbs32((int32_t)(src - dst)) >= count);
1037 this->getMapPtsProc()(*this, dst, src, count);
1042 void SkMatrix::mapVectors(SkPoint dst[], const SkPoint src[], int count) const {
1053 dst[i].set(tmp.fX - origin.fX, tmp.fY - origin.fY);
1060 tmp.mapPoints(dst, src, count);
1064 bool SkMatrix::mapRect(SkRect* dst, const SkRect& src) const {
1065 SkASSERT(dst && &src);
1068 this->mapPoints((SkPoint*)dst, (const SkPoint*)&src, 2);
1069 dst->sort();
1076 dst->set(quad, 4);
1348 bool SkMatrix::Poly2Proc(const SkPoint srcPt[], SkMatrix* dst,
1353 dst->fMat[kMScaleX] = SkFixedDiv(srcPt[1].fY - srcPt[0].fY, scale);
1354 dst->fMat[kMSkewY] = SkFixedDiv(srcPt[0].fX - srcPt[1].fX, scale);
1355 dst->fMat[kMPersp0] = 0;
1356 dst->fMat[kMSkewX] = SkFixedDiv(srcPt[1].fX - srcPt[0].fX, scale);
1357 dst->fMat[kMScaleY] = SkFixedDiv(srcPt[1].fY - srcPt[0].fY, scale);
1358 dst->fMat[kMPersp1] = 0;
1359 dst->fMat[kMTransX] = srcPt[0].fX;
1360 dst->fMat[kMTransY] = srcPt[0].fY;
1361 dst->fMat[kMPersp2] = SK_Fract1;
1362 dst->setTypeMask(kUnknown_Mask);
1366 bool SkMatrix::Poly3Proc(const SkPoint srcPt[], SkMatrix* dst,
1370 dst->fMat[kMScaleX] = SkFixedDiv(srcPt[2].fX - srcPt[0].fX, scale.fX);
1371 dst->fMat[kMSkewY] = SkFixedDiv(srcPt[2].fY - srcPt[0].fY, scale.fX);
1372 dst->fMat[kMPersp0] = 0;
1373 dst->fMat[kMSkewX] = SkFixedDiv(srcPt[1].fX - srcPt[0].fX, scale.fY);
1374 dst->fMat[kMScaleY] = SkFixedDiv(srcPt[1].fY - srcPt[0].fY, scale.fY);
1375 dst->fMat[kMPersp1] = 0;
1376 dst->fMat[kMTransX] = srcPt[0].fX;
1377 dst->fMat[kMTransY] = srcPt[0].fY;
1378 dst->fMat[kMPersp2] = SK_Fract1;
1379 dst->setTypeMask(kUnknown_Mask);
1383 bool SkMatrix::Poly4Proc(const SkPoint srcPt[], SkMatrix* dst,
1426 dst->fMat[kMScaleX] = SkFixedDiv(SkFractMul(a2, srcPt[3].fX) +
1428 dst->fMat[kMSkewY] = SkFixedDiv(SkFractMul(a2, srcPt[3].fY) +
1430 dst->fMat[kMPersp0] = SkFixedDiv(a2, scale.fX);
1431 dst->fMat[kMSkewX] = SkFixedDiv(SkFractMul(a1, srcPt[1].fX) +
1433 dst->fMat[kMScaleY] = SkFixedDiv(SkFractMul(a1, srcPt[1].fY) +
1435 dst->fMat[kMPersp1] = SkFixedDiv(a1, scale.fY);
1436 dst->fMat[kMTransX] = srcPt[0].fX;
1437 dst->fMat[kMTransY] = srcPt[0].fY;
1438 dst->fMat[kMPersp2] = SK_Fract1;
1439 dst->setTypeMask(kUnknown_Mask);
1480 bool SkMatrix::Poly2Proc(const SkPoint srcPt[], SkMatrix* dst,
1484 dst
1485 dst->fMat[kMSkewY] = (srcPt[0].fX - srcPt[1].fX) * invScale;
1486 dst->fMat[kMPersp0] = 0;
1487 dst->fMat[kMSkewX] = (srcPt[1].fX - srcPt[0].fX) * invScale;
1488 dst->fMat[kMScaleY] = (srcPt[1].fY - srcPt[0].fY) * invScale;
1489 dst->fMat[kMPersp1] = 0;
1490 dst->fMat[kMTransX] = srcPt[0].fX;
1491 dst->fMat[kMTransY] = srcPt[0].fY;
1492 dst->fMat[kMPersp2] = 1;
1493 dst->setTypeMask(kUnknown_Mask);
1497 bool SkMatrix::Poly3Proc(const SkPoint srcPt[], SkMatrix* dst,
1500 dst->fMat[kMScaleX] = (srcPt[2].fX - srcPt[0].fX) * invScale;
1501 dst->fMat[kMSkewY] = (srcPt[2].fY - srcPt[0].fY) * invScale;
1502 dst->fMat[kMPersp0] = 0;
1505 dst->fMat[kMSkewX] = (srcPt[1].fX - srcPt[0].fX) * invScale;
1506 dst->fMat[kMScaleY] = (srcPt[1].fY - srcPt[0].fY) * invScale;
1507 dst->fMat[kMPersp1] = 0;
1509 dst->fMat[kMTransX] = srcPt[0].fX;
1510 dst->fMat[kMTransY] = srcPt[0].fY;
1511 dst->fMat[kMPersp2] = 1;
1512 dst->setTypeMask(kUnknown_Mask);
1516 bool SkMatrix::Poly4Proc(const SkPoint srcPt[], SkMatrix* dst,
1559 dst->fMat[kMScaleX] = SkScalarMul(SkScalarMul(a2, srcPt[3].fX) +
1561 dst->fMat[kMSkewY] = SkScalarMul(SkScalarMul(a2, srcPt[3].fY) +
1563 dst->fMat[kMPersp0] = SkScalarMul(a2, invScale);
1565 dst->fMat[kMSkewX] = SkScalarMul(SkScalarMul(a1, srcPt[1].fX) +
1567 dst->fMat[kMScaleY] = SkScalarMul(SkScalarMul(a1, srcPt[1].fY) +
1569 dst->fMat[kMPersp1] = SkScalarMul(a1, invScale);
1570 dst->fMat[kMTransX] = srcPt[0].fX;
1571 dst->fMat[kMTransY] = srcPt[0].fY;
1572 dst->fMat[kMPersp2] = 1;
1573 dst->setTypeMask(kUnknown_Mask);
1583 bool SkMatrix::setPolyToPoly(const SkPoint src[], const SkPoint dst[],
1595 this->setTranslate(dst[0].fX - src[0].fX, dst[0].fY - src[0].fY);
1620 if (!proc(dst, &tempMap, scale)) {