aboutsummaryrefslogtreecommitdiffstats
path: root/include/core/SkMatrix.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/core/SkMatrix.h')
-rw-r--r--include/core/SkMatrix.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/core/SkMatrix.h b/include/core/SkMatrix.h
index 7c77902..480e077 100644
--- a/include/core/SkMatrix.h
+++ b/include/core/SkMatrix.h
@@ -438,6 +438,7 @@ public:
*/
bool fixedStepInX(SkScalar y, SkFixed* stepX, SkFixed* stepY) const;
+#ifdef SK_SCALAR_IS_FIXED
friend bool operator==(const SkMatrix& a, const SkMatrix& b) {
return memcmp(a.fMat, b.fMat, sizeof(a.fMat)) == 0;
}
@@ -445,6 +446,12 @@ public:
friend bool operator!=(const SkMatrix& a, const SkMatrix& b) {
return memcmp(a.fMat, b.fMat, sizeof(a.fMat)) != 0;
}
+#else
+ friend bool operator==(const SkMatrix& a, const SkMatrix& b);
+ friend bool operator!=(const SkMatrix& a, const SkMatrix& b) {
+ return !(a == b);
+ }
+#endif
enum {
// flatten/unflatten will never return a value larger than this
@@ -488,7 +495,12 @@ private:
kRectStaysRect_Mask = 0x10,
kUnknown_Mask = 0x80,
-
+
+ kORableMasks = kTranslate_Mask |
+ kScale_Mask |
+ kAffine_Mask |
+ kPerspective_Mask,
+
kAllMasks = kTranslate_Mask |
kScale_Mask |
kAffine_Mask |
@@ -506,7 +518,12 @@ private:
SkASSERT(kUnknown_Mask == mask || (mask & kAllMasks) == mask);
fTypeMask = SkToU8(mask);
}
-
+
+ void orTypeMask(int mask) {
+ SkASSERT((mask & kORableMasks) == mask);
+ fTypeMask = SkToU8(fTypeMask | mask);
+ }
+
void clearTypeMask(int mask) {
// only allow a valid mask
SkASSERT((mask & kAllMasks) == mask);