OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/renderer/gpu/gpu_channel_host.h" | 5 #include "content/renderer/gpu/gpu_channel_host.h" |
6 | 6 |
7 #include "base/message_loop_proxy.h" | 7 #include "base/message_loop_proxy.h" |
8 #include "content/common/child_process.h" | 8 #include "content/common/child_process.h" |
9 #include "content/common/gpu/gpu_messages.h" | 9 #include "content/common/gpu/gpu_messages.h" |
10 #include "content/renderer/gpu/command_buffer_proxy.h" | 10 #include "content/renderer/gpu/command_buffer_proxy.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 AddRoute(route_id, command_buffer->AsWeakPtr()); | 231 AddRoute(route_id, command_buffer->AsWeakPtr()); |
232 proxies_[route_id] = command_buffer; | 232 proxies_[route_id] = command_buffer; |
233 return command_buffer; | 233 return command_buffer; |
234 #else | 234 #else |
235 return NULL; | 235 return NULL; |
236 #endif | 236 #endif |
237 } | 237 } |
238 | 238 |
239 GpuVideoDecodeAcceleratorHost* GpuChannelHost::CreateVideoDecoder( | 239 GpuVideoDecodeAcceleratorHost* GpuChannelHost::CreateVideoDecoder( |
240 int command_buffer_route_id, | 240 int command_buffer_route_id, |
241 const std::vector<int32>& configs, | 241 media::VideoDecodeAccelerator::Profile profile, |
242 media::VideoDecodeAccelerator::Client* client) { | 242 media::VideoDecodeAccelerator::Client* client) { |
243 AutoLock lock(context_lock_); | 243 AutoLock lock(context_lock_); |
244 ProxyMap::iterator it = proxies_.find(command_buffer_route_id); | 244 ProxyMap::iterator it = proxies_.find(command_buffer_route_id); |
245 DCHECK(it != proxies_.end()); | 245 DCHECK(it != proxies_.end()); |
246 CommandBufferProxy* proxy = it->second; | 246 CommandBufferProxy* proxy = it->second; |
247 return proxy->CreateVideoDecoder(configs, client); | 247 return proxy->CreateVideoDecoder(profile, client); |
248 } | 248 } |
249 | 249 |
250 CommandBufferProxy* GpuChannelHost::CreateOffscreenCommandBuffer( | 250 CommandBufferProxy* GpuChannelHost::CreateOffscreenCommandBuffer( |
251 const gfx::Size& size, | 251 const gfx::Size& size, |
252 CommandBufferProxy* share_group, | 252 CommandBufferProxy* share_group, |
253 const std::string& allowed_extensions, | 253 const std::string& allowed_extensions, |
254 const std::vector<int32>& attribs, | 254 const std::vector<int32>& attribs, |
255 const GURL& active_url) { | 255 const GURL& active_url) { |
256 #if defined(ENABLE_GPU) | 256 #if defined(ENABLE_GPU) |
257 AutoLock lock(context_lock_); | 257 AutoLock lock(context_lock_); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 } | 336 } |
337 | 337 |
338 void GpuChannelHost::RemoveRoute(int route_id) { | 338 void GpuChannelHost::RemoveRoute(int route_id) { |
339 MessageLoopProxy* io_loop = RenderProcess::current()->io_message_loop_proxy(); | 339 MessageLoopProxy* io_loop = RenderProcess::current()->io_message_loop_proxy(); |
340 io_loop->PostTask(FROM_HERE, | 340 io_loop->PostTask(FROM_HERE, |
341 NewRunnableMethod( | 341 NewRunnableMethod( |
342 channel_filter_.get(), | 342 channel_filter_.get(), |
343 &GpuChannelHost::MessageFilter::RemoveRoute, | 343 &GpuChannelHost::MessageFilter::RemoveRoute, |
344 route_id)); | 344 route_id)); |
345 } | 345 } |
OLD | NEW |