aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar digit@google.com <digit@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-10 10:00:59 +0000
committerGravatar digit@google.com <digit@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-01-10 10:00:59 +0000
commit3e05f291167a265ae749b4dd9d13ec0407161082 (patch)
treed63098fcbd1b756d4cd7e26156475360a701bb0c /src/utils
parentfa394d491b6e625159f83787619fcb852d245471 (diff)
remove one un-needed static initializer
This patch removes the use of a static C++ object in the implementation of SkMatrix44::isIdentity(). Instead, we rely on direct comparison with a statically allocated array of SkMScalar values, which is completely equivalent. Review URL: http://codereview.appspot.com/5502067 git-svn-id: http://skia.googlecode.com/svn/trunk@2991 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/SkMatrix44.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/utils/SkMatrix44.cpp b/src/utils/SkMatrix44.cpp
index a59c91b60d..f00e399191 100644
--- a/src/utils/SkMatrix44.cpp
+++ b/src/utils/SkMatrix44.cpp
@@ -84,10 +84,14 @@ void SkMatrix44::asRowMajord(double dst[]) const {
///////////////////////////////////////////////////////////////////////////////
-static const SkMatrix44 gIdentity44;
-
bool SkMatrix44::isIdentity() const {
- return *this == gIdentity44;
+ static const SkMScalar sIdentityMat[4][4] = {
+ { 1, 0, 0, 0 },
+ { 0, 1, 0, 0 },
+ { 0, 0, 1, 0 },
+ { 0, 0, 0, 1 },
+ };
+ return !memcmp(fMat, sIdentityMat, sizeof(fMat));
}
///////////////////////////////////////////////////////////////////////////////