summaryrefslogtreecommitdiffstats
path: root/webkit/support
diff options
context:
space:
mode:
Diffstat (limited to 'webkit/support')
-rw-r--r--webkit/support/webkit_support.cc14
-rw-r--r--webkit/support/webkit_support.h6
2 files changed, 20 insertions, 0 deletions
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.