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

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

Issue 93593002: Fall back to software mode if Aura can't create a GL context (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Wire up fallback from Compositor::CreateOutputSurface to ContextFactory::CreateOutputSurface Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/aura/gpu_process_transport_factory.h ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/aura/gpu_process_transport_factory.h" 5 #include "content/browser/aura/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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 #elif defined(USE_X11) 172 #elif defined(USE_X11)
173 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceX11( 173 return scoped_ptr<cc::SoftwareOutputDevice>(new SoftwareOutputDeviceX11(
174 compositor)); 174 compositor));
175 #endif 175 #endif
176 176
177 NOTREACHED(); 177 NOTREACHED();
178 return scoped_ptr<cc::SoftwareOutputDevice>(); 178 return scoped_ptr<cc::SoftwareOutputDevice>();
179 } 179 }
180 180
181 scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface( 181 scoped_ptr<cc::OutputSurface> GpuProcessTransportFactory::CreateOutputSurface(
182 ui::Compositor* compositor) { 182 ui::Compositor* compositor, bool software_fallback) {
183 PerCompositorData* data = per_compositor_data_[compositor]; 183 PerCompositorData* data = per_compositor_data_[compositor];
184 if (!data) 184 if (!data)
185 data = CreatePerCompositorData(compositor); 185 data = CreatePerCompositorData(compositor);
186 186
187 scoped_refptr<ContextProviderCommandBuffer> context_provider; 187 scoped_refptr<ContextProviderCommandBuffer> context_provider;
188 188
189 CommandLine* command_line = CommandLine::ForCurrentProcess(); 189 CommandLine* command_line = CommandLine::ForCurrentProcess();
190 if (!command_line->HasSwitch(switches::kUIEnableSoftwareCompositing)) { 190 if (!command_line->HasSwitch(switches::kUIEnableSoftwareCompositing) &&
191 !software_fallback) {
191 context_provider = ContextProviderCommandBuffer::Create( 192 context_provider = ContextProviderCommandBuffer::Create(
192 GpuProcessTransportFactory::CreateContextCommon(data->surface_id), 193 GpuProcessTransportFactory::CreateContextCommon(data->surface_id),
193 "Compositor"); 194 "Compositor");
194 } 195 }
195 196
196 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", !!context_provider); 197 UMA_HISTOGRAM_BOOLEAN("Aura.CreatedGpuBrowserCompositor", !!context_provider);
197 198
198 if (!context_provider.get()) { 199 if (!context_provider.get()) {
199 if (ui::Compositor::WasInitializedWithThread()) { 200 if (ui::Compositor::WasInitializedWithThread()) {
200 LOG(FATAL) << "Failed to create UI context, but can't use software" 201 LOG(FATAL) << "Failed to create UI context, but can't use software"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 observer_list_, 492 observer_list_,
492 OnLostResources()); 493 OnLostResources());
493 494
494 // Kill things that use the shared context before killing the shared context. 495 // Kill things that use the shared context before killing the shared context.
495 lost_gl_helper.reset(); 496 lost_gl_helper.reset();
496 lost_offscreen_compositor_contexts = NULL; 497 lost_offscreen_compositor_contexts = NULL;
497 lost_shared_main_thread_contexts = NULL; 498 lost_shared_main_thread_contexts = NULL;
498 } 499 }
499 500
500 } // namespace content 501 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/aura/gpu_process_transport_factory.h ('k') | ui/compositor/compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698