| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/callback.h" | 7 #include "base/callback.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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 | 226 |
| 227 int32 GpuScheduler::GetGetOffset() { | 227 int32 GpuScheduler::GetGetOffset() { |
| 228 return parser_->get(); | 228 return parser_->get(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void GpuScheduler::SetResizeCallback( | 231 void GpuScheduler::SetResizeCallback( |
| 232 Callback1<gfx::Size>::Type* callback) { | 232 Callback1<gfx::Size>::Type* callback) { |
| 233 decoder_->SetResizeCallback(callback); | 233 decoder_->SetResizeCallback(callback); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void GpuScheduler::SetSwapBuffersCallback( | |
| 237 Callback0::Type* callback) { | |
| 238 wrapped_swap_buffers_callback_.reset(callback); | |
| 239 decoder_->SetSwapBuffersCallback( | |
| 240 NewCallback(this, | |
| 241 &GpuScheduler::WillSwapBuffers)); | |
| 242 } | |
| 243 | |
| 244 void GpuScheduler::SetCommandProcessedCallback( | 236 void GpuScheduler::SetCommandProcessedCallback( |
| 245 Callback0::Type* callback) { | 237 Callback0::Type* callback) { |
| 246 command_processed_callback_.reset(callback); | 238 command_processed_callback_.reset(callback); |
| 247 } | 239 } |
| 248 | 240 |
| 249 GpuScheduler::GpuScheduler(CommandBuffer* command_buffer, | 241 GpuScheduler::GpuScheduler(CommandBuffer* command_buffer, |
| 250 gles2::GLES2Decoder* decoder, | 242 gles2::GLES2Decoder* decoder, |
| 251 CommandParser* parser) | 243 CommandParser* parser) |
| 252 : command_buffer_(command_buffer), | 244 : command_buffer_(command_buffer), |
| 253 decoder_(decoder), | 245 decoder_(decoder), |
| 254 parser_(parser), | 246 parser_(parser), |
| 255 unscheduled_count_(0), | 247 unscheduled_count_(0), |
| 256 #if defined(OS_MACOSX) | 248 #if defined(OS_MACOSX) |
| 257 swap_buffers_count_(0), | 249 swap_buffers_count_(0), |
| 258 acknowledged_swap_buffers_count_(0), | 250 acknowledged_swap_buffers_count_(0), |
| 259 #endif | 251 #endif |
| 260 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { | 252 method_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { |
| 261 } | 253 } |
| 262 | 254 |
| 263 } // namespace gpu | 255 } // namespace gpu |
| OLD | NEW |