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, |
74 CommandBufferProxyImpl* share_group, | 75 CommandBufferProxyImpl* share_group, |
75 int32_t stream_id, | 76 int32_t stream_id, |
76 gpu::GpuStreamPriority stream_priority, | 77 gpu::GpuStreamPriority stream_priority, |
77 const gpu::gles2::ContextCreationAttribHelper& attribs, | 78 const gpu::gles2::ContextCreationAttribHelper& attribs, |
78 const GURL& active_url, | 79 const GURL& active_url, |
| 80 gl::GpuPreference gpu_preference, |
79 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 81 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
80 DCHECK(!share_group || (stream_id == share_group->stream_id_)); | 82 DCHECK(!share_group || (stream_id == share_group->stream_id_)); |
81 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", | 83 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", |
82 "surface_handle", surface_handle); | 84 "surface_handle", surface_handle); |
83 | 85 |
84 GPUCreateCommandBufferConfig init_params; | 86 GPUCreateCommandBufferConfig init_params; |
85 init_params.surface_handle = surface_handle; | 87 init_params.surface_handle = surface_handle; |
| 88 init_params.size = size; |
86 init_params.share_group_id = | 89 init_params.share_group_id = |
87 share_group ? share_group->route_id_ : MSG_ROUTING_NONE; | 90 share_group ? share_group->route_id_ : MSG_ROUTING_NONE; |
88 init_params.stream_id = stream_id; | 91 init_params.stream_id = stream_id; |
89 init_params.stream_priority = stream_priority; | 92 init_params.stream_priority = stream_priority; |
90 init_params.attribs = attribs; | 93 init_params.attribs = attribs; |
91 init_params.active_url = active_url; | 94 init_params.active_url = active_url; |
| 95 init_params.gpu_preference = gpu_preference; |
92 | 96 |
93 int32_t route_id = host->GenerateRouteID(); | 97 int32_t route_id = host->GenerateRouteID(); |
94 std::unique_ptr<CommandBufferProxyImpl> command_buffer = base::WrapUnique( | 98 std::unique_ptr<CommandBufferProxyImpl> command_buffer = base::WrapUnique( |
95 new CommandBufferProxyImpl(host->channel_id(), route_id, stream_id)); | 99 new CommandBufferProxyImpl(host->channel_id(), route_id, stream_id)); |
96 if (!command_buffer->Initialize(std::move(host), std::move(init_params), | 100 if (!command_buffer->Initialize(std::move(host), std::move(init_params), |
97 std::move(task_runner))) | 101 std::move(task_runner))) |
98 return nullptr; | 102 return nullptr; |
99 | 103 |
100 return command_buffer; | 104 return command_buffer; |
101 } | 105 } |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
873 gpu_control_client_->OnGpuControlLostContext(); | 877 gpu_control_client_->OnGpuControlLostContext(); |
874 } | 878 } |
875 | 879 |
876 CommandBufferProxyImpl::ImageInfo::ImageInfo() {} | 880 CommandBufferProxyImpl::ImageInfo::ImageInfo() {} |
877 CommandBufferProxyImpl::ImageInfo::~ImageInfo() {} | 881 CommandBufferProxyImpl::ImageInfo::~ImageInfo() {} |
878 CommandBufferProxyImpl::ImageInfo::ImageInfo(ImageInfo&& other) = default; | 882 CommandBufferProxyImpl::ImageInfo::ImageInfo(ImageInfo&& other) = default; |
879 CommandBufferProxyImpl::ImageInfo& CommandBufferProxyImpl::ImageInfo::operator=( | 883 CommandBufferProxyImpl::ImageInfo& CommandBufferProxyImpl::ImageInfo::operator=( |
880 ImageInfo&& other) = default; | 884 ImageInfo&& other) = default; |
881 | 885 |
882 } // namespace gpu | 886 } // namespace gpu |
OLD | NEW |