MCPcopy Create free account
hub / github.com/SOUI2/soui / mapHomogeneousPoints

Method mapHomogeneousPoints

third-part/SkMatrix/src/SkMatrix.cpp:1027–1053  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1025///////////////////////////////////////////////////////////////////////////////
1026
1027void SkMatrix::mapHomogeneousPoints(SkScalar dst[], const SkScalar src[], int count) const {
1028 SkASSERT((dst && src && count > 0) || 0 == count);
1029 // no partial overlap
1030 SkASSERT(src == dst || SkAbs32((int32_t)(src - dst)) >= 3*count);
1031
1032 if (count > 0) {
1033 if (this->isIdentity()) {
1034 memcpy(dst, src, 3*count*sizeof(SkScalar));
1035 return;
1036 }
1037 do {
1038 SkScalar sx = src[0];
1039 SkScalar sy = src[1];
1040 SkScalar sw = src[2];
1041 src += 3;
1042
1043 SkScalar x = sdot(sx, fMat[kMScaleX], sy, fMat[kMSkewX], sw, fMat[kMTransX]);
1044 SkScalar y = sdot(sx, fMat[kMSkewY], sy, fMat[kMScaleY], sw, fMat[kMTransY]);
1045 SkScalar w = sdot(sx, fMat[kMPersp0], sy, fMat[kMPersp1], sw, fMat[kMPersp2]);
1046
1047 dst[0] = x;
1048 dst[1] = y;
1049 dst[2] = w;
1050 dst += 3;
1051 } while (--count);
1052 }
1053}
1054
1055///////////////////////////////////////////////////////////////////////////////
1056

Callers

nothing calls this directly

Calls 3

isIdentityMethod · 0.80
sdotFunction · 0.70
SkAbs32Function · 0.50

Tested by

no test coverage detected