Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: content/browser/compositor/gpu_process_transport_factory.cc

Issue 1438903002: p1 mus+ash chrome renders ui and content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 #include "cc/surfaces/onscreen_display_client.h" 21 #include "cc/surfaces/onscreen_display_client.h"
22 #include "cc/surfaces/surface_display_output_surface.h" 22 #include "cc/surfaces/surface_display_output_surface.h"
23 #include "cc/surfaces/surface_manager.h" 23 #include "cc/surfaces/surface_manager.h"
24 #include "content/browser/compositor/browser_compositor_output_surface.h" 24 #include "content/browser/compositor/browser_compositor_output_surface.h"
25 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida tor.h" 25 #include "content/browser/compositor/browser_compositor_overlay_candidate_valida tor.h"
26 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h" 26 #include "content/browser/compositor/gpu_browser_compositor_output_surface.h"
27 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h" 27 #include "content/browser/compositor/gpu_surfaceless_browser_compositor_output_s urface.h"
28 #include "content/browser/compositor/offscreen_browser_compositor_output_surface .h" 28 #include "content/browser/compositor/offscreen_browser_compositor_output_surface .h"
29 #include "content/browser/compositor/reflector_impl.h" 29 #include "content/browser/compositor/reflector_impl.h"
30 #include "content/browser/compositor/software_browser_compositor_output_surface. h" 30 #include "content/browser/compositor/software_browser_compositor_output_surface. h"
31 #include "content/browser/compositor/software_output_device_mus.h"
31 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" 32 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
32 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" 33 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
33 #include "content/browser/gpu/compositor_util.h" 34 #include "content/browser/gpu/compositor_util.h"
34 #include "content/browser/gpu/gpu_data_manager_impl.h" 35 #include "content/browser/gpu/gpu_data_manager_impl.h"
35 #include "content/browser/gpu/gpu_surface_tracker.h" 36 #include "content/browser/gpu/gpu_surface_tracker.h"
36 #include "content/browser/renderer_host/render_widget_host_impl.h" 37 #include "content/browser/renderer_host/render_widget_host_impl.h"
37 #include "content/common/gpu/client/context_provider_command_buffer.h" 38 #include "content/common/gpu/client/context_provider_command_buffer.h"
38 #include "content/common/gpu/client/gl_helper.h" 39 #include "content/common/gpu/client/gl_helper.h"
39 #include "content/common/gpu/client/gpu_channel_host.h" 40 #include "content/common/gpu/client/gpu_channel_host.h"
40 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 41 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE; 142 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE;
142 scoped_refptr<GpuChannelHost> gpu_channel_host( 143 scoped_refptr<GpuChannelHost> gpu_channel_host(
143 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause)); 144 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannelSync(cause));
144 return CreateContextCommon(gpu_channel_host, 0); 145 return CreateContextCommon(gpu_channel_host, 0);
145 #endif // OS_ANDROID 146 #endif // OS_ANDROID
146 } 147 }
147 148
148 scoped_ptr<cc::SoftwareOutputDevice> 149 scoped_ptr<cc::SoftwareOutputDevice>
149 GpuProcessTransportFactory::CreateSoftwareOutputDevice( 150 GpuProcessTransportFactory::CreateSoftwareOutputDevice(
150 ui::Compositor* compositor) { 151 ui::Compositor* compositor) {
152 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
153 "mojo-platform-channel-handle")) {
154 return scoped_ptr<cc::SoftwareOutputDevice>(
155 new SoftwareOutputDeviceMus(compositor));
156 }
ccameron 2015/11/13 23:15:41 Can we get a IsRunningInMojoRunner() similar to th
157
151 #if defined(OS_WIN) 158 #if defined(OS_WIN)
152 return scoped_ptr<cc::SoftwareOutputDevice>( 159 return scoped_ptr<cc::SoftwareOutputDevice>(
153 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); 160 new SoftwareOutputDeviceWin(software_backing_.get(), compositor));
154 #elif defined(USE_OZONE) 161 #elif defined(USE_OZONE)
155 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone( 162 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceOzone(
156 compositor)); 163 compositor));
157 #elif defined(USE_X11) 164 #elif defined(USE_X11)
158 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceX11( 165 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceX11(
159 compositor)); 166 compositor));
160 #elif defined(OS_MACOSX) 167 #elif defined(OS_MACOSX)
(...skipping 24 matching lines...) Expand all
185 // Overlays are only supported through the remote layer API. 192 // Overlays are only supported through the remote layer API.
186 if (ui::RemoteLayerAPISupported()) { 193 if (ui::RemoteLayerAPISupported()) {
187 return make_scoped_ptr( 194 return make_scoped_ptr(
188 new BrowserCompositorOverlayCandidateValidatorMac(widget)); 195 new BrowserCompositorOverlayCandidateValidatorMac(widget));
189 } 196 }
190 #endif 197 #endif
191 return scoped_ptr<BrowserCompositorOverlayCandidateValidator>(); 198 return scoped_ptr<BrowserCompositorOverlayCandidateValidator>();
192 } 199 }
193 200
194 static bool ShouldCreateGpuOutputSurface(ui::Compositor* compositor) { 201 static bool ShouldCreateGpuOutputSurface(ui::Compositor* compositor) {
202 // Chrome running as a mojo app currently can only use software compositing.
203 // TODO(rjkroege): http://crbug.com/548451
204 // TODO(rjkroege): Make IsRunningInMojoRunner callable from content.
205 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
206 "mojo-platform-channel-handle")) {
207 return false;
208 }
ccameron 2015/11/13 23:15:41 Likewise.
209
195 #if defined(OS_CHROMEOS) 210 #if defined(OS_CHROMEOS)
196 // Software fallback does not happen on Chrome OS. 211 // Software fallback does not happen on Chrome OS.
197 return true; 212 return true;
198 #endif 213 #endif
199 214
200 #if defined(OS_WIN) 215 #if defined(OS_WIN)
201 if (::GetProp(compositor->widget(), kForceSoftwareCompositor) && 216 if (::GetProp(compositor->widget(), kForceSoftwareCompositor) &&
202 ::RemoveProp(compositor->widget(), kForceSoftwareCompositor)) 217 ::RemoveProp(compositor->widget(), kForceSoftwareCompositor))
203 return false; 218 return false;
204 #endif 219 #endif
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 FOR_EACH_OBSERVER(ImageTransportFactoryObserver, 667 FOR_EACH_OBSERVER(ImageTransportFactoryObserver,
653 observer_list_, 668 observer_list_,
654 OnLostResources()); 669 OnLostResources());
655 670
656 // Kill things that use the shared context before killing the shared context. 671 // Kill things that use the shared context before killing the shared context.
657 lost_gl_helper.reset(); 672 lost_gl_helper.reset();
658 lost_shared_main_thread_contexts = NULL; 673 lost_shared_main_thread_contexts = NULL;
659 } 674 }
660 675
661 } // namespace content 676 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698