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

Side by Side Diff: src/core/SkMatrix44.cpp

Issue 1943833002: return 4x4 matrix from SkColorSpace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix redirect header Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | src/utils/SkMatrix44.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkMatrix44.h" 8 #include "SkMatrix44.h"
9 9
10 static inline bool eq4(const SkMScalar* SK_RESTRICT a, 10 static inline bool eq4(const SkMScalar* SK_RESTRICT a,
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void SkMatrix44::set3x3(SkMScalar m00, SkMScalar m01, SkMScalar m02, 202 void SkMatrix44::set3x3(SkMScalar m00, SkMScalar m01, SkMScalar m02,
203 SkMScalar m10, SkMScalar m11, SkMScalar m12, 203 SkMScalar m10, SkMScalar m11, SkMScalar m12,
204 SkMScalar m20, SkMScalar m21, SkMScalar m22) { 204 SkMScalar m20, SkMScalar m21, SkMScalar m22) {
205 fMat[0][0] = m00; fMat[0][1] = m01; fMat[0][2] = m02; fMat[0][3] = 0; 205 fMat[0][0] = m00; fMat[0][1] = m01; fMat[0][2] = m02; fMat[0][3] = 0;
206 fMat[1][0] = m10; fMat[1][1] = m11; fMat[1][2] = m12; fMat[1][3] = 0; 206 fMat[1][0] = m10; fMat[1][1] = m11; fMat[1][2] = m12; fMat[1][3] = 0;
207 fMat[2][0] = m20; fMat[2][1] = m21; fMat[2][2] = m22; fMat[2][3] = 0; 207 fMat[2][0] = m20; fMat[2][1] = m21; fMat[2][2] = m22; fMat[2][3] = 0;
208 fMat[3][0] = 0; fMat[3][1] = 0; fMat[3][2] = 0; fMat[3][3] = 1; 208 fMat[3][0] = 0; fMat[3][1] = 0; fMat[3][2] = 0; fMat[3][3] = 1;
209 this->dirtyTypeMask(); 209 this->dirtyTypeMask();
210 } 210 }
211 211
212 void SkMatrix44::set3x3ColMajorf(const float src[]) {
213 fMat[0][0] = src[0]; fMat[0][1] = src[3]; fMat[0][2] = src[6]; fMat[0][3] = 0;
214 fMat[1][0] = src[1]; fMat[1][1] = src[4]; fMat[1][2] = src[7]; fMat[1][3] = 0;
215 fMat[2][0] = src[2]; fMat[2][1] = src[5]; fMat[2][2] = src[8]; fMat[2][3] = 0;
216 fMat[3][0] = 0; fMat[3][1] = 0; fMat[3][2] = 0; fMat[3][3] = 1;
217 this->dirtyTypeMask();
218 }
219
212 /////////////////////////////////////////////////////////////////////////////// 220 ///////////////////////////////////////////////////////////////////////////////
213 221
214 void SkMatrix44::setTranslate(SkMScalar dx, SkMScalar dy, SkMScalar dz) { 222 void SkMatrix44::setTranslate(SkMScalar dx, SkMScalar dy, SkMScalar dz) {
215 this->setIdentity(); 223 this->setIdentity();
216 224
217 if (!dx && !dy && !dz) { 225 if (!dx && !dy && !dz) {
218 return; 226 return;
219 } 227 }
220 228
221 fMat[3][0] = dx; 229 fMat[3][0] = dx;
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]); 995 dst[SkMatrix::kMSkewY] = SkMScalarToScalar(fMat[0][1]);
988 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]); 996 dst[SkMatrix::kMScaleY] = SkMScalarToScalar(fMat[1][1]);
989 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]); 997 dst[SkMatrix::kMTransY] = SkMScalarToScalar(fMat[3][1]);
990 998
991 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]); 999 dst[SkMatrix::kMPersp0] = SkMScalarToScalar(fMat[0][3]);
992 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]); 1000 dst[SkMatrix::kMPersp1] = SkMScalarToScalar(fMat[1][3]);
993 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]); 1001 dst[SkMatrix::kMPersp2] = SkMScalarToScalar(fMat[3][3]);
994 1002
995 return dst; 1003 return dst;
996 } 1004 }
OLDNEW
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | src/utils/SkMatrix44.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698