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

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

Issue 676583002: Add isScale2d() helper function to SkMatrix44. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: isScale() Created 6 years, 2 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 | « 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 return !(this->getType() & ~kTranslate_Mask); 218 return !(this->getType() & ~kTranslate_Mask);
219 } 219 }
220 220
221 /** 221 /**
222 * Return true if the matrix only contains scale or translate or is identit y. 222 * Return true if the matrix only contains scale or translate or is identit y.
223 */ 223 */
224 inline bool isScaleTranslate() const { 224 inline bool isScaleTranslate() const {
225 return !(this->getType() & ~(kScale_Mask | kTranslate_Mask)); 225 return !(this->getType() & ~(kScale_Mask | kTranslate_Mask));
226 } 226 }
227 227
228 /**
229 * Returns true if the matrix only contains scale or is identity.
230 */
231 inline bool isScale() const {
232 return !(this->getType() & ~kScale_Mask);
233 }
234
228 inline bool hasPerspective() const { 235 inline bool hasPerspective() const {
229 return SkToBool(this->getType() & kPerspective_Mask); 236 return SkToBool(this->getType() & kPerspective_Mask);
230 } 237 }
231 238
232 void setIdentity(); 239 void setIdentity();
233 inline void reset() { this->setIdentity();} 240 inline void reset() { this->setIdentity();}
234 241
235 /** 242 /**
236 * get a value from the matrix. The row,col parameters work as follows: 243 * get a value from the matrix. The row,col parameters work as follows:
237 * (0, 0) scale-x 244 * (0, 0) scale-x
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 /** 463 /**
457 * Does not take the time to 'compute' the typemask. Only returns true if 464 * Does not take the time to 'compute' the typemask. Only returns true if
458 * we already know that this matrix is identity. 465 * we already know that this matrix is identity.
459 */ 466 */
460 inline bool isTriviallyIdentity() const { 467 inline bool isTriviallyIdentity() const {
461 return 0 == fTypeMask; 468 return 0 == fTypeMask;
462 } 469 }
463 }; 470 };
464 471
465 #endif 472 #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