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 "gpu/ipc/client/command_buffer_proxy_impl.h" | 5 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 weak_this_(AsWeakPtr()), | 64 weak_this_(AsWeakPtr()), |
65 callback_thread_(base::ThreadTaskRunnerHandle::Get()) { | 65 callback_thread_(base::ThreadTaskRunnerHandle::Get()) { |
66 DCHECK(route_id); | 66 DCHECK(route_id); |
67 DCHECK_NE(stream_id, GPU_STREAM_INVALID); | 67 DCHECK_NE(stream_id, GPU_STREAM_INVALID); |
68 } | 68 } |
69 | 69 |
70 // static | 70 // static |
71 std::unique_ptr<CommandBufferProxyImpl> CommandBufferProxyImpl::Create( | 71 std::unique_ptr<CommandBufferProxyImpl> CommandBufferProxyImpl::Create( |
72 scoped_refptr<GpuChannelHost> host, | 72 scoped_refptr<GpuChannelHost> host, |
73 gpu::SurfaceHandle surface_handle, | 73 gpu::SurfaceHandle surface_handle, |
74 const gfx::Size& size, | |
75 CommandBufferProxyImpl* share_group, | 74 CommandBufferProxyImpl* share_group, |
76 int32_t stream_id, | 75 int32_t stream_id, |
77 gpu::GpuStreamPriority stream_priority, | 76 gpu::GpuStreamPriority stream_priority, |
78 const gpu::gles2::ContextCreationAttribHelper& attribs, | 77 const gpu::gles2::ContextCreationAttribHelper& attribs, |
79 const GURL& active_url, | 78 const GURL& active_url, |
80 gl::GpuPreference gpu_preference, | |
81 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 79 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
82 DCHECK(!share_group || (stream_id == share_group->stream_id_)); | 80 DCHECK(!share_group || (stream_id == share_group->stream_id_)); |
83 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", | 81 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", |
84 "surface_handle", surface_handle); | 82 "surface_handle", surface_handle); |
85 | 83 |
86 GPUCreateCommandBufferConfig init_params; | 84 GPUCreateCommandBufferConfig init_params; |
87 init_params.surface_handle = surface_handle; | 85 init_params.surface_handle = surface_handle; |
88 init_params.size = size; | |
89 init_params.share_group_id = | 86 init_params.share_group_id = |
90 share_group ? share_group->route_id_ : MSG_ROUTING_NONE; | 87 share_group ? share_group->route_id_ : MSG_ROUTING_NONE; |
91 init_params.stream_id = stream_id; | 88 init_params.stream_id = stream_id; |
92 init_params.stream_priority = stream_priority; | 89 init_params.stream_priority = stream_priority; |
93 init_params.attribs = attribs; | 90 init_params.attribs = attribs; |
94 init_params.active_url = active_url; | 91 init_params.active_url = active_url; |
95 init_params.gpu_preference = gpu_preference; | |
96 | 92 |
97 int32_t route_id = host->GenerateRouteID(); | 93 int32_t route_id = host->GenerateRouteID(); |
98 std::unique_ptr<CommandBufferProxyImpl> command_buffer = base::WrapUnique( | 94 std::unique_ptr<CommandBufferProxyImpl> command_buffer = base::WrapUnique( |
99 new CommandBufferProxyImpl(host->channel_id(), route_id, stream_id)); | 95 new CommandBufferProxyImpl(host->channel_id(), route_id, stream_id)); |
100 if (!command_buffer->Initialize(std::move(host), std::move(init_params), | 96 if (!command_buffer->Initialize(std::move(host), std::move(init_params), |
101 std::move(task_runner))) | 97 std::move(task_runner))) |
102 return nullptr; | 98 return nullptr; |
103 | 99 |
104 return command_buffer; | 100 return command_buffer; |
105 } | 101 } |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 gpu_control_client_->OnGpuControlLostContext(); | 873 gpu_control_client_->OnGpuControlLostContext(); |
878 } | 874 } |
879 | 875 |
880 CommandBufferProxyImpl::ImageInfo::ImageInfo() {} | 876 CommandBufferProxyImpl::ImageInfo::ImageInfo() {} |
881 CommandBufferProxyImpl::ImageInfo::~ImageInfo() {} | 877 CommandBufferProxyImpl::ImageInfo::~ImageInfo() {} |
882 CommandBufferProxyImpl::ImageInfo::ImageInfo(ImageInfo&& other) = default; | 878 CommandBufferProxyImpl::ImageInfo::ImageInfo(ImageInfo&& other) = default; |
883 CommandBufferProxyImpl::ImageInfo& CommandBufferProxyImpl::ImageInfo::operator=( | 879 CommandBufferProxyImpl::ImageInfo& CommandBufferProxyImpl::ImageInfo::operator=( |
884 ImageInfo&& other) = default; | 880 ImageInfo&& other) = default; |
885 | 881 |
886 } // namespace gpu | 882 } // namespace gpu |
OLD | NEW |