| 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 #if defined(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 if (state.error == gpu::error::kLostContext && | 546 if (state.error == gpu::error::kLostContext && |
| 547 gfx::GLContext::LosesAllContextsOnContextLost()) { | 547 gfx::GLContext::LosesAllContextsOnContextLost()) { |
| 548 channel_->LoseAllContexts(); | 548 channel_->LoseAllContexts(); |
| 549 } else { | 549 } else { |
| 550 command_buffer_->UpdateState(); | 550 command_buffer_->UpdateState(); |
| 551 } | 551 } |
| 552 } | 552 } |
| 553 | 553 |
| 554 void GpuCommandBufferStub::OnCreateVideoDecoder( | 554 void GpuCommandBufferStub::OnCreateVideoDecoder( |
| 555 media::VideoCodecProfile profile, | 555 media::VideoCodecProfile profile, |
| 556 const gfx::Size& frame_size, |
| 557 const std::vector<uint8_t>& extra_data, |
| 556 IPC::Message* reply_message) { | 558 IPC::Message* reply_message) { |
| 557 int decoder_route_id = channel_->GenerateRouteID(); | 559 int decoder_route_id = channel_->GenerateRouteID(); |
| 558 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams( | 560 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams( |
| 559 reply_message, decoder_route_id); | 561 reply_message, decoder_route_id); |
| 560 GpuVideoDecodeAccelerator* decoder = | 562 GpuVideoDecodeAccelerator* decoder = |
| 561 new GpuVideoDecodeAccelerator(this, decoder_route_id, this); | 563 new GpuVideoDecodeAccelerator(this, decoder_route_id, this); |
| 562 video_decoders_.AddWithID(decoder, decoder_route_id); | 564 video_decoders_.AddWithID(decoder, decoder_route_id); |
| 563 channel_->AddRoute(decoder_route_id, decoder); | 565 channel_->AddRoute(decoder_route_id, decoder); |
| 564 decoder->Initialize(profile, reply_message); | 566 decoder->Initialize(profile, frame_size, extra_data, reply_message); |
| 565 } | 567 } |
| 566 | 568 |
| 567 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) { | 569 void GpuCommandBufferStub::OnDestroyVideoDecoder(int decoder_route_id) { |
| 568 channel_->RemoveRoute(decoder_route_id); | 570 channel_->RemoveRoute(decoder_route_id); |
| 569 video_decoders_.Remove(decoder_route_id); | 571 video_decoders_.Remove(decoder_route_id); |
| 570 } | 572 } |
| 571 | 573 |
| 572 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { | 574 void GpuCommandBufferStub::OnSetSurfaceVisible(bool visible) { |
| 573 DCHECK(surface_state_.get()); | 575 DCHECK(surface_state_.get()); |
| 574 surface_state_->visible = visible; | 576 surface_state_->visible = visible; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 } | 658 } |
| 657 | 659 |
| 658 void GpuCommandBufferStub::SetMemoryAllocation( | 660 void GpuCommandBufferStub::SetMemoryAllocation( |
| 659 const GpuMemoryAllocation& allocation) { | 661 const GpuMemoryAllocation& allocation) { |
| 660 allocation_ = allocation; | 662 allocation_ = allocation; |
| 661 | 663 |
| 662 SendMemoryAllocationToProxy(allocation); | 664 SendMemoryAllocationToProxy(allocation); |
| 663 } | 665 } |
| 664 | 666 |
| 665 #endif // defined(ENABLE_GPU) | 667 #endif // defined(ENABLE_GPU) |
| OLD | NEW |