aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkRect.h
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-31 19:59:23 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-31 19:59:23 +0000
commite1e7d7a6b55504d97ce9f30202a179b63800093b (patch)
tree23b401593aa2a415d55f1bd705a2806055fbfa87 /include/core/SkRect.h
parent4d3c28158a65f9eac6b472dff29caa77b44f8134 (diff)
add SkScalarsEqual() so we don't have to use memcmp for arrays of floats.
git-svn-id: http://skia.googlecode.com/svn/trunk@6226 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r--include/core/SkRect.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 21a37364d4..89014b365d 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -401,11 +401,11 @@ struct SK_API SkRect {
SkScalar centerY() const { return SkScalarHalf(fTop + fBottom); }
friend bool operator==(const SkRect& a, const SkRect& b) {
- return 0 == memcmp(&a, &b, sizeof(a));
+ return SkScalarsEqual((SkScalar*)&a, (SkScalar*)&b, 4);
}
friend bool operator!=(const SkRect& a, const SkRect& b) {
- return 0 != memcmp(&a, &b, sizeof(a));
+ return !SkScalarsEqual((SkScalar*)&a, (SkScalar*)&b, 4);
}
/** return the 4 points that enclose the rectangle