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

Unified Diff: src/animator/SkTime.cpp

Issue 136673002: remove remaining references to Sk64 (obsolete) (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 11 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 | « samplecode/SampleXfermodesBlur.cpp ('k') | src/core/Sk64.h » ('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 ffd6f38d571d6cd0f6189e65737dfc376f0f7107..a4e035bd1e2ed53199d8a50b317990252208ac73 100644
--- a/src/animator/SkTime.cpp
+++ b/src/animator/SkTime.cpp
@@ -1,4 +1,3 @@
-
/*
* Copyright 2006 The Android Open Source Project
*
@@ -6,7 +5,6 @@
* found in the LICENSE file.
*/
-
#include "SkTime.h"
#ifdef SK_BUILD_FOR_WIN
@@ -15,10 +13,8 @@
SkMSec gForceTickCount = (SkMSec) -1;
#endif
-void SkTime::GetDateTime(DateTime* t)
-{
- if (t)
- {
+void SkTime::GetDateTime(DateTime* t) {
+ if (t) {
SYSTEMTIME syst;
::GetLocalTime(&syst);
@@ -32,11 +28,11 @@ void SkTime::GetDateTime(DateTime* t)
}
}
-SkMSec SkTime::GetMSecs()
-{
+SkMSec SkTime::GetMSecs() {
#ifdef SK_DEBUG
- if (gForceTickCount != (SkMSec) -1)
+ if (gForceTickCount != (SkMSec) -1) {
return gForceTickCount;
+ }
#endif
return ::GetTickCount();
}
@@ -45,10 +41,8 @@ SkMSec SkTime::GetMSecs()
#include <time.h>
-void SkTime::GetDateTime(DateTime* t)
-{
- if (t)
- {
+void SkTime::GetDateTime(DateTime* t) {
+ if (t) {
tm syst;
time_t tm;
@@ -64,17 +58,13 @@ void SkTime::GetDateTime(DateTime* t)
}
}
-#include "Sk64.h"
-
-SkMSec SkTime::GetMSecs()
-{
+SkMSec SkTime::GetMSecs() {
UnsignedWide wide;
- Sk64 s;
-
::Microseconds(&wide);
- s.set(wide.hi, wide.lo);
- s.div(1000, Sk64::kRound_DivOption);
- return s.get32();
+
+ 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 | « samplecode/SampleXfermodesBlur.cpp ('k') | src/core/Sk64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698