summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2014-01-29 18:31:51 -0800
committer John Reck <jreck@google.com> 2014-01-29 19:59:16 -0800
commita6260b83da52b80438074a9fd207327d9e6e6d03 (patch)
treec0cb709f5fe6ffa22a885a49d9fc83939674e97f
parente0d1e295f15a5c70ca030732fd9309f0dc50b2cc (diff)
Fix nano vs. millis
Change-Id: I54f752bb7faab5fa66c36252c9f7cf8f5c9939c9
-rw-r--r--libs/hwui/renderthread/RenderTask.h2
-rw-r--r--libs/hwui/renderthread/RenderThread.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/renderthread/RenderTask.h b/libs/hwui/renderthread/RenderTask.h
index 9fe7573f71b7..1554a167e10c 100644
--- a/libs/hwui/renderthread/RenderTask.h
+++ b/libs/hwui/renderthread/RenderTask.h
@@ -53,7 +53,7 @@ public:
ANDROID_API virtual void run() = 0;
RenderTask* mNext;
- nsecs_t mRunAt;
+ nsecs_t mRunAt; // nano-seconds on the SYSTEM_TIME_MONOTONIC clock
};
class SignalingRenderTask : public RenderTask {
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp
index e4ec164ff02b..212f475e2aa7 100644
--- a/libs/hwui/renderthread/RenderThread.cpp
+++ b/libs/hwui/renderthread/RenderThread.cpp
@@ -128,7 +128,8 @@ bool RenderThread::threadLoop() {
if (nextWakeup == LLONG_MAX) {
timeoutMillis = -1;
} else {
- timeoutMillis = nextWakeup - systemTime(SYSTEM_TIME_MONOTONIC);
+ nsecs_t timeoutNanos = nextWakeup - systemTime(SYSTEM_TIME_MONOTONIC);
+ timeoutMillis = nanoseconds_to_milliseconds(timeoutNanos);
if (timeoutMillis < 0) {
timeoutMillis = 0;
}
@@ -149,7 +150,7 @@ void RenderThread::queue(RenderTask* task) {
void RenderThread::queueDelayed(RenderTask* task, int delayMs) {
nsecs_t now = systemTime(SYSTEM_TIME_MONOTONIC);
- task->mRunAt = now + delayMs;
+ task->mRunAt = now + milliseconds_to_nanoseconds(delayMs);
queue(task);
}