From 6c4d215ecd29ac00a618fdff5477c0184ccf1b6c Mon Sep 17 00:00:00 2001 From: "scheib@chromium.org" Date: Thu, 13 Jan 2011 18:08:24 +0000 Subject: Add support for DumpRenderTree to use the GPU rather than software renderer BUG=68797 TEST=previous buildbots test old path, new buildbots will test the GPU path Support for webkit side changes: https://bugs.webkit.org/show_bug.cgi?id=52333 Review URL: http://codereview.chromium.org/6258001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71332 0039d316-1c4b-4281-b951-d872f2087c98 --- webkit/support/webkit_support.cc | 14 ++++++++++++++ webkit/support/webkit_support.h | 6 ++++++ 2 files changed, 20 insertions(+) (limited to 'webkit/support') diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc index 52a2a34..8a76c1f 100644 --- a/webkit/support/webkit_support.cc +++ b/webkit/support/webkit_support.cc @@ -4,6 +4,7 @@ #include "webkit/support/webkit_support.h" +#include "app/gfx/gl/gl_context.h" #include "app/gfx/gl/gl_implementation.h" #include "base/at_exit.h" #include "base/base64.h" @@ -290,6 +291,19 @@ WebKit::WebString GetWebKitRootDir() { return WebKit::WebString::fromUTF8(WideToUTF8(path.ToWStringHack()).c_str()); } +void SetUpGLBindings(GLBindingPreferences bindingPref) { + switch(bindingPref) { + case GL_BINDING_DEFAULT: + gfx::GLContext::InitializeOneOff(); + break; + case GL_BINDING_SOFTWARE_RENDERER: + gfx::InitializeGLBindings(gfx::kGLImplementationOSMesaGL); + break; + default: + NOTREACHED(); + } +} + void RegisterMockedURL(const WebKit::WebURL& url, const WebKit::WebURLResponse& response, const WebKit::WebString& file_path) { diff --git a/webkit/support/webkit_support.h b/webkit/support/webkit_support.h index 9150e0a..7ee4809 100644 --- a/webkit/support/webkit_support.h +++ b/webkit/support/webkit_support.h @@ -75,6 +75,12 @@ WebKit::WebApplicationCacheHost* CreateApplicationCacheHost( // Returns the root directory of the WebKit code. WebKit::WebString GetWebKitRootDir(); +enum GLBindingPreferences { + GL_BINDING_DEFAULT, + GL_BINDING_SOFTWARE_RENDERER +}; +void SetUpGLBindings(GLBindingPreferences); + // ------- URL load mocking. // Registers the file at |file_path| to be served when |url| is requested. // |response| is the response provided with the contents. -- cgit v1.1