Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: include/core/Sk64.h

Issue 119353003: Revert "Revert "begin to remove SkLONGLONG and wean Skia off of Sk64"" (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/config/SkUserConfig.h ('k') | include/core/SkFixed.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/Sk64.h
diff --git a/include/core/Sk64.h b/include/core/Sk64.h
index eba8b684c651f0c62f45a484959eebd625d5c3a8..009744938fe397908ca544317f871eee568f8eac 100644
--- a/include/core/Sk64.h
+++ b/include/core/Sk64.h
@@ -17,9 +17,17 @@
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); }
@@ -169,9 +177,8 @@ struct SK_API Sk64 {
return a.fHi > b.fHi || (a.fHi == b.fHi && a.fLo >= b.fLo);
}
-#ifdef SkLONGLONG
- SkLONGLONG getLongLong() const;
-#endif
+ // Private to unittests. Parameter is (skiatest::Reporter*)
+ static void UnitTestWithReporter(void* skiatest_reporter);
};
#endif
« no previous file with comments | « include/config/SkUserConfig.h ('k') | include/core/SkFixed.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698