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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 return result; | 395 return result; |
396 } | 396 } |
397 | 397 |
398 void CommandBufferProxy::SetNotifyRepaintTask(Task* task) { | 398 void CommandBufferProxy::SetNotifyRepaintTask(Task* task) { |
399 notify_repaint_task_.reset(task); | 399 notify_repaint_task_.reset(task); |
400 } | 400 } |
401 | 401 |
402 scoped_refptr<GpuVideoDecodeAcceleratorHost> | 402 scoped_refptr<GpuVideoDecodeAcceleratorHost> |
403 CommandBufferProxy::CreateVideoDecoder( | 403 CommandBufferProxy::CreateVideoDecoder( |
404 const std::vector<int32>& configs, | 404 media::VideoDecodeAccelerator::Profile profile, |
405 media::VideoDecodeAccelerator::Client* client) { | 405 media::VideoDecodeAccelerator::Client* client) { |
406 int decoder_route_id; | 406 int decoder_route_id; |
407 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, configs, | 407 if (!Send(new GpuCommandBufferMsg_CreateVideoDecoder(route_id_, profile, |
408 &decoder_route_id))) { | 408 &decoder_route_id))) { |
409 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; | 409 LOG(ERROR) << "Send(GpuChannelMsg_CreateVideoDecoder) failed"; |
410 return NULL; | 410 return NULL; |
411 } | 411 } |
412 | 412 |
413 scoped_refptr<GpuVideoDecodeAcceleratorHost> decoder_host = | 413 scoped_refptr<GpuVideoDecodeAcceleratorHost> decoder_host = |
414 new GpuVideoDecodeAcceleratorHost(channel_, decoder_route_id, client); | 414 new GpuVideoDecodeAcceleratorHost(channel_, decoder_route_id, client); |
415 bool inserted = video_decoder_hosts_.insert(std::make_pair( | 415 bool inserted = video_decoder_hosts_.insert(std::make_pair( |
416 decoder_route_id, decoder_host)).second; | 416 decoder_route_id, decoder_host)).second; |
417 DCHECK(inserted); | 417 DCHECK(inserted); |
(...skipping 24 matching lines...) Expand all Loading... |
442 delete msg; | 442 delete msg; |
443 return false; | 443 return false; |
444 } | 444 } |
445 | 445 |
446 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { | 446 void CommandBufferProxy::OnUpdateState(const gpu::CommandBuffer::State& state) { |
447 // Handle wraparound. It works as long as we don't have more than 2B state | 447 // Handle wraparound. It works as long as we don't have more than 2B state |
448 // updates in flight across which reordering occurs. | 448 // updates in flight across which reordering occurs. |
449 if (state.generation - last_state_.generation < 0x80000000U) | 449 if (state.generation - last_state_.generation < 0x80000000U) |
450 last_state_ = state; | 450 last_state_ = state; |
451 } | 451 } |
OLD | NEW |