OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/android/synchronous_compositor_base.h" | 5 #include "content/browser/android/synchronous_compositor_base.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/supports_user_data.h" | 8 #include "base/supports_user_data.h" |
9 #include "content/browser/android/in_process/synchronous_compositor_factory_impl
.h" | 9 #include "content/browser/android/in_process/synchronous_compositor_factory_impl
.h" |
10 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | 10 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
11 #include "content/browser/android/synchronous_compositor_host.h" | 11 #include "content/browser/android/synchronous_compositor_host.h" |
12 #include "content/browser/gpu/gpu_process_host.h" | 12 #include "content/browser/gpu/gpu_process_host.h" |
13 #include "content/browser/web_contents/web_contents_android.h" | 13 #include "content/browser/web_contents/web_contents_android.h" |
14 #include "content/browser/web_contents/web_contents_impl.h" | 14 #include "content/browser/web_contents/web_contents_impl.h" |
15 #include "content/gpu/in_process_gpu_thread.h" | 15 #include "content/gpu/in_process_gpu_thread.h" |
16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class SynchronousCompositorClient; | 20 class SynchronousCompositorClient; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 base::LazyInstance<scoped_refptr<gpu::InProcessCommandBuffer::Service>> | 24 base::LazyInstance<scoped_refptr<gpu::InProcessCommandBuffer::Service>> |
25 g_gpu_service = LAZY_INSTANCE_INITIALIZER; | 25 g_gpu_service = LAZY_INSTANCE_INITIALIZER; |
26 | 26 |
27 base::Thread* CreateInProcessGpuThreadForSynchronousCompositor( | 27 base::Thread* CreateInProcessGpuThreadForSynchronousCompositor( |
28 const InProcessChildThreadParams& params) { | 28 const InProcessChildThreadParams& params, |
| 29 const gpu::GpuPreferences& gpu_preferences) { |
29 DCHECK(g_gpu_service.Get()); | 30 DCHECK(g_gpu_service.Get()); |
30 return new InProcessGpuThread(params, | 31 return new InProcessGpuThread(params, gpu_preferences, |
31 g_gpu_service.Get()->gpu_preferences(), | |
32 g_gpu_service.Get()->sync_point_manager()); | 32 g_gpu_service.Get()->sync_point_manager()); |
33 } | 33 } |
34 | 34 |
35 } // namespace | 35 } // namespace |
36 | 36 |
37 void SynchronousCompositor::SetGpuService( | 37 void SynchronousCompositor::SetGpuService( |
38 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { | 38 scoped_refptr<gpu::InProcessCommandBuffer::Service> service) { |
39 DCHECK(!g_gpu_service.Get()); | 39 DCHECK(!g_gpu_service.Get()); |
40 g_gpu_service.Get() = service; | 40 g_gpu_service.Get() = service; |
41 GpuProcessHost::RegisterGpuMainThreadFactory( | 41 GpuProcessHost::RegisterGpuMainThreadFactory( |
(...skipping 28 matching lines...) Expand all Loading... |
70 command_line->HasSwitch(switches::kSingleProcess); | 70 command_line->HasSwitch(switches::kSingleProcess); |
71 return make_scoped_ptr(new SynchronousCompositorHost( | 71 return make_scoped_ptr(new SynchronousCompositorHost( |
72 rwhva, web_contents_android->synchronous_compositor_client(), | 72 rwhva, web_contents_android->synchronous_compositor_client(), |
73 use_in_proc_software_draw)); | 73 use_in_proc_software_draw)); |
74 } | 74 } |
75 return make_scoped_ptr(new SynchronousCompositorImpl( | 75 return make_scoped_ptr(new SynchronousCompositorImpl( |
76 rwhva, web_contents_android->synchronous_compositor_client())); | 76 rwhva, web_contents_android->synchronous_compositor_client())); |
77 } | 77 } |
78 | 78 |
79 } // namespace content | 79 } // namespace content |
OLD | NEW |