| 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 #include "gpu/command_buffer/service/gpu_scheduler.h" | 5 #include "gpu/command_buffer/service/gpu_scheduler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 void GpuScheduler::PutChanged() { | 45 void GpuScheduler::PutChanged() { |
| 46 TRACE_EVENT1( | 46 TRACE_EVENT1( |
| 47 "gpu", "GpuScheduler:PutChanged", | 47 "gpu", "GpuScheduler:PutChanged", |
| 48 "decoder", decoder_ ? decoder_->GetLogger()->GetLogPrefix() : "None"); | 48 "decoder", decoder_ ? decoder_->GetLogger()->GetLogPrefix() : "None"); |
| 49 | 49 |
| 50 CommandBuffer::State state = command_buffer_->GetLastState(); | 50 CommandBuffer::State state = command_buffer_->GetLastState(); |
| 51 | 51 |
| 52 // If there is no parser, exit. | 52 // If there is no parser, exit. |
| 53 if (!parser_.get()) { | 53 if (!parser_.get()) { |
| 54 DCHECK_EQ(state.get_offset, state.put_offset); | 54 DCHECK_EQ(state.get_offset, command_buffer_->GetPutOffset()); |
| 55 return; | 55 return; |
| 56 } | 56 } |
| 57 | 57 |
| 58 parser_->set_put(state.put_offset); | 58 parser_->set_put(command_buffer_->GetPutOffset()); |
| 59 if (state.error != error::kNoError) | 59 if (state.error != error::kNoError) |
| 60 return; | 60 return; |
| 61 | 61 |
| 62 // Check that the GPU has passed all fences. | 62 // Check that the GPU has passed all fences. |
| 63 if (!PollUnscheduleFences()) | 63 if (!PollUnscheduleFences()) |
| 64 return; | 64 return; |
| 65 | 65 |
| 66 // One of the unschedule fence tasks might have unscheduled us. | 66 // One of the unschedule fence tasks might have unscheduled us. |
| 67 if (!IsScheduled()) | 67 if (!IsScheduled()) |
| 68 return; | 68 return; |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 base::Closure task_) | 301 base::Closure task_) |
| 302 : fence(fence_), | 302 : fence(fence_), |
| 303 issue_time(base::Time::Now()), | 303 issue_time(base::Time::Now()), |
| 304 task(task_) { | 304 task(task_) { |
| 305 } | 305 } |
| 306 | 306 |
| 307 GpuScheduler::UnscheduleFence::~UnscheduleFence() { | 307 GpuScheduler::UnscheduleFence::~UnscheduleFence() { |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace gpu | 310 } // namespace gpu |
| OLD | NEW |