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/gpu_channel_host.h" | 5 #include "content/common/gpu/client/gpu_channel_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 init_params.share_group_id = | 231 init_params.share_group_id = |
232 share_group ? share_group->route_id() : MSG_ROUTING_NONE; | 232 share_group ? share_group->route_id() : MSG_ROUTING_NONE; |
233 init_params.stream_id = stream_id; | 233 init_params.stream_id = stream_id; |
234 init_params.stream_priority = stream_priority; | 234 init_params.stream_priority = stream_priority; |
235 init_params.attribs = attribs; | 235 init_params.attribs = attribs; |
236 init_params.active_url = active_url; | 236 init_params.active_url = active_url; |
237 init_params.gpu_preference = gpu_preference; | 237 init_params.gpu_preference = gpu_preference; |
238 | 238 |
239 int32 route_id = GenerateRouteID(); | 239 int32 route_id = GenerateRouteID(); |
240 | 240 |
| 241 scoped_ptr<CommandBufferProxyImpl> command_buffer = |
| 242 make_scoped_ptr(new CommandBufferProxyImpl(this, route_id, stream_id)); |
| 243 |
241 bool succeeded = false; | 244 bool succeeded = false; |
242 if (!Send(new GpuChannelMsg_CreateOffscreenCommandBuffer( | 245 if (!Send(new GpuChannelMsg_CreateOffscreenCommandBuffer( |
243 size, init_params, route_id, &succeeded))) { | 246 size, init_params, route_id, command_buffer->command_buffer_id(), |
| 247 &succeeded))) { |
244 LOG(ERROR) << "Failed to send GpuChannelMsg_CreateOffscreenCommandBuffer."; | 248 LOG(ERROR) << "Failed to send GpuChannelMsg_CreateOffscreenCommandBuffer."; |
245 return NULL; | 249 return NULL; |
246 } | 250 } |
247 | 251 |
248 if (!succeeded) { | 252 if (!succeeded) { |
249 LOG(ERROR) | 253 LOG(ERROR) |
250 << "GpuChannelMsg_CreateOffscreenCommandBuffer returned failure."; | 254 << "GpuChannelMsg_CreateOffscreenCommandBuffer returned failure."; |
251 return NULL; | 255 return NULL; |
252 } | 256 } |
253 | 257 |
254 scoped_ptr<CommandBufferProxyImpl> command_buffer = | |
255 make_scoped_ptr(new CommandBufferProxyImpl(this, route_id, stream_id)); | |
256 AddRoute(route_id, command_buffer->AsWeakPtr()); | 258 AddRoute(route_id, command_buffer->AsWeakPtr()); |
257 | 259 |
258 return command_buffer.Pass(); | 260 return command_buffer.Pass(); |
259 } | 261 } |
260 | 262 |
261 scoped_ptr<media::JpegDecodeAccelerator> GpuChannelHost::CreateJpegDecoder( | 263 scoped_ptr<media::JpegDecodeAccelerator> GpuChannelHost::CreateJpegDecoder( |
262 media::JpegDecodeAccelerator::Client* client) { | 264 media::JpegDecodeAccelerator::Client* client) { |
263 TRACE_EVENT0("gpu", "GpuChannelHost::CreateJpegDecoder"); | 265 TRACE_EVENT0("gpu", "GpuChannelHost::CreateJpegDecoder"); |
264 | 266 |
265 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 267 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 | 463 |
462 listeners_.clear(); | 464 listeners_.clear(); |
463 } | 465 } |
464 | 466 |
465 bool GpuChannelHost::MessageFilter::IsLost() const { | 467 bool GpuChannelHost::MessageFilter::IsLost() const { |
466 AutoLock lock(lock_); | 468 AutoLock lock(lock_); |
467 return lost_; | 469 return lost_; |
468 } | 470 } |
469 | 471 |
470 } // namespace content | 472 } // namespace content |
OLD | NEW |