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" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
15 #include "cc/output/compositor_frame.h" | 15 #include "cc/output/compositor_frame.h" |
16 #include "cc/output/output_surface.h" | 16 #include "cc/output/output_surface.h" |
17 #include "cc/surfaces/surface_manager.h" | 17 #include "cc/surfaces/surface_manager.h" |
18 #include "content/browser/compositor/browser_compositor_output_surface.h" | 18 #include "content/browser/compositor/browser_compositor_output_surface.h" |
19 #include "content/browser/compositor/browser_compositor_output_surface_proxy.h" | 19 #include "content/browser/compositor/browser_compositor_output_surface_proxy.h" |
20 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" | 20 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" |
21 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" | 21 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s
urface.h" |
22 #include "content/browser/compositor/onscreen_display_client.h" | 22 #include "content/browser/compositor/onscreen_display_client.h" |
23 #include "content/browser/compositor/reflector_impl.h" | 23 #include "content/browser/compositor/reflector_impl.h" |
24 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" | 24 #include "content/browser/compositor/software_browser_compositor_output_surface.
h" |
25 #include "content/browser/compositor/surface_display_output_surface.h" | 25 #include "content/browser/compositor/surface_display_output_surface.h" |
26 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 26 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 27 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
27 #include "content/browser/gpu/compositor_util.h" | 28 #include "content/browser/gpu/compositor_util.h" |
28 #include "content/browser/gpu/gpu_data_manager_impl.h" | 29 #include "content/browser/gpu/gpu_data_manager_impl.h" |
29 #include "content/browser/gpu/gpu_surface_tracker.h" | 30 #include "content/browser/gpu/gpu_surface_tracker.h" |
30 #include "content/browser/renderer_host/render_widget_host_impl.h" | 31 #include "content/browser/renderer_host/render_widget_host_impl.h" |
31 #include "content/common/gpu/client/context_provider_command_buffer.h" | 32 #include "content/common/gpu/client/context_provider_command_buffer.h" |
32 #include "content/common/gpu/client/gl_helper.h" | 33 #include "content/common/gpu/client/gl_helper.h" |
33 #include "content/common/gpu/client/gpu_channel_host.h" | 34 #include "content/common/gpu/client/gpu_channel_host.h" |
34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 35 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
35 #include "content/common/gpu/gpu_process_launch_causes.h" | 36 #include "content/common/gpu/gpu_process_launch_causes.h" |
36 #include "content/common/host_shared_bitmap_manager.h" | 37 #include "content/common/host_shared_bitmap_manager.h" |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 "GLHelper to be created."; | 304 "GLHelper to be created."; |
304 } | 305 } |
305 } | 306 } |
306 | 307 |
307 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } | 308 bool GpuProcessTransportFactory::DoesCreateTestContexts() { return false; } |
308 | 309 |
309 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() { | 310 cc::SharedBitmapManager* GpuProcessTransportFactory::GetSharedBitmapManager() { |
310 return HostSharedBitmapManager::current(); | 311 return HostSharedBitmapManager::current(); |
311 } | 312 } |
312 | 313 |
| 314 cc::GpuMemoryBufferManager* |
| 315 GpuProcessTransportFactory::GetGpuMemoryBufferManager() { |
| 316 return BrowserGpuMemoryBufferManager::current(); |
| 317 } |
| 318 |
313 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { | 319 ui::ContextFactory* GpuProcessTransportFactory::GetContextFactory() { |
314 return this; | 320 return this; |
315 } | 321 } |
316 | 322 |
317 base::MessageLoopProxy* GpuProcessTransportFactory::GetCompositorMessageLoop() { | 323 base::MessageLoopProxy* GpuProcessTransportFactory::GetCompositorMessageLoop() { |
318 if (!compositor_thread_) | 324 if (!compositor_thread_) |
319 return NULL; | 325 return NULL; |
320 return compositor_thread_->message_loop_proxy().get(); | 326 return compositor_thread_->message_loop_proxy().get(); |
321 } | 327 } |
322 | 328 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, | 472 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, |
467 observer_list_, | 473 observer_list_, |
468 OnLostResources()); | 474 OnLostResources()); |
469 | 475 |
470 // Kill things that use the shared context before killing the shared context. | 476 // Kill things that use the shared context before killing the shared context. |
471 lost_gl_helper.reset(); | 477 lost_gl_helper.reset(); |
472 lost_shared_main_thread_contexts = NULL; | 478 lost_shared_main_thread_contexts = NULL; |
473 } | 479 } |
474 | 480 |
475 } // namespace content | 481 } // namespace content |
OLD | NEW |