diff options
author | 2012-10-31 19:59:23 +0000 | |
---|---|---|
committer | 2012-10-31 19:59:23 +0000 | |
commit | e1e7d7a6b55504d97ce9f30202a179b63800093b (patch) | |
tree | 23b401593aa2a415d55f1bd705a2806055fbfa87 /include/core/SkRect.h | |
parent | 4d3c28158a65f9eac6b472dff29caa77b44f8134 (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.h | 4 |
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 |