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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
14 #include "content/common/child_process_messages.h" | 14 #include "content/common/child_process_messages.h" |
15 #include "content/common/gpu/client/gpu_channel_host.h" | 15 #include "content/common/gpu/client/gpu_channel_host.h" |
16 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" | 16 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" |
17 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h" | 17 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h" |
18 #include "content/common/gpu/gpu_messages.h" | 18 #include "content/common/gpu/gpu_messages.h" |
19 #include "content/common/view_messages.h" | 19 #include "content/common/view_messages.h" |
20 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" | 20 #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h" |
21 #include "gpu/command_buffer/common/cmd_buffer_common.h" | 21 #include "gpu/command_buffer/common/cmd_buffer_common.h" |
22 #include "gpu/command_buffer/common/command_buffer_shared.h" | 22 #include "gpu/command_buffer/common/command_buffer_shared.h" |
23 #include "gpu/command_buffer/common/gpu_memory_allocation.h" | 23 #include "gpu/command_buffer/common/gpu_memory_allocation.h" |
24 #include "gpu/command_buffer/service/image_factory.h" | 24 #include "gpu/command_buffer/service/image_factory.h" |
25 #include "ui/gfx/geometry/size.h" | 25 #include "ui/gfx/geometry/size.h" |
26 #include "ui/gl/gl_bindings.h" | 26 #include "ui/gl/gl_bindings.h" |
27 | 27 |
28 namespace content { | 28 namespace content { |
29 | 29 |
| 30 uint64_t CommandBufferProxyID(int channel_id, int32 route_id) { |
| 31 return (static_cast<uint64_t>(channel_id) << 32) | route_id; |
| 32 } |
| 33 |
30 CommandBufferProxyImpl::CommandBufferProxyImpl(GpuChannelHost* channel, | 34 CommandBufferProxyImpl::CommandBufferProxyImpl(GpuChannelHost* channel, |
31 int32 route_id, | 35 int32 route_id, |
32 int32 stream_id) | 36 int32 stream_id) |
33 : lock_(nullptr), | 37 : CommandBuffer(gpu::kCommandBufferNamespace_GpuIO, |
| 38 CommandBufferProxyID(channel->channel_id(), route_id)), |
| 39 lock_(nullptr), |
34 channel_(channel), | 40 channel_(channel), |
35 route_id_(route_id), | 41 route_id_(route_id), |
36 stream_id_(stream_id), | 42 stream_id_(stream_id), |
37 flush_count_(0), | 43 flush_count_(0), |
38 last_put_offset_(-1), | 44 last_put_offset_(-1), |
39 last_barrier_put_offset_(-1), | 45 last_barrier_put_offset_(-1), |
40 next_signal_id_(0) { | 46 next_signal_id_(0) { |
41 DCHECK(channel); | 47 DCHECK(channel); |
42 } | 48 } |
43 | 49 |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 } | 646 } |
641 } | 647 } |
642 | 648 |
643 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, | 649 void CommandBufferProxyImpl::OnUpdateVSyncParameters(base::TimeTicks timebase, |
644 base::TimeDelta interval) { | 650 base::TimeDelta interval) { |
645 if (!update_vsync_parameters_completion_callback_.is_null()) | 651 if (!update_vsync_parameters_completion_callback_.is_null()) |
646 update_vsync_parameters_completion_callback_.Run(timebase, interval); | 652 update_vsync_parameters_completion_callback_.Run(timebase, interval); |
647 } | 653 } |
648 | 654 |
649 } // namespace content | 655 } // namespace content |
OLD | NEW |