Index: src/views/SkEvent.cpp |
diff --git a/src/views/SkEvent.cpp b/src/views/SkEvent.cpp |
index 5316b49a1d4d5ab283f549261ae8e0f0ca04c4fc..b90d03f3d017eae94f8d9a2a355ab54b61d0ac84 100644 |
--- a/src/views/SkEvent.cpp |
+++ b/src/views/SkEvent.cpp |
@@ -298,7 +298,7 @@ void SkEvent::postDelay(SkMSec delay) { |
} |
if (delay) { |
- this->postTime(SkTime::GetMSecs() + delay); |
+ this->postTime(GetMSecsSinceStartup() + delay); |
return; |
} |
@@ -404,7 +404,7 @@ SkMSec SkEvent::EnqueueTime(SkEvent* evt, SkMSec time) { |
prev->fNextEvent = evt; |
} |
- SkMSec delay = globals.fDelayQHead->fTime - SkTime::GetMSecs(); |
+ SkMSec delay = globals.fDelayQHead->fTime - GetMSecsSinceStartup(); |
if ((int32_t)delay <= 0) { |
delay = 1; |
} |
@@ -436,7 +436,7 @@ void SkEvent::ServiceQueueTimer() |
globals.fEventMutex.acquire(); |
bool wasEmpty = false; |
- SkMSec now = SkTime::GetMSecs(); |
+ SkMSec now = GetMSecsSinceStartup(); |
SkEvent* evt = globals.fDelayQHead; |
while (evt) |
@@ -485,6 +485,11 @@ int SkEvent::CountEventsOnQueue() { |
return count; |
} |
+SkMSec SkEvent::GetMSecsSinceStartup() { |
+ static const double kEpoch = SkTime::GetMSecs(); |
+ return static_cast<SkMSec>(SkTime::GetMSecs() - kEpoch); |
+} |
+ |
/////////////////////////////////////////////////////////////////////////////// |
void SkEvent::Init() {} |