| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 return command_buffer_->GetTransferBuffer(shm_id); | 185 return command_buffer_->GetTransferBuffer(shm_id); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void GpuScheduler::set_token(int32 token) { | 188 void GpuScheduler::set_token(int32 token) { |
| 189 command_buffer_->SetToken(token); | 189 command_buffer_->SetToken(token); |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool GpuScheduler::SetGetBuffer(int32 transfer_buffer_id) { | 192 bool GpuScheduler::SetGetBuffer(int32 transfer_buffer_id) { |
| 193 scoped_refptr<Buffer> ring_buffer = | 193 scoped_refptr<Buffer> ring_buffer = |
| 194 command_buffer_->GetTransferBuffer(transfer_buffer_id); | 194 command_buffer_->GetTransferBuffer(transfer_buffer_id); |
| 195 if (!ring_buffer) { | 195 if (!ring_buffer.get()) { |
| 196 return false; | 196 return false; |
| 197 } | 197 } |
| 198 | 198 |
| 199 if (!parser_.get()) { | 199 if (!parser_.get()) { |
| 200 parser_.reset(new CommandParser(handler_)); | 200 parser_.reset(new CommandParser(handler_)); |
| 201 } | 201 } |
| 202 | 202 |
| 203 parser_->SetBuffer( | 203 parser_->SetBuffer( |
| 204 ring_buffer->memory(), ring_buffer->size(), 0, ring_buffer->size()); | 204 ring_buffer->memory(), ring_buffer->size(), 0, ring_buffer->size()); |
| 205 | 205 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 base::Closure task_) | 303 base::Closure task_) |
| 304 : fence(fence_), | 304 : fence(fence_), |
| 305 issue_time(base::Time::Now()), | 305 issue_time(base::Time::Now()), |
| 306 task(task_) { | 306 task(task_) { |
| 307 } | 307 } |
| 308 | 308 |
| 309 GpuScheduler::UnscheduleFence::~UnscheduleFence() { | 309 GpuScheduler::UnscheduleFence::~UnscheduleFence() { |
| 310 } | 310 } |
| 311 | 311 |
| 312 } // namespace gpu | 312 } // namespace gpu |
| OLD | NEW |