OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/browser/aura/gpu_process_transport_factory.h" | 5 #include "content/browser/aura/gpu_process_transport_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 if (per_compositor_data_.empty()) | 277 if (per_compositor_data_.empty()) |
278 gl_helper_.reset(); | 278 gl_helper_.reset(); |
279 } | 279 } |
280 | 280 |
281 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } | 281 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } |
282 | 282 |
283 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { | 283 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { |
284 return this; | 284 return this; |
285 } | 285 } |
286 | 286 |
287 gfx::GLSurfaceHandle GpuProcessTransportFactory::CreateSharedSurfaceHandle() { | 287 gfx::GLSurfaceHandle GpuProcessTransportFactory::GetSharedSurfaceHandle() { |
288 scoped_refptr<cc::ContextProvider> provider = | |
289 SharedMainThreadContextProvider(); | |
290 if (!provider.get()) | |
291 return gfx::GLSurfaceHandle(); | |
292 typedef WebGraphicsContext3DCommandBufferImpl WGC3DCBI; | |
293 WGC3DCBI* context = static_cast<WGC3DCBI*>(provider->Context3d()); | |
294 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( | 288 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( |
295 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); | 289 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); |
296 handle.parent_gpu_process_id = context->GetGPUProcessID(); | |
297 handle.parent_client_id = | 290 handle.parent_client_id = |
298 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); | 291 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); |
299 return handle; | 292 return handle; |
300 } | 293 } |
301 | 294 |
302 void GpuProcessTransportFactory::DestroySharedSurfaceHandle( | |
303 gfx::GLSurfaceHandle surface) {} | |
304 | |
305 scoped_refptr<ui::Texture> GpuProcessTransportFactory::CreateTransportClient( | 295 scoped_refptr<ui::Texture> GpuProcessTransportFactory::CreateTransportClient( |
306 float device_scale_factor) { | 296 float device_scale_factor) { |
307 scoped_refptr<cc::ContextProvider> provider = | 297 scoped_refptr<cc::ContextProvider> provider = |
308 SharedMainThreadContextProvider(); | 298 SharedMainThreadContextProvider(); |
309 if (!provider.get()) | 299 if (!provider.get()) |
310 return NULL; | 300 return NULL; |
311 scoped_refptr<ImageTransportClientTexture> image( | 301 scoped_refptr<ImageTransportClientTexture> image( |
312 new ImageTransportClientTexture( | 302 new ImageTransportClientTexture( |
313 provider->Context3d(), device_scale_factor)); | 303 provider->Context3d(), device_scale_factor)); |
314 return image; | 304 return image; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 observer_list_, | 481 observer_list_, |
492 OnLostResources()); | 482 OnLostResources()); |
493 | 483 |
494 // Kill things that use the shared context before killing the shared context. | 484 // Kill things that use the shared context before killing the shared context. |
495 lost_gl_helper.reset(); | 485 lost_gl_helper.reset(); |
496 lost_offscreen_compositor_contexts = NULL; | 486 lost_offscreen_compositor_contexts = NULL; |
497 lost_shared_main_thread_contexts = NULL; | 487 lost_shared_main_thread_contexts = NULL; |
498 } | 488 } |
499 | 489 |
500 } // namespace content | 490 } // namespace content |
OLD | NEW |