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 d556b5e7773b2d82d1434b8eac5985d2f69326d8..54df89ed3da91ed5fb2997498111e9d25333e827 100644 |
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc |
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc |
@@ -28,9 +28,14 @@ CommandBufferHelper::CommandBufferHelper(CommandBuffer* command_buffer) |
commands_issued_(0), |
usable_(true), |
context_lost_(false), |
+ flush_automatically_(true), |
last_flush_time_(0) { |
} |
+void CommandBufferHelper::SetAutomaticFlushes(bool enabled) { |
+ flush_automatically_ = enabled; |
+} |
+ |
bool CommandBufferHelper::IsContextLost() { |
if (!context_lost_) { |
context_lost_ = error::IsError(command_buffer()->GetLastError()); |
@@ -241,8 +246,9 @@ void CommandBufferHelper::WaitForAvailableEntries(int32 count) { |
((get_offset() == last_put_sent_) ? 16 : 2); |
if (pending > limit) { |
Flush(); |
- } else if (commands_issued_ % kCommandsPerFlushCheck == 0) { |
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
+ } else if (flush_automatically_ && |
+ (commands_issued_ % kCommandsPerFlushCheck == 0)) { |
+#if !defined(OS_ANDROID) |
// Allow this command buffer to be pre-empted by another if a "reasonable" |
// amount of work has been done. On highend machines, this reduces the |
// latency of GPU commands. However, on Android, this can cause the |