Chromium Code Reviews| 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/gpu_channel_host.h" | 5 #include "gpu/ipc/client/gpu_channel_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 } | 190 } |
| 191 | 191 |
| 192 std::unique_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer( | 192 std::unique_ptr<CommandBufferProxyImpl> GpuChannelHost::CreateCommandBuffer( |
| 193 gpu::SurfaceHandle surface_handle, | 193 gpu::SurfaceHandle surface_handle, |
| 194 const gfx::Size& size, | 194 const gfx::Size& size, |
| 195 CommandBufferProxyImpl* share_group, | 195 CommandBufferProxyImpl* share_group, |
| 196 int32_t stream_id, | 196 int32_t stream_id, |
| 197 gpu::GpuStreamPriority stream_priority, | 197 gpu::GpuStreamPriority stream_priority, |
| 198 const std::vector<int32_t>& attribs, | 198 const std::vector<int32_t>& attribs, |
| 199 const GURL& active_url, | 199 const GURL& active_url, |
| 200 gfx::GpuPreference gpu_preference) { | 200 gfx::GpuPreference gpu_preference, |
| 201 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | |
| 201 DCHECK(!share_group || (stream_id == share_group->stream_id())); | 202 DCHECK(!share_group || (stream_id == share_group->stream_id())); |
| 202 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", | 203 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", |
| 203 "surface_handle", surface_handle); | 204 "surface_handle", surface_handle); |
| 204 | 205 |
| 205 GPUCreateCommandBufferConfig init_params; | 206 GPUCreateCommandBufferConfig init_params; |
| 206 init_params.share_group_id = | 207 init_params.share_group_id = |
| 207 share_group ? share_group->route_id() : MSG_ROUTING_NONE; | 208 share_group ? share_group->route_id() : MSG_ROUTING_NONE; |
| 208 init_params.stream_id = stream_id; | 209 init_params.stream_id = stream_id; |
| 209 init_params.stream_priority = stream_priority; | 210 init_params.stream_priority = stream_priority; |
| 210 init_params.attribs = attribs; | 211 init_params.attribs = attribs; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 230 return nullptr; | 231 return nullptr; |
| 231 } | 232 } |
| 232 | 233 |
| 233 if (!succeeded) { | 234 if (!succeeded) { |
| 234 LOG(ERROR) << "GpuChannelMsg_CreateCommandBuffer returned failure."; | 235 LOG(ERROR) << "GpuChannelMsg_CreateCommandBuffer returned failure."; |
| 235 return nullptr; | 236 return nullptr; |
| 236 } | 237 } |
| 237 | 238 |
| 238 std::unique_ptr<CommandBufferProxyImpl> command_buffer = | 239 std::unique_ptr<CommandBufferProxyImpl> command_buffer = |
| 239 base::WrapUnique(new CommandBufferProxyImpl(this, route_id, stream_id)); | 240 base::WrapUnique(new CommandBufferProxyImpl(this, route_id, stream_id)); |
| 240 AddRoute(route_id, command_buffer->AsWeakPtr()); | 241 AddRouteWithTaskRunner(route_id, command_buffer->AsWeakPtr(), task_runner); |
|
piman
2016/05/11 17:06:14
nit: std::move(task_runner)
| |
| 241 if (!command_buffer->Initialize()) | 242 if (!command_buffer->Initialize()) |
| 242 return nullptr; | 243 return nullptr; |
| 243 | 244 |
| 244 return command_buffer; | 245 return command_buffer; |
| 245 } | 246 } |
| 246 | 247 |
| 247 void GpuChannelHost::DestroyCommandBuffer( | 248 void GpuChannelHost::DestroyCommandBuffer( |
| 248 CommandBufferProxyImpl* command_buffer) { | 249 CommandBufferProxyImpl* command_buffer) { |
| 249 TRACE_EVENT0("gpu", "GpuChannelHost::DestroyCommandBuffer"); | 250 TRACE_EVENT0("gpu", "GpuChannelHost::DestroyCommandBuffer"); |
| 250 | 251 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 472 | 473 |
| 473 listeners_.clear(); | 474 listeners_.clear(); |
| 474 } | 475 } |
| 475 | 476 |
| 476 bool GpuChannelHost::MessageFilter::IsLost() const { | 477 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 477 AutoLock lock(lock_); | 478 AutoLock lock(lock_); |
| 478 return lost_; | 479 return lost_; |
| 479 } | 480 } |
| 480 | 481 |
| 481 } // namespace gpu | 482 } // namespace gpu |
| OLD | NEW |