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 |