OLD | NEW |
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 #ifndef SkMatrix44_DEFINED | 8 #ifndef SkMatrix44_DEFINED |
9 #define SkMatrix44_DEFINED | 9 #define SkMatrix44_DEFINED |
10 | 10 |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 fMat[col][row] = value; | 217 fMat[col][row] = value; |
218 this->dirtyTypeMask(); | 218 this->dirtyTypeMask(); |
219 } | 219 } |
220 | 220 |
221 inline double getDouble(int row, int col) const { | 221 inline double getDouble(int row, int col) const { |
222 return SkMScalarToDouble(this->get(row, col)); | 222 return SkMScalarToDouble(this->get(row, col)); |
223 } | 223 } |
224 inline void setDouble(int row, int col, double value) { | 224 inline void setDouble(int row, int col, double value) { |
225 this->set(row, col, SkDoubleToMScalar(value)); | 225 this->set(row, col, SkDoubleToMScalar(value)); |
226 } | 226 } |
| 227 inline float getFloat(int row, int col) const { |
| 228 return SkMScalarToFloat(this->get(row, col)); |
| 229 } |
| 230 inline void setFloat(int row, int col, float value) { |
| 231 this->set(row, col, SkFloatToMScalar(value)); |
| 232 } |
227 | 233 |
228 /** These methods allow one to efficiently read matrix entries into an | 234 /** These methods allow one to efficiently read matrix entries into an |
229 * array. The given array must have room for exactly 16 entries. Whenever | 235 * array. The given array must have room for exactly 16 entries. Whenever |
230 * possible, they will try to use memcpy rather than an entry-by-entry | 236 * possible, they will try to use memcpy rather than an entry-by-entry |
231 * copy. | 237 * copy. |
232 */ | 238 */ |
233 void asColMajorf(float[]) const; | 239 void asColMajorf(float[]) const; |
234 void asColMajord(double[]) const; | 240 void asColMajord(double[]) const; |
235 void asRowMajorf(float[]) const; | 241 void asRowMajorf(float[]) const; |
236 void asRowMajord(double[]) const; | 242 void asRowMajord(double[]) const; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 /** | 402 /** |
397 * Does not take the time to 'compute' the typemask. Only returns true if | 403 * Does not take the time to 'compute' the typemask. Only returns true if |
398 * we already know that this matrix is identity. | 404 * we already know that this matrix is identity. |
399 */ | 405 */ |
400 inline bool isTriviallyIdentity() const { | 406 inline bool isTriviallyIdentity() const { |
401 return 0 == fTypeMask; | 407 return 0 == fTypeMask; |
402 } | 408 } |
403 }; | 409 }; |
404 | 410 |
405 #endif | 411 #endif |
OLD | NEW |