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 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
437 | 437 |
438 bool CommandBufferProxyImpl::GenerateMailboxNames( | 438 bool CommandBufferProxyImpl::GenerateMailboxNames( |
439 unsigned num, | 439 unsigned num, |
440 std::vector<gpu::Mailbox>* names) { | 440 std::vector<gpu::Mailbox>* names) { |
441 if (last_state_.error != gpu::error::kNoError) | 441 if (last_state_.error != gpu::error::kNoError) |
442 return false; | 442 return false; |
443 | 443 |
444 return channel_->GenerateMailboxNames(num, names); | 444 return channel_->GenerateMailboxNames(num, names); |
445 } | 445 } |
446 | 446 |
447 bool CommandBufferProxyImpl::SetParent( | 447 bool CommandBufferProxyImpl::ProduceFrontBuffer(const gpu::Mailbox& mailbox) { |
448 CommandBufferProxy* parent_command_buffer, | |
449 uint32 parent_texture_id) { | |
450 if (last_state_.error != gpu::error::kNoError) | 448 if (last_state_.error != gpu::error::kNoError) |
451 return false; | 449 return false; |
452 | 450 |
453 bool result; | 451 return Send(new GpuCommandBufferMsg_ProduceFrontBuffer(route_id_, mailbox)); |
454 if (parent_command_buffer) { | |
455 if (!Send(new GpuCommandBufferMsg_SetParent( | |
456 route_id_, | |
457 parent_command_buffer->GetRouteID(), | |
458 parent_texture_id, | |
459 &result))) { | |
460 return false; | |
461 } | |
462 } else { | |
463 if (!Send(new GpuCommandBufferMsg_SetParent( | |
464 route_id_, | |
465 MSG_ROUTING_NONE, | |
466 0, | |
467 &result))) { | |
468 return false; | |
469 } | |
470 } | |
471 | |
472 return result; | |
473 } | 452 } |
474 | 453 |
475 scoped_ptr<media::VideoDecodeAccelerator> | 454 scoped_ptr<media::VideoDecodeAccelerator> |
476 CommandBufferProxyImpl::CreateVideoDecoder( | 455 CommandBufferProxyImpl::CreateVideoDecoder( |
477 media::VideoCodecProfile profile, | 456 media::VideoCodecProfile profile, |
478 media::VideoDecodeAccelerator::Client* client) { | 457 media::VideoDecodeAccelerator::Client* client) { |
479 int decoder_route_id; | 458 int decoder_route_id; |
480 scoped_ptr<media::VideoDecodeAccelerator> vda; | 459 scoped_ptr<media::VideoDecodeAccelerator> vda; |
481 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, profile, | 460 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, profile, |
482 &decoder_route_id))) { | 461 &decoder_route_id))) { |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 void CommandBufferProxyImpl::SendManagedMemoryStats( | 522 void CommandBufferProxyImpl::SendManagedMemoryStats( |
544 const GpuManagedMemoryStats& stats) { | 523 const GpuManagedMemoryStats& stats) { |
545 if (last_state_.error != gpu::error::kNoError) | 524 if (last_state_.error != gpu::error::kNoError) |
546 return; | 525 return; |
547 | 526 |
548 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, | 527 Send(new GpuCommandBufferMsg_SendClientManagedMemoryStats(route_id_, |
549 stats)); | 528 stats)); |
550 } | 529 } |
551 | 530 |
552 } // namespace content | 531 } // namespace content |
OLD | NEW |