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

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

Issue 1991953002: Implement a runtime headless mode for Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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
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 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 // Make sure the lost context callback doesn't try to run during destruction. 190 // Make sure the lost context callback doesn't try to run during destruction.
191 callback_factory_.InvalidateWeakPtrs(); 191 callback_factory_.InvalidateWeakPtrs();
192 192
193 task_graph_runner_->Shutdown(); 193 task_graph_runner_->Shutdown();
194 } 194 }
195 195
196 std::unique_ptr<cc::SoftwareOutputDevice> 196 std::unique_ptr<cc::SoftwareOutputDevice>
197 GpuProcessTransportFactory::CreateSoftwareOutputDevice( 197 GpuProcessTransportFactory::CreateSoftwareOutputDevice(
198 ui::Compositor* compositor) { 198 ui::Compositor* compositor) {
199 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
200 if (command_line->HasSwitch(switches::kHeadless))
201 return base::WrapUnique(new cc::SoftwareOutputDevice);
202
199 #if defined(USE_AURA) 203 #if defined(USE_AURA)
200 if (service_manager::ServiceManagerIsRemote()) { 204 if (service_manager::ServiceManagerIsRemote()) {
201 NOTREACHED(); 205 NOTREACHED();
202 return nullptr; 206 return nullptr;
203 } 207 }
204 #endif 208 #endif
205 209
206 #if defined(OS_WIN) 210 #if defined(OS_WIN)
207 return std::unique_ptr<cc::SoftwareOutputDevice>( 211 return std::unique_ptr<cc::SoftwareOutputDevice>(
208 new SoftwareOutputDeviceWin(software_backing_.get(), compositor)); 212 new SoftwareOutputDeviceWin(software_backing_.get(), compositor));
(...skipping 672 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 shared_vulkan_context_provider_ = 885 shared_vulkan_context_provider_ =
882 cc::VulkanInProcessContextProvider::Create(); 886 cc::VulkanInProcessContextProvider::Create();
883 } 887 }
884 888
885 shared_vulkan_context_provider_initialized_ = true; 889 shared_vulkan_context_provider_initialized_ = true;
886 } 890 }
887 return shared_vulkan_context_provider_; 891 return shared_vulkan_context_provider_;
888 } 892 }
889 893
890 } // namespace content 894 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698