diff options
author | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-17 12:17:00 +0000 |
---|---|---|
committer | tomhudson@google.com <tomhudson@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-01-17 12:17:00 +0000 |
commit | 21e4322b925b1a0463094be8e9cc581d284f4b46 (patch) | |
tree | e4c4321f406ace24e9e172b23f0ab9704f35abe8 /include/utils | |
parent | 4d28d9889b033777afc1950474296d37887ef71b (diff) |
Add SSE2 multiplication for SkMatrix44 on some platforms.
Original author whunt@chromium.org.
https://codereview.appspot.com/7058077/
git-svn-id: http://skia.googlecode.com/svn/trunk@7241 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/utils')
-rw-r--r-- | include/utils/SkMatrix44.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/include/utils/SkMatrix44.h b/include/utils/SkMatrix44.h index 41f1a30209..83fb7c9946 100644 --- a/include/utils/SkMatrix44.h +++ b/include/utils/SkMatrix44.h @@ -51,6 +51,11 @@ static const SkMScalar SK_MScalarPI = 3.14159265f; #endif +#if (defined(__x86_64__) || defined(_M_X64) || defined(__SSE2__)) && \ +defined(SK_MSCALAR_IS_DOUBLE) +#define SK_MATRIX44_USE_SSE2 +#endif + #define SkMScalarToScalar SkMScalarToFloat #define SkScalarToMScalar SkFloatToMScalar @@ -99,7 +104,11 @@ struct SkVector4 { } }; -class SK_API SkMatrix44 { +class +#if defined(SK_MATRIX44_USE_SSE2) && defined(_MSC_VER) +__declspec(align(16)) +#endif +SK_API SkMatrix44 { public: enum Uninitialized_Constructor { @@ -398,6 +407,10 @@ private: inline bool isTriviallyIdentity() const { return 0 == fTypeMask; } -}; +} +#if defined(SK_MATRIX44_USE_SSE2) && !defined(_MSC_VER) +__attribute__ ((aligned (16))) +#endif +; #endif |