Index: src/core/SkMatrix44.cpp |
diff --git a/src/core/SkMatrix44.cpp b/src/core/SkMatrix44.cpp |
index 34b532751966008d44cbe9282034c1ed38537dee..56c2e8a1428ab6eccabadc521a8eaf76b1e69305 100644 |
--- a/src/core/SkMatrix44.cpp |
+++ b/src/core/SkMatrix44.cpp |
@@ -85,6 +85,17 @@ void SkMatrix44::asColMajorf(float dst[]) const { |
#endif |
} |
+void SkMatrix44::as4x3ColMajorf(float dst[]) const { |
+ const SkMScalar* src = &fMat[0][0]; |
+#ifdef SK_MSCALAR_IS_DOUBLE |
+ for (int i = 0; i < 12; ++i) { |
+ dst[i] = SkMScalarToFloat(src[i]); |
+ } |
+#elif defined SK_MSCALAR_IS_FLOAT |
+ memcpy(dst, src, 12 * sizeof(float)); |
+#endif |
+} |
+ |
void SkMatrix44::asColMajord(double dst[]) const { |
const SkMScalar* src = &fMat[0][0]; |
#ifdef SK_MSCALAR_IS_DOUBLE |
@@ -217,6 +228,14 @@ void SkMatrix44::set3x3ColMajorf(const float src[]) { |
this->dirtyTypeMask(); |
} |
+void SkMatrix44::set4x3ColMajorf(const float src[]) { |
+ fMat[0][0] = src[0]; fMat[0][1] = src[1]; fMat[0][2] = src[2]; fMat[0][3] = src[3]; |
+ fMat[1][0] = src[4]; fMat[1][1] = src[5]; fMat[1][2] = src[6]; fMat[1][3] = src[7]; |
+ fMat[2][0] = src[8]; fMat[2][1] = src[9]; fMat[2][2] = src[10]; fMat[2][3] = src[11]; |
+ fMat[3][0] = 0; fMat[3][1] = 0; fMat[3][2] = 0; fMat[3][3] = 1; |
+ this->dirtyTypeMask(); |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
void SkMatrix44::setTranslate(SkMScalar dx, SkMScalar dy, SkMScalar dz) { |