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

Side by Side Diff: include/utils/SkMatrix44.h

Issue 23757031: Add getFloat/setFloat funcs to SkMatrix44 (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 #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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698