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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 | 386 |
387 Send(new GpuCommandBufferMsg_ResizeOffscreenFrameBuffer(route_id_, size)); | 387 Send(new GpuCommandBufferMsg_ResizeOffscreenFrameBuffer(route_id_, size)); |
388 } | 388 } |
389 | 389 |
390 void CommandBufferProxy::SetNotifyRepaintTask(Task* task) { | 390 void CommandBufferProxy::SetNotifyRepaintTask(Task* task) { |
391 notify_repaint_task_.reset(task); | 391 notify_repaint_task_.reset(task); |
392 } | 392 } |
393 | 393 |
394 scoped_refptr<GpuVideoDecodeAcceleratorHost> | 394 scoped_refptr<GpuVideoDecodeAcceleratorHost> |
395 CommandBufferProxy::CreateVideoDecoder( | 395 CommandBufferProxy::CreateVideoDecoder( |
396 const std::vector<uint32>& configs, | 396 const std::vector<int32>& configs, |
397 media::VideoDecodeAccelerator::Client* client) { | 397 media::VideoDecodeAccelerator::Client* client) { |
398 video_decoder_host_ = new GpuVideoDecodeAcceleratorHost( | 398 video_decoder_host_ = new GpuVideoDecodeAcceleratorHost( |
399 channel_, route_id_, client); | 399 channel_, route_id_, client); |
400 | 400 |
401 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, configs))) { | 401 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, configs))) { |
402 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; | 402 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; |
403 video_decoder_host_ = NULL; | 403 video_decoder_host_ = NULL; |
404 } | 404 } |
405 | 405 |
406 return video_decoder_host_; | 406 return video_decoder_host_; |
(...skipping 29 matching lines...) Expand all Loading... |
436 delete msg; | 436 delete msg; |
437 return false; | 437 return false; |
438 } | 438 } |
439 | 439 |
440 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { | 440 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { |
441 // Handle wraparound. It works as long as we don't have more than 2B state | 441 // Handle wraparound. It works as long as we don't have more than 2B state |
442 // updates in flight across which reordering occurs. | 442 // updates in flight across which reordering occurs. |
443 if (state.generation - last_state_.generation < 0x80000000U) | 443 if (state.generation - last_state_.generation < 0x80000000U) |
444 last_state_ = state; | 444 last_state_ = state; |
445 } | 445 } |
OLD | NEW |