OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/compositor/gpu_process_transport_factory.h" | 5 #include "content/browser/compositor/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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 | 309 |
310 gfx::GLSurfaceHandle GpuProcessTransportFactory::GetSharedSurfaceHandle() { | 310 gfx::GLSurfaceHandle GpuProcessTransportFactory::GetSharedSurfaceHandle() { |
311 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( | 311 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( |
312 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); | 312 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); |
313 handle.parent_client_id = | 313 handle.parent_client_id = |
314 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); | 314 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); |
315 return handle; | 315 return handle; |
316 } | 316 } |
317 | 317 |
| 318 scoped_ptr<cc::SurfaceIdAllocator> |
| 319 GpuProcessTransportFactory::CreateSurfaceIdAllocator() { |
| 320 return make_scoped_ptr( |
| 321 new cc::SurfaceIdAllocator(next_surface_id_namespace_++)); |
| 322 } |
| 323 |
| 324 cc::SurfaceManager* GpuProcessTransportFactory::GetSurfaceManager() { |
| 325 return surface_manager_.get(); |
| 326 } |
| 327 |
318 GLHelper* GpuProcessTransportFactory::GetGLHelper() { | 328 GLHelper* GpuProcessTransportFactory::GetGLHelper() { |
319 if (!gl_helper_ && !per_compositor_data_.empty()) { | 329 if (!gl_helper_ && !per_compositor_data_.empty()) { |
320 scoped_refptr<cc::ContextProvider> provider = | 330 scoped_refptr<cc::ContextProvider> provider = |
321 SharedMainThreadContextProvider(); | 331 SharedMainThreadContextProvider(); |
322 if (provider.get()) | 332 if (provider.get()) |
323 gl_helper_.reset(new GLHelper(provider->ContextGL(), | 333 gl_helper_.reset(new GLHelper(provider->ContextGL(), |
324 provider->ContextSupport())); | 334 provider->ContextSupport())); |
325 } | 335 } |
326 return gl_helper_.get(); | 336 return gl_helper_.get(); |
327 } | 337 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 453 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
444 observer_list_, | 454 observer_list_, |
445 OnLostResources()); | 455 OnLostResources()); |
446 | 456 |
447 // Kill things that use the shared context before killing the shared context. | 457 // Kill things that use the shared context before killing the shared context. |
448 lost_gl_helper.reset(); | 458 lost_gl_helper.reset(); |
449 lost_shared_main_thread_contexts = NULL; | 459 lost_shared_main_thread_contexts = NULL; |
450 } | 460 } |
451 | 461 |
452 } // namespace content | 462 } // namespace content |
OLD | NEW |