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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/gpu_process_transport_factory.cc
diff --git a/content/browser/compositor/gpu_process_transport_factory.cc b/content/browser/compositor/gpu_process_transport_factory.cc
index 23c4cbd818916f0f8586f6be37f7d3157ba92522..d3558b1c6079fff68660add807c5529c0c1b87ea 100644
--- a/content/browser/compositor/gpu_process_transport_factory.cc
+++ b/content/browser/compositor/gpu_process_transport_factory.cc
@@ -55,6 +55,7 @@
#include "ui/compositor/layer.h"
#include "ui/display/types/display_snapshot.h"
#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/switches.h"
#if defined(USE_AURA)
#include "content/browser/compositor/mus_browser_compositor_output_surface.h"
@@ -196,6 +197,10 @@ GpuProcessTransportFactory::~GpuProcessTransportFactory() {
std::unique_ptr<cc::SoftwareOutputDevice>
GpuProcessTransportFactory::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kHeadless))
+ return base::WrapUnique(new cc::SoftwareOutputDevice);
+
#if defined(USE_AURA)
if (service_manager::ServiceManagerIsRemote()) {
NOTREACHED();
@@ -260,6 +265,10 @@ CreateOverlayCandidateValidator(gfx::AcceleratedWidget widget) {
}
static bool ShouldCreateGpuCompositorFrameSink(ui::Compositor* compositor) {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kHeadless))
+ return false;
+
#if defined(OS_CHROMEOS)
// Software fallback does not happen on Chrome OS.
return true;
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/browser/gpu/gpu_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698