Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1291)

Unified Diff: src/core/SkMatrix44.cpp

Issue 2085653003: Enable flattening and unflattening of SkColorSpace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix unit tests Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkImageInfo.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « src/core/SkImageInfo.cpp ('k') | tests/ColorSpaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698