| 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 "content/renderer/gpu/command_buffer_proxy.h" | 5 #include "content/renderer/gpu/command_buffer_proxy.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/shared_memory.h" | 10 #include "base/shared_memory.h" |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 if (!Send(new GpuChannelMsg_Echo(GpuCommandBufferMsg_EchoAck(route_id_)))) { | 361 if (!Send(new GpuChannelMsg_Echo(GpuCommandBufferMsg_EchoAck(route_id_)))) { |
| 362 return false; | 362 return false; |
| 363 } | 363 } |
| 364 | 364 |
| 365 echo_tasks_.push(callback); | 365 echo_tasks_.push(callback); |
| 366 | 366 |
| 367 return true; | 367 return true; |
| 368 } | 368 } |
| 369 | 369 |
| 370 bool CommandBufferProxy::SetSurfaceVisible(bool visible) { |
| 371 if (last_state_.error != gpu::error::kNoError) { |
| 372 return false; |
| 373 } |
| 374 |
| 375 return Send(new GpuCommandBufferMsg_SetSurfaceVisible(route_id_, visible)); |
| 376 } |
| 377 |
| 378 |
| 370 bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer, | 379 bool CommandBufferProxy::SetParent(CommandBufferProxy* parent_command_buffer, |
| 371 uint32 parent_texture_id) { | 380 uint32 parent_texture_id) { |
| 372 if (last_state_.error != gpu::error::kNoError) | 381 if (last_state_.error != gpu::error::kNoError) |
| 373 return false; | 382 return false; |
| 374 | 383 |
| 375 bool result; | 384 bool result; |
| 376 if (parent_command_buffer) { | 385 if (parent_command_buffer) { |
| 377 if (!Send(new GpuCommandBufferMsg_SetParent( | 386 if (!Send(new GpuCommandBufferMsg_SetParent( |
| 378 route_id_, | 387 route_id_, |
| 379 parent_command_buffer->route_id_, | 388 parent_command_buffer->route_id_, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 delete msg; | 450 delete msg; |
| 442 return false; | 451 return false; |
| 443 } | 452 } |
| 444 | 453 |
| 445 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { | 454 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { |
| 446 // Handle wraparound. It works as long as we don't have more than 2B state | 455 // Handle wraparound. It works as long as we don't have more than 2B state |
| 447 // updates in flight across which reordering occurs. | 456 // updates in flight across which reordering occurs. |
| 448 if (state.generation - last_state_.generation < 0x80000000U) | 457 if (state.generation - last_state_.generation < 0x80000000U) |
| 449 last_state_ = state; | 458 last_state_ = state; |
| 450 } | 459 } |
| OLD | NEW |