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 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 | 407 |
408 Send(new GpuCommandBufferMsg_ResizeOffscreenFrameBuffer(route_id_, size)); | 408 Send(new GpuCommandBufferMsg_ResizeOffscreenFrameBuffer(route_id_, size)); |
409 } | 409 } |
410 | 410 |
411 void CommandBufferProxy::SetNotifyRepaintTask(Task* task) { | 411 void CommandBufferProxy::SetNotifyRepaintTask(Task* task) { |
412 notify_repaint_task_.reset(task); | 412 notify_repaint_task_.reset(task); |
413 } | 413 } |
414 | 414 |
415 scoped_refptr<GpuVideoDecodeAcceleratorHost> | 415 scoped_refptr<GpuVideoDecodeAcceleratorHost> |
416 CommandBufferProxy::CreateVideoDecoder( | 416 CommandBufferProxy::CreateVideoDecoder( |
417 const std::vector<uint32>& configs, | 417 const std::vector<int32>& configs, |
418 media::VideoDecodeAccelerator::Client* client) { | 418 media::VideoDecodeAccelerator::Client* client) { |
419 video_decoder_host_ = new GpuVideoDecodeAcceleratorHost( | 419 video_decoder_host_ = new GpuVideoDecodeAcceleratorHost( |
420 channel_, route_id_, client); | 420 channel_, route_id_, client); |
421 | 421 |
422 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, configs))) { | 422 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, configs))) { |
423 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; | 423 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; |
424 video_decoder_host_ = NULL; | 424 video_decoder_host_ = NULL; |
425 } | 425 } |
426 | 426 |
427 return video_decoder_host_; | 427 return video_decoder_host_; |
(...skipping 29 matching lines...) Expand all Loading... |
457 delete msg; | 457 delete msg; |
458 return false; | 458 return false; |
459 } | 459 } |
460 | 460 |
461 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { | 461 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { |
462 // Handle wraparound. It works as long as we don't have more than 2B state | 462 // Handle wraparound. It works as long as we don't have more than 2B state |
463 // updates in flight across which reordering occurs. | 463 // updates in flight across which reordering occurs. |
464 if (state.generation - last_state_.generation < 0x80000000U) | 464 if (state.generation - last_state_.generation < 0x80000000U) |
465 last_state_ = state; | 465 last_state_ = state; |
466 } | 466 } |
OLD | NEW |