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

Unified Diff: src/animator/SkTime.cpp

Issue 1420923003: Revert of SkTime::GetNSecs() (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 months 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/core/SkTime.h ('k') | src/core/SkTime.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/animator/SkTime.cpp
diff --git a/src/animator/SkTime.cpp b/src/animator/SkTime.cpp
index 560ccd2fc868d2a968595d3d15d1661162207f07..a4e035bd1e2ed53199d8a50b317990252208ac73 100644
--- a/src/animator/SkTime.cpp
+++ b/src/animator/SkTime.cpp
@@ -28,6 +28,15 @@
}
}
+SkMSec SkTime::GetMSecs() {
+#ifdef SK_DEBUG
+ if (gForceTickCount != (SkMSec) -1) {
+ return gForceTickCount;
+ }
+#endif
+ return ::GetTickCount();
+}
+
#elif defined(xSK_BUILD_FOR_MAC)
#include <time.h>
@@ -49,4 +58,13 @@
}
}
+SkMSec SkTime::GetMSecs() {
+ UnsignedWide wide;
+ ::Microseconds(&wide);
+
+ int64_t s = ((int64_t)wide.hi << 32) | wide.lo;
+ s = (s + 500) / 1000; // rounded divide
+ return (SkMSec)s;
+}
+
#endif
« no previous file with comments | « include/core/SkTime.h ('k') | src/core/SkTime.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698