summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/browser/gpu_process_host.cc18
-rw-r--r--content/browser/gpu_process_host.h11
2 files changed, 23 insertions, 6 deletions
diff --git a/content/browser/gpu_process_host.cc b/content/browser/gpu_process_host.cc
index 900abff..bb1f4ad 100644
--- a/content/browser/gpu_process_host.cc
+++ b/content/browser/gpu_process_host.cc
@@ -102,10 +102,12 @@ class GpuMainThread : public base::Thread {
};
// static
-GpuProcessHost* GpuProcessHost::Create(int host_id) {
+GpuProcessHost* GpuProcessHost::Create(
+ int host_id,
+ const GpuFeatureFlags& gpu_feature_flags) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- GpuProcessHost* host = new GpuProcessHost(host_id);
+ GpuProcessHost* host = new GpuProcessHost(host_id, gpu_feature_flags);
if (!host->Init()) {
delete host;
return NULL;
@@ -124,9 +126,12 @@ GpuProcessHost* GpuProcessHost::FromID(int host_id) {
return g_hosts_by_id.Lookup(host_id);
}
-GpuProcessHost::GpuProcessHost(int host_id)
+GpuProcessHost::GpuProcessHost(
+ int host_id,
+ const GpuFeatureFlags& gpu_feature_flags)
: BrowserChildProcessHost(GPU_PROCESS, NULL),
- host_id_(host_id) {
+ host_id_(host_id),
+ gpu_feature_flags_(gpu_feature_flags) {
g_hosts_by_id.AddWithID(this, host_id_);
}
@@ -296,10 +301,15 @@ bool GpuProcessHost::LaunchGpuProcess() {
switches::kLoggingLevel,
switches::kNoGpuSandbox,
switches::kNoSandbox,
+ switches::kDisableGLMultisampling,
};
cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
arraysize(kSwitchNames));
+ if (gpu_feature_flags_.flags() & GpuFeatureFlags::kGpuFeatureMultisampling) {
+ cmd_line->AppendSwitch(switches::kDisableGLMultisampling);
+ }
+
// If specified, prepend a launcher program to the command line.
if (!gpu_launcher.empty())
cmd_line->PrependWrapper(gpu_launcher);
diff --git a/content/browser/gpu_process_host.h b/content/browser/gpu_process_host.h
index 69f5916..35c9163 100644
--- a/content/browser/gpu_process_host.h
+++ b/content/browser/gpu_process_host.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/threading/non_thread_safe.h"
+#include "chrome/common/gpu_feature_flags.h"
#include "content/browser/browser_child_process_host.h"
namespace IPC {
@@ -19,7 +20,9 @@ class GpuProcessHost : public BrowserChildProcessHost,
// Create a GpuProcessHost with the given ID. The object can be found using
// FromID with the same id.
- static GpuProcessHost* Create(int host_id);
+ static GpuProcessHost* Create(
+ int host_id,
+ const GpuFeatureFlags& gpu_feature_flags);
// Get the GPU process host for the GPU process with the given ID. Returns
// null if the process no longer exists.
@@ -31,7 +34,9 @@ class GpuProcessHost : public BrowserChildProcessHost,
virtual bool OnMessageReceived(const IPC::Message& message);
private:
- explicit GpuProcessHost(int host_id);
+ explicit GpuProcessHost(
+ int host_id,
+ const GpuFeatureFlags& gpu_feature_flags);
virtual ~GpuProcessHost();
bool Init();
@@ -49,6 +54,8 @@ class GpuProcessHost : public BrowserChildProcessHost,
// The serial number of the GpuProcessHost / GpuProcessHostUIShim pair.
int host_id_;
+ GpuFeatureFlags gpu_feature_flags_;
+
DISALLOW_COPY_AND_ASSIGN(GpuProcessHost);
};