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 a99201e4b36164ef01ef218d7651f6fe55e851b9..c67f434f3bfa31602eccccf1ad0c98a473cd0efb 100644 |
--- a/gpu/command_buffer/client/cmd_buffer_helper.cc |
+++ b/gpu/command_buffer/client/cmd_buffer_helper.cc |
@@ -23,6 +23,7 @@ CommandBufferHelper::CommandBufferHelper(CommandBuffer* command_buffer) |
token_(0), |
put_(0), |
last_put_sent_(0), |
+ last_shallow_put_sent_(0), |
#if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK) |
commands_issued_(0), |
#endif |
@@ -153,12 +154,26 @@ void CommandBufferHelper::Flush() { |
if (usable() && last_put_sent_ != put_) { |
last_flush_time_ = base::TimeTicks::Now(); |
last_put_sent_ = put_; |
+ last_shallow_put_sent_ = put_; |
command_buffer_->Flush(put_); |
++flush_generation_; |
CalcImmediateEntries(0); |
} |
} |
+void CommandBufferHelper::ShallowFlush() { |
+ // Wrap put_ before flush. |
+ if (put_ == total_entry_count_) |
+ put_ = 0; |
+ |
+ if (usable() && last_shallow_put_sent_ != put_) { |
+ last_shallow_put_sent_ = put_; |
+ command_buffer_->ShallowFlush(put_); |
+ ++flush_generation_; |
+ CalcImmediateEntries(0); |
+ } |
+} |
+ |
#if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK) |
void CommandBufferHelper::PeriodicFlushCheck() { |
base::TimeTicks current_time = base::TimeTicks::Now(); |