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

Unified Diff: gpu/command_buffer/client/cmd_buffer_helper.h

Issue 381473004: Use TimeTicks instead of clock() in gpu::CommandBufferHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 6 years, 5 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 | « no previous file | gpu/command_buffer/client/cmd_buffer_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/cmd_buffer_helper.h
diff --git a/gpu/command_buffer/client/cmd_buffer_helper.h b/gpu/command_buffer/client/cmd_buffer_helper.h
index 86d3c3bf6c16d60a3915ce354ca84c7fc45dea98..954107f1590a6b0816146b93dfeb6d2fb9199758 100644
--- a/gpu/command_buffer/client/cmd_buffer_helper.h
+++ b/gpu/command_buffer/client/cmd_buffer_helper.h
@@ -10,6 +10,7 @@
#include <string.h>
#include <time.h>
+#include "base/time/time.h"
#include "gpu/command_buffer/common/cmd_buffer_common.h"
#include "gpu/command_buffer/common/command_buffer.h"
#include "gpu/command_buffer/common/constants.h"
@@ -20,7 +21,8 @@ namespace gpu {
#if !defined(OS_ANDROID)
#define CMD_HELPER_PERIODIC_FLUSH_CHECK
const int kCommandsPerFlushCheck = 100;
-const float kPeriodicFlushDelay = 1.0f / (5.0f * 60.0f);
+const int kPeriodicFlushDelayInMicroseconds =
+ base::Time::kMicrosecondsPerSecond / (5 * 60);
#endif
const int kAutoFlushSmall = 16; // 1/16 of the buffer
@@ -325,8 +327,7 @@ class GPU_EXPORT CommandBufferHelper {
bool context_lost_;
bool flush_automatically_;
- // Using C runtime instead of base because this file cannot depend on base.
- clock_t last_flush_time_;
+ base::TimeTicks last_flush_time_;
// Incremented every time the helper flushes the command buffer.
// Can be used to track when prior commands have been flushed.
« no previous file with comments | « no previous file | gpu/command_buffer/client/cmd_buffer_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698