diff options
author | msarett <msarett@google.com> | 2016-06-22 08:18:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-22 08:18:54 -0700 |
commit | 111a42d9cebf0bb8844c5d24f67fac57cc619d29 (patch) | |
tree | ce93848c7176621f02b2ced77d56572932ebd4e4 /src/core/SkMatrix44.cpp | |
parent | 05dceabf3422b785b52439378aa5527c42c6ca18 (diff) |
Enable flattening and unflattening of SkColorSpace
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2085653003
Review-Url: https://codereview.chromium.org/2085653003
Diffstat (limited to 'src/core/SkMatrix44.cpp')
-rw-r--r-- | src/core/SkMatrix44.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/SkMatrix44.cpp b/src/core/SkMatrix44.cpp index 34b5327519..56c2e8a142 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) { |