Home | History | Annotate | Download | only in core

Lines Matching refs:SkMatrix

8 #include "SkMatrix.h"
29 void SkMatrix::reset() {
60 uint8_t SkMatrix::computePerspectiveTypeMask() const {
84 uint8_t SkMatrix::computeTypeMask() const {
111 int m00 = SkScalarAs2sCompliment(fMat[SkMatrix::kMScaleX]);
112 int m01 = SkScalarAs2sCompliment(fMat[SkMatrix::kMSkewX]);
113 int m10 = SkScalarAs2sCompliment(fMat[SkMatrix::kMSkewY]);
114 int m11 = SkScalarAs2sCompliment(fMat[SkMatrix::kMScaleY]);
163 bool operator==(const SkMatrix& a, const SkMatrix& b) {
185 bool SkMatrix::isSimilarity(SkScalar tol) const {
218 bool SkMatrix::preservesRightAngles(SkScalar tol) const {
221 if (mask <= (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask)) {
252 void SkMatrix::setTranslate(SkScalar dx, SkScalar dy) {
268 bool SkMatrix::preTranslate(SkScalar dx, SkScalar dy) {
270 SkMatrix m;
286 bool SkMatrix::postTranslate(SkScalar dx, SkScalar dy) {
288 SkMatrix m;
303 void SkMatrix::setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) {
320 void SkMatrix::setScale(SkScalar sx, SkScalar sy) {
336 bool SkMatrix::setIDiv(int divx, int divy) {
344 bool SkMatrix::preScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) {
345 SkMatrix m;
350 bool SkMatrix::preScale(SkScalar sx, SkScalar sy) {
356 SkMatrix m;
378 bool SkMatrix::postScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) {
382 SkMatrix m;
387 bool SkMatrix::postScale(SkScalar sx, SkScalar sy) {
391 SkMatrix m;
411 bool SkMatrix::postIDiv(int divx, int divy) {
443 void SkMatrix::setSinCos(SkScalar sinV, SkScalar cosV,
461 void SkMatrix::setSinCos(SkScalar sinV, SkScalar cosV) {
476 void SkMatrix::setRotate(SkScalar degrees, SkScalar px, SkScalar py) {
482 void SkMatrix::setRotate(SkScalar degrees) {
488 bool SkMatrix::preRotate(SkScalar degrees, SkScalar px, SkScalar py) {
489 SkMatrix m;
494 bool SkMatrix::preRotate(SkScalar degrees) {
495 SkMatrix m;
500 bool SkMatrix::postRotate(SkScalar degrees, SkScalar px, SkScalar py) {
501 SkMatrix m;
506 bool SkMatrix::postRotate(SkScalar degrees) {
507 SkMatrix m;
514 void SkMatrix::setSkew(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) {
529 void SkMatrix::setSkew(SkScalar sx, SkScalar sy) {
544 bool SkMatrix::preSkew(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) {
545 SkMatrix m;
550 bool SkMatrix::preSkew(SkScalar sx, SkScalar sy) {
551 SkMatrix m;
556 bool SkMatrix::postSkew(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py) {
557 SkMatrix m;
562 bool SkMatrix::postSkew(SkScalar sx, SkScalar sy) {
563 SkMatrix m;
570 bool SkMatrix::setRectToRect(const SkRect& src, const SkRect& dst,
707 if (SkScalarAbs(mat[SkMatrix::kMPersp2]) > kMatrix22Elem) {
713 bool SkMatrix::setConcat(const SkMatrix& a, const SkMatrix& b) {
722 SkMatrix tmp;
803 bool SkMatrix::preConcat(const SkMatrix& mat) {
809 bool SkMatrix::postConcat(const SkMatrix& mat) {
833 det = mat[SkMatrix::kMScaleX] * ((double)mat[SkMatrix::kMScaleY] * mat[SkMatrix::kMPersp2] - (double)mat[SkMatrix::kMTransY] * mat[SkMatrix::kMPersp1]) +
834 mat[SkMatrix::kMSkewX] * ((double)mat[SkMatrix::kMTransY] * mat[SkMatrix::kMPersp0] - (double)mat[SkMatrix::kMSkewY] * mat[SkMatrix::kMPersp2]) +
835 mat[SkMatrix::kMTransX] * ((double)mat[SkMatrix::kMSkewY] * mat[SkMatrix::kMPersp1] - (double)mat[SkMatrix::kMScaleY] * mat[SkMatrix::kMPersp0]);
837 det = (double)mat[SkMatrix::kMScaleX] * mat[SkMatrix::kMScaleY] - (double)mat[SkMatrix::kMSkewX] * mat[SkMatrix::kMSkewY];
872 tmp1.setMul(mat[SkMatrix::kMScaleX], fracmuladdmul(mat[SkMatrix::kMScaleY], mat[SkMatrix::kMPersp2], -mat[SkMatrix::kMTransY], mat[SkMatrix::kMPersp1]));
873 tmp2.setMul(mat[SkMatrix::kMSkewX], fracmuladdmul(mat[SkMatrix::kMTransY], mat[SkMatrix::kMPersp0], -mat[SkMatrix::kMSkewY], mat[SkMatrix::kMPersp2]));
875 tmp2.setMul(mat[SkMatrix::kMTransX], fracmuladdmul(mat[SkMatrix::kMSkewY], mat[SkMatrix::kMPersp1], -mat[SkMatrix::kMScaleY], mat[SkMatrix::kMPersp0]));
878 tmp1.setMul(mat[SkMatrix::kMScaleX], mat[SkMatrix::kMScaleY]);
879 tmp2.setMul(mat[SkMatrix::kMSkewX], mat[SkMatrix::kMSkewY]);
904 void SkMatrix::SetAffineIdentity(SkScalar affine[6]) {
913 bool SkMatrix::asAffine(SkScalar affine[6]) const {
928 bool SkMatrix::invertNonIdentity(SkMatrix* inv) const {
979 SkMatrix tmp;
1067 *(SkMatrix*)this = tmp;
1075 void SkMatrix::Identity_pts(const SkMatrix& m, SkPoint dst[],
1083 void SkMatrix::Trans_pts(const SkMatrix& m, SkPoint dst[],
1099 void SkMatrix::Scale_pts(const SkMatrix& m, SkPoint dst[],
1115 void SkMatrix::ScaleTrans_pts(const SkMatrix& m, SkPoint dst[],
1133 void SkMatrix::Rot_pts(const SkMatrix& m, SkPoint dst[],
1153 void SkMatrix::RotTrans_pts(const SkMatrix& m, SkPoint dst[],
1175 void SkMatrix::Persp_pts(const SkMatrix& m, SkPoint dst[],
1211 const SkMatrix::MapPtsProc SkMatrix::gMapPtsProcs[] = {
1212 SkMatrix::Identity_pts, SkMatrix::Trans_pts,
1213 SkMatrix::Scale_pts, SkMatrix::ScaleTrans_pts,
1214 SkMatrix::Rot_pts, SkMatrix::RotTrans_pts,
1215 SkMatrix::Rot_pts, SkMatrix::RotTrans_pts,
1217 SkMatrix::Persp_pts, SkMatrix::Persp_pts,
1218 SkMatrix::Persp_pts, SkMatrix::Persp_pts,
1219 SkMatrix::Persp_pts, SkMatrix::Persp_pts,
1220 SkMatrix::Persp_pts, SkMatrix::Persp_pts
1223 void SkMatrix::mapPoints(SkPoint dst[], const SkPoint src[], int count) const {
1233 void SkMatrix::mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int count) const {
1269 void SkMatrix::mapVectors(SkPoint dst[], const SkPoint src[], int count) const {
1283 SkMatrix tmp = *this;
1291 bool SkMatrix::mapRect(SkRect* dst, const SkRect& src) const {
1308 SkScalar SkMatrix::mapRadius(SkScalar radius) const {
1323 void SkMatrix::Persp_xy(const SkMatrix& m, SkScalar sx, SkScalar sy,
1358 void SkMatrix::RotTrans_xy(const SkMatrix& m, SkScalar sx, SkScalar sy,
1375 void SkMatrix::Rot_xy(const SkMatrix& m, SkScalar sx, SkScalar sy,
1392 void SkMatrix::ScaleTrans_xy(const SkMatrix& m, SkScalar sx, SkScalar sy,
1401 void SkMatrix::Scale_xy(const SkMatrix& m, SkScalar sx, SkScalar sy,
1412 void SkMatrix::Trans_xy(const SkMatrix& m, SkScalar sx, SkScalar sy,
1420 void SkMatrix::Identity_xy(const SkMatrix& m, SkScalar sx, SkScalar sy,
1428 const SkMatrix::MapXYProc SkMatrix::gMapXYProcs[] = {
1429 SkMatrix::Identity_xy, SkMatrix::Trans_xy,
1430 SkMatrix::Scale_xy, SkMatrix::ScaleTrans_xy,
1431 SkMatrix::Rot_xy, SkMatrix::RotTrans_xy,
1432 SkMatrix::Rot_xy, SkMatrix::RotTrans_xy,
1434 SkMatrix::Persp_xy, SkMatrix::Persp_xy,
1435 SkMatrix::Persp_xy, SkMatrix::Persp_xy,
1436 SkMatrix::Persp_xy, SkMatrix::Persp_xy,
1437 SkMatrix::Persp_xy, SkMatrix::Persp_xy
1451 bool SkMatrix::fixedStepInX(SkScalar y, SkFixed* stepX, SkFixed* stepY) const {
1486 SkPerspIter::SkPerspIter(const SkMatrix& m, SkScalar x0, SkScalar y0, int count)
1490 SkMatrix::Persp_xy(m, x0, y0, &pt);
1509 SkMatrix::Persp_xy(fMatrix, fSX, fSY, &pt);
1516 SkMatrix::Persp_xy(fMatrix, fSX, fSY, &pt);
1575 bool SkMatrix::Poly2Proc(const SkPoint srcPt[], SkMatrix* dst,
1593 bool SkMatrix::Poly3Proc(const SkPoint srcPt[], SkMatrix* dst,
1610 bool SkMatrix::Poly4Proc(const SkPoint srcPt[], SkMatrix* dst,
1707 bool SkMatrix::Poly2Proc(const SkPoint srcPt[], SkMatrix* dst,
1724 bool SkMatrix::Poly3Proc(const SkPoint srcPt[], SkMatrix* dst,
1743 bool SkMatrix::Poly4Proc(const SkPoint srcPt[], SkMatrix* dst,
1806 typedef bool (*PolyMapProc)(const SkPoint[], SkMatrix*, const SkPoint&);
1810 bool SkMatrix::setPolyToPoly(const SkPoint src[], const SkPoint dst[],
1813 SkDebugf("--- SkMatrix::setPolyToPoly count out of range %d\n", count);
1834 SkMatrix::Poly2Proc, SkMatrix::Poly3Proc, SkMatrix::Poly4Proc
1838 SkMatrix tempMap, result;
1864 template <MinOrMax MIN_OR_MAX> SkScalar get_stretch_factor(SkMatrix::TypeMask typeMask,
1866 if (typeMask & SkMatrix::kPerspective_Mask) {
1869 if (SkMatrix::kIdentity_Mask == typeMask) {
1872 if (!(typeMask & SkMatrix::kAffine_Mask)) {
1874 return SkMinScalar(SkScalarAbs(m[SkMatrix::kMScaleX]),
1875 SkScalarAbs(m[SkMatrix::kMScaleY]));
1877 return SkMaxScalar(SkScalarAbs(m[SkMatrix::kMScaleX]),
1878 SkScalarAbs(m[SkMatrix::kMScaleY]));
1884 SkScalar a = SkScalarMul(m[SkMatrix::kMScaleX], m[SkMatrix::kMScaleX]) +
1885 SkScalarMul(m[SkMatrix::kMSkewY], m[SkMatrix::kMSkewY]);
1886 SkScalar b = SkScalarMul(m[SkMatrix::kMScaleX], m[SkMatrix::kMSkewX]) +
1887 SkScalarMul(m[SkMatrix::kMScaleY], m[SkMatrix::kMSkewY]);
1888 SkScalar c = SkScalarMul(m[SkMatrix::kMSkewX], m[SkMatrix::kMSkewX]) +
1889 SkScalarMul(m[SkMatrix::kMScaleY], m[SkMatrix::kMScaleY]);
1918 SkScalar SkMatrix::getMinStretch() const {
1922 SkScalar SkMatrix::getMaxStretch() const {
1926 static void reset_identity_matrix(SkMatrix* identity) {
1930 const SkMatrix& SkMatrix::I() {
1932 static SkMatrix gIdentity;
1938 const SkMatrix& SkMatrix::InvalidMatrix() {
1939 static SkMatrix gInvalid;
1953 size_t SkMatrix::writeToMemory(void* buffer) const {
1962 size_t SkMatrix::readFromMemory(const void* buffer, size_t length) {
1975 void SkMatrix::dump() const {
1981 void SkMatrix::toString(SkString* str) const {
1998 bool SkTreatAsSprite(const SkMatrix& mat, int width, int height,
2001 if (mat.getType() & ~(SkMatrix::kScale_Mask | SkMatrix::kTranslate_Mask)) {
2006 if (!subpixelBits && !(mat.getType() & ~SkMatrix::kTranslate_Mask)) {
2053 bool SkDecomposeUpper2x2(const SkMatrix& matrix,
2058 SkScalar A = matrix[SkMatrix::kMScaleX];
2059 SkScalar B = matrix[SkMatrix::kMSkewX];
2060 SkScalar C = matrix[SkMatrix::kMSkewY];
2061 SkScalar D = matrix[SkMatrix::kMScaleY];