| Index: ui/gl/gl_context_stub.cc
|
| diff --git a/ui/gl/gl_context_stub.cc b/ui/gl/gl_context_stub.cc
|
| index a72f08080cc06d5b3f7c341c6bd1e9480a046316..1c54f9dd42c1d4263c6a4862b8b38998ebe62ce0 100644
|
| --- a/ui/gl/gl_context_stub.cc
|
| +++ b/ui/gl/gl_context_stub.cc
|
| @@ -5,12 +5,16 @@
|
| #include "ui/gl/gl_context_stub.h"
|
|
|
| #include "ui/gl/gl_gl_api_implementation.h"
|
| +#include "ui/gl/gl_stub_api.h"
|
|
|
| namespace gl {
|
|
|
| -GLContextStub::GLContextStub() : GLContextReal(nullptr) {}
|
| +GLContextStub::GLContextStub() : GLContextStub(nullptr) {}
|
| GLContextStub::GLContextStub(GLShareGroup* share_group)
|
| - : GLContextReal(share_group) {}
|
| + : GLContextReal(share_group),
|
| + use_stub_api_(false),
|
| + version_str_("OpenGL ES 3.0"),
|
| + extensions_("GL_EXT_framebuffer_object") {}
|
|
|
| bool GLContextStub::Initialize(GLSurface* compatible_surface,
|
| const GLContextAttribs& attribs) {
|
| @@ -18,7 +22,7 @@ bool GLContextStub::Initialize(GLSurface* compatible_surface,
|
| }
|
|
|
| bool GLContextStub::MakeCurrent(GLSurface* surface) {
|
| - SetGLToStubGLApi();
|
| + BindGLApi();
|
| SetCurrent(surface);
|
| InitializeDynamicBindings();
|
| return true;
|
| @@ -39,10 +43,50 @@ void* GLContextStub::GetHandle() {
|
| void GLContextStub::OnSetSwapInterval(int interval) {
|
| }
|
|
|
| +std::string GLContextStub::GetGLVersion() {
|
| + return version_str_;
|
| +}
|
| +
|
| std::string GLContextStub::GetGLRenderer() {
|
| return std::string("CHROMIUM");
|
| }
|
|
|
| +bool GLContextStub::WasAllocatedUsingRobustnessExtension() {
|
| + return HasExtension("GL_ARB_robustness") ||
|
| + HasExtension("GL_KHR_robustness") || HasExtension("GL_EXT_robustness");
|
| +}
|
| +
|
| +std::string GLContextStub::GetExtensions() {
|
| + return extensions_;
|
| +}
|
| +
|
| +void GLContextStub::SetUseStubApi(bool stub_api) {
|
| + use_stub_api_ = stub_api;
|
| +}
|
| +
|
| +void GLContextStub::SetExtensionsString(const char* extensions) {
|
| + extensions_ = extensions;
|
| +}
|
| +
|
| +void GLContextStub::SetGLVersionString(const char* version_str) {
|
| + version_str_ = std::string(version_str ? version_str : "");
|
| +}
|
| +
|
| GLContextStub::~GLContextStub() {}
|
|
|
| +GLApi* GLContextStub::CreateGLApi(DriverGL* driver) {
|
| + if (use_stub_api_) {
|
| + GLStubApi* stub_api = new GLStubApi();
|
| + if (!version_str_.empty()) {
|
| + stub_api->set_version(version_str_);
|
| + }
|
| + if (!extensions_.empty()) {
|
| + stub_api->set_extensions(extensions_);
|
| + }
|
| + return stub_api;
|
| + }
|
| +
|
| + return GLContext::CreateGLApi(driver);
|
| +}
|
| +
|
| } // namespace gl
|
|
|