| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file contains the implementation of the command buffer helper class. | 5 // This file contains the implementation of the command buffer helper class. |
| 6 | 6 |
| 7 #include "gpu/command_buffer/client/cmd_buffer_helper.h" | 7 #include "gpu/command_buffer/client/cmd_buffer_helper.h" |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 146 } |
| 147 | 147 |
| 148 void CommandBufferHelper::Flush() { | 148 void CommandBufferHelper::Flush() { |
| 149 // Wrap put_ before flush. | 149 // Wrap put_ before flush. |
| 150 if (put_ == total_entry_count_) | 150 if (put_ == total_entry_count_) |
| 151 put_ = 0; | 151 put_ = 0; |
| 152 | 152 |
| 153 if (usable() && last_put_sent_ != put_) { | 153 if (usable() && last_put_sent_ != put_) { |
| 154 last_flush_time_ = base::TimeTicks::Now(); | 154 last_flush_time_ = base::TimeTicks::Now(); |
| 155 last_put_sent_ = put_; | 155 last_put_sent_ = put_; |
| 156 command_buffer_->Flush(put_); | 156 command_buffer_->Flush(put_, sync_points_to_wait_on_); |
| 157 sync_points_to_wait_on_.clear(); |
| 157 ++flush_generation_; | 158 ++flush_generation_; |
| 158 CalcImmediateEntries(0); | 159 CalcImmediateEntries(0); |
| 159 } | 160 } |
| 160 } | 161 } |
| 161 | 162 |
| 162 #if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK) | 163 #if defined(CMD_HELPER_PERIODIC_FLUSH_CHECK) |
| 163 void CommandBufferHelper::PeriodicFlushCheck() { | 164 void CommandBufferHelper::PeriodicFlushCheck() { |
| 164 base::TimeTicks current_time = base::TimeTicks::Now(); | 165 base::TimeTicks current_time = base::TimeTicks::Now(); |
| 165 if (current_time - last_flush_time_ > | 166 if (current_time - last_flush_time_ > |
| 166 base::TimeDelta::FromMicroseconds(kPeriodicFlushDelayInMicroseconds)) { | 167 base::TimeDelta::FromMicroseconds(kPeriodicFlushDelayInMicroseconds)) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 if (!WaitForGetOffsetInRange(put_ + count + 1, put_)) | 285 if (!WaitForGetOffsetInRange(put_ + count + 1, put_)) |
| 285 return; | 286 return; |
| 286 CalcImmediateEntries(count); | 287 CalcImmediateEntries(count); |
| 287 DCHECK_GE(immediate_entry_count_, count); | 288 DCHECK_GE(immediate_entry_count_, count); |
| 288 } | 289 } |
| 289 } | 290 } |
| 290 } | 291 } |
| 291 | 292 |
| 292 | 293 |
| 293 } // namespace gpu | 294 } // namespace gpu |
| OLD | NEW |