summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-21 14:45:24 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-21 14:45:24 +0000
commit3a16cbc704db7e80d5184b932ad9d3b0b13f7dc7 (patch)
tree56537abb44f3a2c9ba2921e27ab4995bb68830dd /content
parentf5d978cfcc87e29ac3284d9c518770d24c529699 (diff)
downloadchromium_src-3a16cbc704db7e80d5184b932ad9d3b0b13f7dc7.zip
chromium_src-3a16cbc704db7e80d5184b932ad9d3b0b13f7dc7.tar.gz
chromium_src-3a16cbc704db7e80d5184b932ad9d3b0b13f7dc7.tar.bz2
Allow creating a gpu channel that uses software rendering
Where supported (on ANGLE with EGL_ANGLE_software_display), allow for the creation of gpu channels that use software rendering instead of hardware rendering. BUG= TEST=trybots, other later tests Review URL: http://codereview.chromium.org/7383004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93393 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r--content/common/gpu/gpu_channel.cc13
-rw-r--r--content/common/gpu/gpu_channel.h4
-rw-r--r--content/common/gpu/gpu_channel_manager.cc2
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc5
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.h4
-rw-r--r--content/gpu/gpu_info_collector.cc2
-rw-r--r--content/gpu/gpu_info_collector_win.cc2
7 files changed, 21 insertions, 11 deletions
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index e69d197..e83320d 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -27,13 +27,15 @@
GpuChannel::GpuChannel(GpuChannelManager* gpu_channel_manager,
GpuWatchdog* watchdog,
- int renderer_id)
+ int renderer_id,
+ bool software)
: gpu_channel_manager_(gpu_channel_manager),
renderer_id_(renderer_id),
renderer_process_(base::kNullProcessHandle),
renderer_pid_(base::kNullProcessId),
share_group_(new gfx::GLShareGroup),
- watchdog_(watchdog) {
+ watchdog_(watchdog),
+ software_(software) {
DCHECK(gpu_channel_manager);
DCHECK(renderer_id);
const CommandLine* command_line = CommandLine::ForCurrentProcess();
@@ -164,7 +166,7 @@ void GpuChannel::CreateViewCommandBuffer(
this, window, gfx::Size(), disallowed_extensions_,
init_params.allowed_extensions,
init_params.attribs, *route_id, renderer_id_, render_view_id,
- watchdog_));
+ watchdog_, software_));
router_.AddRoute(*route_id, stub.get());
stubs_.AddWithID(stub.release(), *route_id);
#endif // ENABLE_GPU
@@ -274,7 +276,8 @@ void GpuChannel::OnCreateOffscreenCommandBuffer(
init_params.allowed_extensions,
init_params.attribs,
*route_id,
- 0, 0, watchdog_));
+ 0, 0, watchdog_,
+ software_));
router_.AddRoute(*route_id, stub.get());
stubs_.AddWithID(stub.release(), *route_id);
TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer",
@@ -306,7 +309,7 @@ void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size,
#if defined(ENABLE_GPU)
scoped_refptr<gfx::GLSurface> surface(
- gfx::GLSurface::CreateOffscreenGLSurface(size));
+ gfx::GLSurface::CreateOffscreenGLSurface(software_, size));
if (!surface.get())
return;
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h
index 7344496..2b5ad1f 100644
--- a/content/common/gpu/gpu_channel.h
+++ b/content/common/gpu/gpu_channel.h
@@ -48,7 +48,8 @@ class GpuChannel : public IPC::Channel::Listener,
// Takes ownership of the renderer process handle.
GpuChannel(GpuChannelManager* gpu_channel_manager,
GpuWatchdog* watchdog,
- int renderer_id);
+ int renderer_id,
+ bool software);
virtual ~GpuChannel();
bool Init(base::MessageLoopProxy* io_message_loop,
@@ -187,6 +188,7 @@ class GpuChannel : public IPC::Channel::Listener,
bool log_messages_; // True if we should log sent and received messages.
gpu::gles2::DisallowedExtensions disallowed_extensions_;
GpuWatchdog* watchdog_;
+ bool software_;
DISALLOW_COPY_AND_ASSIGN(GpuChannel);
};
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index a0b520c..c2ef865 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -71,7 +71,7 @@ void GpuChannelManager::OnEstablishChannel(int renderer_id) {
GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
if (iter == gpu_channels_.end())
- channel = new GpuChannel(this, watchdog_, renderer_id);
+ channel = new GpuChannel(this, watchdog_, renderer_id, false);
else
channel = iter->second;
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc
index 8034372..6de811d 100644
--- a/content/common/gpu/gpu_command_buffer_stub.cc
+++ b/content/common/gpu/gpu_command_buffer_stub.cc
@@ -36,7 +36,8 @@ GpuCommandBufferStub::GpuCommandBufferStub(
int32 route_id,
int32 renderer_id,
int32 render_view_id,
- GpuWatchdog* watchdog)
+ GpuWatchdog* watchdog,
+ bool software)
: channel_(channel),
handle_(handle),
initial_size_(size),
@@ -44,6 +45,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
allowed_extensions_(allowed_extensions),
requested_attribs_(attribs),
route_id_(route_id),
+ software_(software),
last_flush_count_(0),
renderer_id_(renderer_id),
render_view_id_(render_view_id),
@@ -148,6 +150,7 @@ void GpuCommandBufferStub::OnInitialize(
if (scheduler_->Initialize(
handle_,
initial_size_,
+ software_,
disallowed_extensions_,
allowed_extensions_.c_str(),
requested_attribs_,
diff --git a/content/common/gpu/gpu_command_buffer_stub.h b/content/common/gpu/gpu_command_buffer_stub.h
index 6766d87..902ec9b 100644
--- a/content/common/gpu/gpu_command_buffer_stub.h
+++ b/content/common/gpu/gpu_command_buffer_stub.h
@@ -41,7 +41,8 @@ class GpuCommandBufferStub
int32 route_id,
int32 renderer_id,
int32 render_view_id,
- GpuWatchdog* watchdog);
+ GpuWatchdog* watchdog,
+ bool software);
virtual ~GpuCommandBufferStub();
@@ -155,6 +156,7 @@ class GpuCommandBufferStub
std::string allowed_extensions_;
std::vector<int32> requested_attribs_;
int32 route_id_;
+ bool software_;
uint32 last_flush_count_;
// The following two fields are used on Mac OS X to identify the window
diff --git a/content/gpu/gpu_info_collector.cc b/content/gpu/gpu_info_collector.cc
index 93cd767..cd0918c 100644
--- a/content/gpu/gpu_info_collector.cc
+++ b/content/gpu/gpu_info_collector.cc
@@ -20,7 +20,7 @@ namespace {
scoped_refptr<gfx::GLSurface> InitializeGLSurface() {
scoped_refptr<gfx::GLSurface> surface(
- gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)));
+ gfx::GLSurface::CreateOffscreenGLSurface(false, gfx::Size(1, 1)));
if (!surface.get()) {
LOG(ERROR) << "gfx::GLContext::CreateOffscreenGLSurface failed";
return NULL;
diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc
index 4e32805..dfae814 100644
--- a/content/gpu/gpu_info_collector_win.cc
+++ b/content/gpu/gpu_info_collector_win.cc
@@ -72,7 +72,7 @@ bool CollectGraphicsInfo(GPUInfo* gpu_info) {
// Need to handle the case when running on top of real EGL/GLES2 drivers.
egl::Display* display = static_cast<egl::Display*>(
- gfx::GLSurfaceEGL::GetDisplay());
+ gfx::GLSurfaceEGL::GetHardwareDisplay());
if (!display) {
LOG(ERROR) << "gfx::BaseEGLContext::GetDisplay() failed";
return false;