Chromium Code Reviews| 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/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 426 | 426 |
| 427 uint32 CommandBufferProxyImpl::InsertSyncPoint() { | 427 uint32 CommandBufferProxyImpl::InsertSyncPoint() { |
| 428 if (last_state_.error != gpu::error::kNoError) | 428 if (last_state_.error != gpu::error::kNoError) |
| 429 return 0; | 429 return 0; |
| 430 | 430 |
| 431 uint32 sync_point = 0; | 431 uint32 sync_point = 0; |
| 432 Send(new GpuCommandBufferMsg_InsertSyncPoint(route_id_, &sync_point)); | 432 Send(new GpuCommandBufferMsg_InsertSyncPoint(route_id_, &sync_point)); |
| 433 return sync_point; | 433 return sync_point; |
| 434 } | 434 } |
| 435 | 435 |
| 436 bool CommandBufferProxyImpl::SignalSyncPoint(uint32 sync_point, | 436 void CommandBufferProxyImpl::SignalSyncPoint(uint32 sync_point, |
| 437 const base::Closure& callback) { | 437 const base::Closure& callback) { |
| 438 if (last_state_.error != gpu::error::kNoError) { | 438 if (last_state_.error != gpu::error::kNoError) |
| 439 return false; | 439 return; |
| 440 } | |
| 441 | 440 |
| 442 uint32 signal_id = next_signal_id_++; | 441 uint32 signal_id = next_signal_id_++; |
| 443 if (!Send(new GpuCommandBufferMsg_SignalSyncPoint(route_id_, | 442 if (!Send(new GpuCommandBufferMsg_SignalSyncPoint(route_id_, |
| 444 sync_point, | 443 sync_point, |
| 445 signal_id))) { | 444 signal_id))) { |
| 446 return false; | 445 return; |
|
no sievers
2013/09/27 18:13:04
We might want to revisit the behavior and always g
| |
| 447 } | 446 } |
| 448 | 447 |
| 449 signal_tasks_.insert(std::make_pair(signal_id, callback)); | 448 signal_tasks_.insert(std::make_pair(signal_id, callback)); |
| 450 | |
| 451 return true; | |
| 452 } | 449 } |
| 453 | 450 |
| 454 bool CommandBufferProxyImpl::SignalQuery(unsigned query, | 451 bool CommandBufferProxyImpl::SignalQuery(unsigned query, |
| 455 const base::Closure& callback) { | 452 const base::Closure& callback) { |
| 456 if (last_state_.error != gpu::error::kNoError) { | 453 if (last_state_.error != gpu::error::kNoError) { |
| 457 return false; | 454 return false; |
| 458 } | 455 } |
| 459 | 456 |
| 460 // Signal identifiers are hidden, so nobody outside of this class will see | 457 // Signal identifiers are hidden, so nobody outside of this class will see |
| 461 // them. (And thus, they cannot save them.) The IDs themselves only last | 458 // them. (And thus, they cannot save them.) The IDs themselves only last |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 void CommandBufferProxyImpl::SendManagedMemoryStats( | 581 void CommandBufferProxyImpl::SendManagedMemoryStats( |
| 585 const GpuManagedMemoryStats& stats) { | 582 const GpuManagedMemoryStats& stats) { |
| 586 if (last_state_.error != gpu::error::kNoError) | 583 if (last_state_.error != gpu::error::kNoError) |
| 587 return; | 584 return; |
| 588 | 585 |
| 589 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, | 586 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, |
| 590 stats)); | 587 stats)); |
| 591 } | 588 } |
| 592 | 589 |
| 593 } // namespace content | 590 } // namespace content |
| OLD | NEW |