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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 gl_helper_.reset(); | 287 gl_helper_.reset(); |
288 } | 288 } |
289 | 289 |
290 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } | 290 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } |
291 | 291 |
292 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { | 292 ui::ContextFactory* GpuProcessTransportFactory::AsContextFactory() { |
293 return this; | 293 return this; |
294 } | 294 } |
295 | 295 |
296 gfx::GLSurfaceHandle GpuProcessTransportFactory::GetSharedSurfaceHandle() { | 296 gfx::GLSurfaceHandle GpuProcessTransportFactory::GetSharedSurfaceHandle() { |
297 // TODO(sievers): crbug.com/329737 | |
298 // Creating the context here hurts startup performance. | |
299 // Remove this once all tests are happy. | |
300 SharedMainThreadContextProvider(); | |
301 | |
302 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( | 297 gfx::GLSurfaceHandle handle = gfx::GLSurfaceHandle( |
303 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); | 298 gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); |
304 handle.parent_client_id = | 299 handle.parent_client_id = |
305 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); | 300 BrowserGpuChannelHostFactory::instance()->GetGpuChannelId(); |
306 return handle; | 301 return handle; |
307 } | 302 } |
308 | 303 |
309 scoped_refptr<ui::Texture> GpuProcessTransportFactory::CreateTransportClient( | 304 scoped_refptr<ui::Texture> GpuProcessTransportFactory::CreateTransportClient( |
310 float device_scale_factor) { | 305 float device_scale_factor) { |
311 scoped_refptr<cc::ContextProvider> provider = | 306 scoped_refptr<cc::ContextProvider> provider = |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 observer_list_, | 472 observer_list_, |
478 OnLostResources()); | 473 OnLostResources()); |
479 | 474 |
480 // Kill things that use the shared context before killing the shared context. | 475 // Kill things that use the shared context before killing the shared context. |
481 lost_gl_helper.reset(); | 476 lost_gl_helper.reset(); |
482 lost_offscreen_compositor_contexts = NULL; | 477 lost_offscreen_compositor_contexts = NULL; |
483 lost_shared_main_thread_contexts = NULL; | 478 lost_shared_main_thread_contexts = NULL; |
484 } | 479 } |
485 | 480 |
486 } // namespace content | 481 } // namespace content |
OLD | NEW |