Index: gpu/command_buffer/client/cmd_buffer_helper.cc |
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.cc b/gpu/command_buffer/client/cmd_buffer_helper.cc |
index b50527a8dce98fab69c79185b892d9953e90bb4e..1f9b1117805149b7ac48be3a3037a9a7a1f1264f 100644 |
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc |
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc |
@@ -7,6 +7,7 @@ |
#include "gpu/command_buffer/client/cmd_buffer_helper.h" |
#include "base/logging.h" |
+#include "base/time/time.h" |
hamaji
2014/07/09 06:03:15
I guessed using TimeTicks in this file is fine bec
|
#include "gpu/command_buffer/common/command_buffer.h" |
#include "gpu/command_buffer/common/trace_event.h" |
@@ -151,7 +152,7 @@ void CommandBufferHelper::Flush() { |
put_ = 0; |
if (usable() && last_put_sent_ != put_) { |
- last_flush_time_ = clock(); |
+ last_flush_time_ = base::TimeTicks::Now().ToInternalValue(); |
last_put_sent_ = put_; |
command_buffer_->Flush(put_); |
++flush_generation_; |
@@ -161,9 +162,11 @@ void CommandBufferHelper::Flush() { |
#if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK) |
void CommandBufferHelper::PeriodicFlushCheck() { |
- clock_t current_time = clock(); |
- if (current_time - last_flush_time_ > kPeriodicFlushDelay * CLOCKS_PER_SEC) |
+ base::TimeTicks current_time = base::TimeTicks::Now(); |
+ if (current_time - base::TimeTicks::FromInternalValue(last_flush_time_) > |
+ base::TimeDelta::FromSecondsD(kPeriodicFlushDelay)) { |
vmiura
2014/07/09 20:18:58
Could we change this to FromMicroseconds to avoid
hamaji
2014/07/10 07:00:16
Did you worry about that 1.0/300 will be converted
vmiura
2014/07/10 22:21:25
Ok, it was just a performance question. In some t
|
Flush(); |
+ } |
} |
#endif |