| 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 "content/common/gpu/client/command_buffer_proxy_impl.h" | 5 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/process_util.h" | 10 #include "base/process_util.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 return Send(new GpuCommandBufferMsg_DiscardBackbuffer(route_id_)); | 409 return Send(new GpuCommandBufferMsg_DiscardBackbuffer(route_id_)); |
| 410 } | 410 } |
| 411 | 411 |
| 412 bool CommandBufferProxyImpl::EnsureBackbuffer() { | 412 bool CommandBufferProxyImpl::EnsureBackbuffer() { |
| 413 if (last_state_.error != gpu::error::kNoError) | 413 if (last_state_.error != gpu::error::kNoError) |
| 414 return false; | 414 return false; |
| 415 | 415 |
| 416 return Send(new GpuCommandBufferMsg_EnsureBackbuffer(route_id_)); | 416 return Send(new GpuCommandBufferMsg_EnsureBackbuffer(route_id_)); |
| 417 } | 417 } |
| 418 | 418 |
| 419 uint32 CommandBufferProxyImpl::InsertSyncPoint() { |
| 420 uint32 sync_point = 0; |
| 421 Send(new GpuCommandBufferMsg_InsertSyncPoint(route_id_, &sync_point)); |
| 422 return sync_point; |
| 423 } |
| 424 |
| 425 void CommandBufferProxyImpl::WaitSyncPoint(uint32 sync_point) { |
| 426 Send(new GpuCommandBufferMsg_WaitSyncPoint(route_id_, sync_point)); |
| 427 } |
| 428 |
| 419 bool CommandBufferProxyImpl::SetParent( | 429 bool CommandBufferProxyImpl::SetParent( |
| 420 CommandBufferProxy* parent_command_buffer, | 430 CommandBufferProxy* parent_command_buffer, |
| 421 uint32 parent_texture_id) { | 431 uint32 parent_texture_id) { |
| 422 if (last_state_.error != gpu::error::kNoError) | 432 if (last_state_.error != gpu::error::kNoError) |
| 423 return false; | 433 return false; |
| 424 | 434 |
| 425 bool result; | 435 bool result; |
| 426 if (parent_command_buffer) { | 436 if (parent_command_buffer) { |
| 427 if (!Send(new GpuCommandBufferMsg_SetParent( | 437 if (!Send(new GpuCommandBufferMsg_SetParent( |
| 428 route_id_, | 438 route_id_, |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 | 516 |
| 507 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( | 517 void CommandBufferProxyImpl::SetOnConsoleMessageCallback( |
| 508 const GpuConsoleMessageCallback& callback) { | 518 const GpuConsoleMessageCallback& callback) { |
| 509 console_message_callback_ = callback; | 519 console_message_callback_ = callback; |
| 510 } | 520 } |
| 511 | 521 |
| 512 void CommandBufferProxyImpl::TryUpdateState() { | 522 void CommandBufferProxyImpl::TryUpdateState() { |
| 513 if (last_state_.error == gpu::error::kNoError) | 523 if (last_state_.error == gpu::error::kNoError) |
| 514 shared_state_->Read(&last_state_); | 524 shared_state_->Read(&last_state_); |
| 515 } | 525 } |
| OLD | NEW |