summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 19:17:41 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-14 19:17:41 +0000
commitc410da80a6f24f4f81d489cf67ca79ef18ad72ae (patch)
tree6bd0160358540a08ea0a0e742a37dbf82f449754 /content
parent7a6237765bb6be1e1cd8342988eb7a68fa1625a2 (diff)
downloadchromium_src-c410da80a6f24f4f81d489cf67ca79ef18ad72ae.zip
chromium_src-c410da80a6f24f4f81d489cf67ca79ef18ad72ae.tar.gz
chromium_src-c410da80a6f24f4f81d489cf67ca79ef18ad72ae.tar.bz2
Connect up --disable-gl-multisampling to command buffer
Plumb the --disable-gl-multisampling flag in to the command buffer, so it won't report the extension to any consumers. BUG=75181 TEST=webgl antialias test Review URL: http://codereview.chromium.org/6686024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/browser/gpu_process_host.cc18
-rw-r--r--content/browser/gpu_process_host.h11
-rw-r--r--content/common/content_switches.h1
-rw-r--r--content/gpu/gpu_channel.cc6
-rw-r--r--content/gpu/gpu_channel.h1
-rw-r--r--content/gpu/gpu_command_buffer_stub.cc3
-rw-r--r--content/gpu/gpu_command_buffer_stub.h23
7 files changed, 46 insertions, 17 deletions
diff --git a/content/browser/gpu_process_host.cc b/content/browser/gpu_process_host.cc
index 6ecec5a..c15ebe8 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);
};
diff --git a/content/common/content_switches.h b/content/common/content_switches.h
index 09d576b..c306484 100644
--- a/content/common/content_switches.h
+++ b/content/common/content_switches.h
@@ -20,6 +20,7 @@ extern const char kDisableDatabases[];
extern const char kDisableDesktopNotifications[];
extern const char kDisableExperimentalWebGL[];
extern const char kDisableFileSystem[];
+extern const char kDisableGLMultisampling[];
extern const char kDisableGpuSandbox[];
extern const char kDisableGpuWatchdog[];
extern const char kDisableHolePunching[];
diff --git a/content/gpu/gpu_channel.cc b/content/gpu/gpu_channel.cc
index 7f9435c..017fab1 100644
--- a/content/gpu/gpu_channel.cc
+++ b/content/gpu/gpu_channel.cc
@@ -31,6 +31,8 @@ GpuChannel::GpuChannel(GpuThread* gpu_thread,
DCHECK(renderer_id);
const CommandLine* command_line = CommandLine::ForCurrentProcess();
log_messages_ = command_line->HasSwitch(switches::kLogPluginMessages);
+ disallowed_extensions_.multisampling =
+ command_line->HasSwitch(switches::kDisableGLMultisampling);
}
GpuChannel::~GpuChannel() {
@@ -94,7 +96,8 @@ void GpuChannel::CreateViewCommandBuffer(
#if defined(ENABLE_GPU)
*route_id = GenerateRouteID();
scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
- this, window, NULL, gfx::Size(), init_params.allowed_extensions,
+ this, window, NULL, gfx::Size(), disallowed_extensions_,
+ init_params.allowed_extensions,
init_params.attribs, 0, *route_id, renderer_id_, render_view_id));
router_.AddRoute(*route_id, stub.get());
stubs_.AddWithID(stub.release(), *route_id);
@@ -173,6 +176,7 @@ void GpuChannel::OnCreateOffscreenCommandBuffer(
gfx::kNullPluginWindow,
parent_stub,
size,
+ disallowed_extensions_,
init_params.allowed_extensions,
init_params.attribs,
parent_texture_id,
diff --git a/content/gpu/gpu_channel.h b/content/gpu/gpu_channel.h
index 5ad31e3..9c87c8e 100644
--- a/content/gpu/gpu_channel.h
+++ b/content/gpu/gpu_channel.h
@@ -120,6 +120,7 @@ class GpuChannel : public IPC::Channel::Listener,
#endif // defined (ENABLE_GPU)
bool log_messages_; // True if we should log sent and received messages.
+ gpu::gles2::DisallowedExtensions disallowed_extensions_;
DISALLOW_COPY_AND_ASSIGN(GpuChannel);
};
diff --git a/content/gpu/gpu_command_buffer_stub.cc b/content/gpu/gpu_command_buffer_stub.cc
index a67dfd5..c1e9b1e9 100644
--- a/content/gpu/gpu_command_buffer_stub.cc
+++ b/content/gpu/gpu_command_buffer_stub.cc
@@ -24,6 +24,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
gfx::PluginWindowHandle handle,
GpuCommandBufferStub* parent,
const gfx::Size& size,
+ const gpu::gles2::DisallowedExtensions& disallowed_extensions,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
uint32 parent_texture_id,
@@ -35,6 +36,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
parent_(
parent ? parent->AsWeakPtr() : base::WeakPtr<GpuCommandBufferStub>()),
initial_size_(size),
+ disallowed_extensions_(disallowed_extensions),
allowed_extensions_(allowed_extensions),
requested_attribs_(attribs),
parent_texture_id_(parent_texture_id),
@@ -236,6 +238,7 @@ void GpuCommandBufferStub::OnInitialize(
if (processor_->Initialize(
output_window_handle,
initial_size_,
+ disallowed_extensions_,
allowed_extensions_.c_str(),
requested_attribs_,
parent_processor,
diff --git a/content/gpu/gpu_command_buffer_stub.h b/content/gpu/gpu_command_buffer_stub.h
index 69fbcc0..981ee0a 100644
--- a/content/gpu/gpu_command_buffer_stub.h
+++ b/content/gpu/gpu_command_buffer_stub.h
@@ -27,16 +27,18 @@ class GpuCommandBufferStub
public IPC::Message::Sender,
public base::SupportsWeakPtr<GpuCommandBufferStub> {
public:
- GpuCommandBufferStub(GpuChannel* channel,
- gfx::PluginWindowHandle handle,
- GpuCommandBufferStub* parent,
- const gfx::Size& size,
- const std::string& allowed_extensions,
- const std::vector<int32>& attribs,
- uint32 parent_texture_id,
- int32 route_id,
- int32 renderer_id,
- int32 render_view_id);
+ GpuCommandBufferStub(
+ GpuChannel* channel,
+ gfx::PluginWindowHandle handle,
+ GpuCommandBufferStub* parent,
+ const gfx::Size& size,
+ const gpu::gles2::DisallowedExtensions& disallowed_extensions,
+ const std::string& allowed_extensions,
+ const std::vector<int32>& attribs,
+ uint32 parent_texture_id,
+ int32 route_id,
+ int32 renderer_id,
+ int32 render_view_id);
virtual ~GpuCommandBufferStub();
@@ -106,6 +108,7 @@ class GpuCommandBufferStub
gfx::PluginWindowHandle handle_;
base::WeakPtr<GpuCommandBufferStub> parent_;
gfx::Size initial_size_;
+ gpu::gles2::DisallowedExtensions disallowed_extensions_;
std::string allowed_extensions_;
std::vector<int32> requested_attribs_;
uint32 parent_texture_id_;