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 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 sync_point, | 427 sync_point, |
428 signal_id))) { | 428 signal_id))) { |
429 return false; | 429 return false; |
430 } | 430 } |
431 | 431 |
432 signal_tasks_.insert(std::make_pair(signal_id, callback)); | 432 signal_tasks_.insert(std::make_pair(signal_id, callback)); |
433 | 433 |
434 return true; | 434 return true; |
435 } | 435 } |
436 | 436 |
| 437 bool CommandBufferProxyImpl::SignalQuery(unsigned query, |
| 438 const base::Closure& callback) { |
| 439 if (last_state_.error != gpu::error::kNoError) { |
| 440 return false; |
| 441 } |
| 442 |
| 443 uint32 signal_id = next_signal_id_++; |
| 444 if (!Send(new GpuCommandBufferMsg_SignalQuery(route_id_, |
| 445 query, |
| 446 signal_id))) { |
| 447 return false; |
| 448 } |
| 449 |
| 450 signal_tasks_.insert(std::make_pair(signal_id, callback)); |
| 451 |
| 452 return true; |
| 453 } |
| 454 |
437 | 455 |
438 bool CommandBufferProxyImpl::GenerateMailboxNames( | 456 bool CommandBufferProxyImpl::GenerateMailboxNames( |
439 unsigned num, | 457 unsigned num, |
440 std::vector<gpu::Mailbox>* names) { | 458 std::vector<gpu::Mailbox>* names) { |
441 if (last_state_.error != gpu::error::kNoError) | 459 if (last_state_.error != gpu::error::kNoError) |
442 return false; | 460 return false; |
443 | 461 |
444 return channel_->GenerateMailboxNames(num, names); | 462 return channel_->GenerateMailboxNames(num, names); |
445 } | 463 } |
446 | 464 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 void CommandBufferProxyImpl::SendManagedMemoryStats( | 540 void CommandBufferProxyImpl::SendManagedMemoryStats( |
523 const GpuManagedMemoryStats& stats) { | 541 const GpuManagedMemoryStats& stats) { |
524 if (last_state_.error != gpu::error::kNoError) | 542 if (last_state_.error != gpu::error::kNoError) |
525 return; | 543 return; |
526 | 544 |
527 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, | 545 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, |
528 stats)); | 546 stats)); |
529 } | 547 } |
530 | 548 |
531 } // namespace content | 549 } // namespace content |
OLD | NEW |