diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-19 22:28:48 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-12-19 22:28:48 +0000 |
commit | b1560445c66a751fc2ea7b85b94430a985940f3e (patch) | |
tree | 0b32c5228339f562a7f1c983638ff81b3568afae /include | |
parent | 8d7ed847be265d3e5058079029a3f6430d93130e (diff) |
Revert "begin to remove SkLONGLONG and wean Skia off of Sk64"
This reverts commit 784890196fdab96289f9389db43aca01f35db0f9.
Revert "use LL suffix for 64bit literal"
This reverts commit 9634295aff9bffd7a3875a0ca4a9b1a27d0793fc.
BUG=
Review URL: https://codereview.chromium.org/116543009
git-svn-id: http://skia.googlecode.com/svn/trunk@12790 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/config/SkUserConfig.h | 6 | ||||
-rw-r--r-- | include/core/Sk64.h | 13 | ||||
-rw-r--r-- | include/core/SkFixed.h | 4 | ||||
-rw-r--r-- | include/core/SkPostConfig.h | 10 | ||||
-rw-r--r-- | include/utils/SkCamera.h | 5 |
5 files changed, 21 insertions, 17 deletions
diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h index ec791d9a50..534c79dde1 100644 --- a/include/config/SkUserConfig.h +++ b/include/config/SkUserConfig.h @@ -88,6 +88,12 @@ //#define SK_UINT8_BITFIELD_LENDIAN +/* Some compilers don't support long long for 64bit integers. If yours does + not, define this to the appropriate type. + */ +//#define SkLONGLONG int64_t + + /* To write debug messages to a console, skia will call SkDebugf(...) following printf conventions (e.g. const char* format, ...). If you want to redirect this to something other than printf, define yours here diff --git a/include/core/Sk64.h b/include/core/Sk64.h index 009744938f..eba8b684c6 100644 --- a/include/core/Sk64.h +++ b/include/core/Sk64.h @@ -17,17 +17,9 @@ Sk64 is a 64-bit math package that does not require long long support from the compiler. */ struct SK_API Sk64 { -private: int32_t fHi; //!< the high 32 bits of the number (including sign) uint32_t fLo; //!< the low 32 bits of the number -public: - int32_t hi() const { return fHi; } - uint32_t lo() const { return fLo; } - - int64_t as64() const { return ((int64_t)fHi << 32) | fLo; } - int64_t getLongLong() const { return this->as64(); } - /** Returns non-zero if the Sk64 can be represented as a signed 32 bit integer */ SkBool is32() const { return fHi == ((int32_t)fLo >> 31); } @@ -177,8 +169,9 @@ public: return a.fHi > b.fHi || (a.fHi == b.fHi && a.fLo >= b.fLo); } - // Private to unittests. Parameter is (skiatest::Reporter*) - static void UnitTestWithReporter(void* skiatest_reporter); +#ifdef SkLONGLONG + SkLONGLONG getLongLong() const; +#endif }; #endif diff --git a/include/core/SkFixed.h b/include/core/SkFixed.h index 42a9eec284..580d94b9ca 100644 --- a/include/core/SkFixed.h +++ b/include/core/SkFixed.h @@ -118,11 +118,11 @@ static inline SkFixed SkFixedCos(SkFixed radians) { #ifdef SkLONGLONG inline SkFixed SkFixedMul_longlong(SkFixed a, SkFixed b) { - return (SkFixed)((int64_t)a * b >> 16); + return (SkFixed)((SkLONGLONG)a * b >> 16); } inline SkFixed SkFixedSquare_longlong(SkFixed value) { - return (SkFixed)((int64_t)value * value >> 16); + return (SkFixed)((SkLONGLONG)value * value >> 16); } #define SkFixedMul(a,b) SkFixedMul_longlong(a,b) #define SkFixedSquare(a) SkFixedSquare_longlong(a) diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h index 2156519b2d..323d1e8b6d 100644 --- a/include/core/SkPostConfig.h +++ b/include/core/SkPostConfig.h @@ -227,13 +227,13 @@ ////////////////////////////////////////////////////////////////////// -// TODO: rebaseline as needed so we can remove this flag entirely. -// - all platforms have int64_t now -// - we have slightly different fixed math results because of this check -// since we don't define this for linux/android #if defined(SK_BUILD_FOR_WIN32) || defined(SK_BUILD_FOR_MAC) # ifndef SkLONGLONG -# define SkLONGLONG int64_t +# ifdef SK_BUILD_FOR_WIN32 +# define SkLONGLONG __int64 +# else +# define SkLONGLONG long long +# endif # endif #endif diff --git a/include/utils/SkCamera.h b/include/utils/SkCamera.h index 2e5e3423bb..ad74c81d2f 100644 --- a/include/utils/SkCamera.h +++ b/include/utils/SkCamera.h @@ -1,3 +1,4 @@ + /* * Copyright 2006 The Android Open Source Project * @@ -5,11 +6,15 @@ * found in the LICENSE file. */ + + + // Inspired by Rob Johnson's most excellent QuickDraw GX sample code #ifndef SkCamera_DEFINED #define SkCamera_DEFINED +#include "Sk64.h" #include "SkMatrix.h" class SkCanvas; |