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/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
10 #include "content/browser/android/in_process/synchronous_compositor_impl.h" | |
11 #include "content/browser/android/synchronous_compositor_host.h" | 10 #include "content/browser/android/synchronous_compositor_host.h" |
12 #include "content/browser/gpu/gpu_process_host.h" | 11 #include "content/browser/gpu/gpu_process_host.h" |
13 #include "content/browser/web_contents/web_contents_android.h" | 12 #include "content/browser/web_contents/web_contents_android.h" |
14 #include "content/browser/web_contents/web_contents_impl.h" | 13 #include "content/browser/web_contents/web_contents_impl.h" |
15 #include "content/gpu/in_process_gpu_thread.h" | 14 #include "content/gpu/in_process_gpu_thread.h" |
16 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
17 | 16 |
18 namespace content { | 17 namespace content { |
19 | 18 |
20 class SynchronousCompositorClient; | 19 class SynchronousCompositorClient; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 std::unique_ptr<SynchronousCompositorBase> SynchronousCompositorBase::Create( | 57 std::unique_ptr<SynchronousCompositorBase> SynchronousCompositorBase::Create( |
59 RenderWidgetHostViewAndroid* rwhva, | 58 RenderWidgetHostViewAndroid* rwhva, |
60 WebContents* web_contents) { | 59 WebContents* web_contents) { |
61 DCHECK(web_contents); | 60 DCHECK(web_contents); |
62 WebContentsAndroid* web_contents_android = | 61 WebContentsAndroid* web_contents_android = |
63 static_cast<WebContentsImpl*>(web_contents)->GetWebContentsAndroid(); | 62 static_cast<WebContentsImpl*>(web_contents)->GetWebContentsAndroid(); |
64 if (!web_contents_android->synchronous_compositor_client()) | 63 if (!web_contents_android->synchronous_compositor_client()) |
65 return nullptr; // Not using sync compositing. | 64 return nullptr; // Not using sync compositing. |
66 | 65 |
67 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 66 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
68 if (command_line->HasSwitch(switches::kIPCSyncCompositing)) { | 67 bool async_input = |
69 bool async_input = | 68 !command_line->HasSwitch(switches::kSyncInputForSyncCompositor); |
70 !command_line->HasSwitch(switches::kSyncInputForSyncCompositor); | 69 bool use_in_proc_software_draw = |
71 bool use_in_proc_software_draw = | 70 command_line->HasSwitch(switches::kSingleProcess); |
72 command_line->HasSwitch(switches::kSingleProcess); | 71 return base::WrapUnique(new SynchronousCompositorHost( |
73 return base::WrapUnique(new SynchronousCompositorHost( | 72 rwhva, web_contents_android->synchronous_compositor_client(), async_input, |
74 rwhva, web_contents_android->synchronous_compositor_client(), | 73 use_in_proc_software_draw)); |
75 async_input, use_in_proc_software_draw)); | |
76 } | |
77 return base::WrapUnique(new SynchronousCompositorImpl( | |
78 rwhva, web_contents_android->synchronous_compositor_client())); | |
79 } | 74 } |
80 | 75 |
81 } // namespace content | 76 } // namespace content |
OLD | NEW |