summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-21 18:52:47 +0000
committerjbauman@chromium.org <jbauman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-21 18:52:47 +0000
commitf81f5950b78f7c0161d757d91ff3a3baa96e089b (patch)
tree11312132f3f8aa876dd021e6ce40fcaf551a6271 /gpu
parente25c33d1747f42be8171ff38d06fe9d797d46af0 (diff)
downloadchromium_src-f81f5950b78f7c0161d757d91ff3a3baa96e089b.zip
chromium_src-f81f5950b78f7c0161d757d91ff3a3baa96e089b.tar.gz
chromium_src-f81f5950b78f7c0161d757d91ff3a3baa96e089b.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 TBR=apatrick Review URL: http://codereview.chromium.org/7471042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93449 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/command_buffer/client/gles2_demo.cc1
-rw-r--r--gpu/command_buffer/service/gpu_scheduler.h1
-rw-r--r--gpu/command_buffer/service/gpu_scheduler_linux.cc8
-rw-r--r--gpu/command_buffer/service/gpu_scheduler_mac.cc3
-rw-r--r--gpu/command_buffer/service/gpu_scheduler_win.cc6
-rw-r--r--gpu/demos/framework/window.cc2
-rw-r--r--gpu/gles2_conform_support/egl/display.cc2
7 files changed, 15 insertions, 8 deletions
diff --git a/gpu/command_buffer/client/gles2_demo.cc b/gpu/command_buffer/client/gles2_demo.cc
index c9595df..f981b1b 100644
--- a/gpu/command_buffer/client/gles2_demo.cc
+++ b/gpu/command_buffer/client/gles2_demo.cc
@@ -61,6 +61,7 @@ bool GLES2Demo::Setup(void* hwnd, int32 size) {
NULL);
if (!gpu_scheduler->Initialize(reinterpret_cast<HWND>(hwnd),
gfx::Size(),
+ false,
gpu::gles2::DisallowedExtensions(),
NULL,
std::vector<int32>(),
diff --git a/gpu/command_buffer/service/gpu_scheduler.h b/gpu/command_buffer/service/gpu_scheduler.h
index eedae30..d34e67f 100644
--- a/gpu/command_buffer/service/gpu_scheduler.h
+++ b/gpu/command_buffer/service/gpu_scheduler.h
@@ -63,6 +63,7 @@ class GpuScheduler : public CommandBufferEngine {
// Perform platform specific and common initialization.
bool Initialize(gfx::PluginWindowHandle hwnd,
const gfx::Size& size,
+ bool software,
const gles2::DisallowedExtensions& disallowed_extensions,
const char* allowed_extensions,
const std::vector<int32>& attribs,
diff --git a/gpu/command_buffer/service/gpu_scheduler_linux.cc b/gpu/command_buffer/service/gpu_scheduler_linux.cc
index 1c6c8e9..fcbbd65 100644
--- a/gpu/command_buffer/service/gpu_scheduler_linux.cc
+++ b/gpu/command_buffer/service/gpu_scheduler_linux.cc
@@ -21,6 +21,7 @@ namespace gpu {
bool GpuScheduler::Initialize(
gfx::PluginWindowHandle window,
const gfx::Size& size,
+ bool software,
const gles2::DisallowedExtensions& disallowed_extensions,
const char* allowed_extensions,
const std::vector<int32>& attribs,
@@ -28,12 +29,13 @@ bool GpuScheduler::Initialize(
// Create either a view or pbuffer based GLSurface.
scoped_refptr<gfx::GLSurface> surface;
#if defined(TOUCH_UI)
- surface = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
+ surface = gfx::GLSurface::CreateOffscreenGLSurface(software, gfx::Size(1, 1));
#else
if (window)
- surface = gfx::GLSurface::CreateViewGLSurface(window);
+ surface = gfx::GLSurface::CreateViewGLSurface(software, window);
else
- surface = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
+ surface = gfx::GLSurface::CreateOffscreenGLSurface(software,
+ gfx::Size(1, 1));
#endif
if (!surface.get()) {
diff --git a/gpu/command_buffer/service/gpu_scheduler_mac.cc b/gpu/command_buffer/service/gpu_scheduler_mac.cc
index 2835088..cfa0d5c 100644
--- a/gpu/command_buffer/service/gpu_scheduler_mac.cc
+++ b/gpu/command_buffer/service/gpu_scheduler_mac.cc
@@ -14,12 +14,13 @@ namespace gpu {
bool GpuScheduler::Initialize(
gfx::PluginWindowHandle window,
const gfx::Size& size,
+ bool software,
const gles2::DisallowedExtensions& disallowed_extensions,
const char* allowed_extensions,
const std::vector<int32>& attribs,
gfx::GLShareGroup* share_group) {
scoped_refptr<gfx::GLSurface> surface(
- gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)));
+ gfx::GLSurface::CreateOffscreenGLSurface(software, gfx::Size(1, 1)));
if (!surface.get()) {
LOG(ERROR) << "CreateOffscreenGLSurface failed.\n";
Destroy();
diff --git a/gpu/command_buffer/service/gpu_scheduler_win.cc b/gpu/command_buffer/service/gpu_scheduler_win.cc
index 20e5382..84f2b83 100644
--- a/gpu/command_buffer/service/gpu_scheduler_win.cc
+++ b/gpu/command_buffer/service/gpu_scheduler_win.cc
@@ -16,6 +16,7 @@ namespace gpu {
bool GpuScheduler::Initialize(
gfx::PluginWindowHandle window,
const gfx::Size& size,
+ bool software,
const gles2::DisallowedExtensions& disallowed_extensions,
const char* allowed_extensions,
const std::vector<int32>& attribs,
@@ -23,9 +24,10 @@ bool GpuScheduler::Initialize(
// Create either a view or pbuffer based GLSurface.
scoped_refptr<gfx::GLSurface> surface;
if (window) {
- surface = gfx::GLSurface::CreateViewGLSurface(window);
+ surface = gfx::GLSurface::CreateViewGLSurface(software, window);
} else {
- surface = gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1));
+ surface = gfx::GLSurface::CreateOffscreenGLSurface(software,
+ gfx::Size(1, 1));
}
if (!surface.get()) {
diff --git a/gpu/demos/framework/window.cc b/gpu/demos/framework/window.cc
index 30ba86c..f609a55 100644
--- a/gpu/demos/framework/window.cc
+++ b/gpu/demos/framework/window.cc
@@ -61,7 +61,7 @@ bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) {
GpuScheduler* gpu_scheduler(
new GpuScheduler(command_buffer.get(), NULL, NULL));
- if (!gpu_scheduler->Initialize(hwnd, gfx::Size(),
+ if (!gpu_scheduler->Initialize(hwnd, gfx::Size(), false,
gpu::gles2::DisallowedExtensions(),
NULL, std::vector<int32>(),
NULL)) {
diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc
index cfadf0f..63604b9 100644
--- a/gpu/gles2_conform_support/egl/display.cc
+++ b/gpu/gles2_conform_support/egl/display.cc
@@ -111,7 +111,7 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config,
scoped_ptr<GpuScheduler> gpu_scheduler(
new GpuScheduler(command_buffer_.get(), NULL, NULL));
if (!gpu_scheduler->Initialize(
- win, gfx::Size(), gpu::gles2::DisallowedExtensions(), NULL,
+ win, gfx::Size(), false, gpu::gles2::DisallowedExtensions(), NULL,
attribs, NULL))
return EGL_NO_SURFACE;