Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: content/common/gpu/media/rendering_helper.cc

Issue 94963003: Take GL version and extensions correctly into account when binding functions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed review feedback and Mac build failure Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/rendering_helper.cc
diff --git a/content/common/gpu/media/rendering_helper.cc b/content/common/gpu/media/rendering_helper.cc
index c18cffc5b9fb8b424a5f0049510d5af586328573..d586c8c89199e84c334e108d8fbe75440309b06f 100644
--- a/content/common/gpu/media/rendering_helper.cc
+++ b/content/common/gpu/media/rendering_helper.cc
@@ -54,12 +54,16 @@ class GLContextStubWithExtensions : public gfx::GLContextStub {
virtual std::string GetExtensions() OVERRIDE;
void AddExtensionsString(const char* extensions);
+ void SetGLVersionString(const char* version_str);
protected:
+ virtual std::string GetGLVersion() OVERRIDE;
+
virtual ~GLContextStubWithExtensions() {}
private:
std::string extensions_;
+ std::string version_str_;
DISALLOW_COPY_AND_ASSIGN(GLContextStubWithExtensions);
};
@@ -77,6 +81,14 @@ std::string GLContextStubWithExtensions::GetExtensions() {
return extensions_;
}
+void GLContextStubWithExtensions::SetGLVersionString(const char* version_str) {
+ version_str_ = std::string(version_str ? version_str : "");
+}
+
+std::string GLContextStubWithExtensions::GetGLVersion() {
+ return version_str_;
+}
+
} // anonymous
namespace content {
@@ -135,7 +147,7 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
done.Wait();
}
- gfx::InitializeGLBindings(kGLImplementation);
+ gfx::InitializeStaticGLBindings(kGLImplementation);
scoped_refptr<GLContextStubWithExtensions> stub_context(
new GLContextStubWithExtensions());
@@ -171,6 +183,8 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
CHECK(gl_context_);
stub_context->AddExtensionsString(
reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
+ stub_context->SetGLVersionString(
+ reinterpret_cast<const char*>(glGetString(GL_VERSION)));
#else // EGL
EGLNativeDisplayType native_display;
@@ -208,6 +222,8 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS)));
stub_context->AddExtensionsString(
eglQueryString(gl_display_, EGL_EXTENSIONS));
+ stub_context->SetGLVersionString(
+ reinterpret_cast<const char*>(glGetString(GL_VERSION)));
#endif
// Per-window/surface X11 & EGL initialization.
@@ -263,7 +279,7 @@ void RenderingHelper::Initialize(const RenderingHelperParams& params,
}
// Must be done after a context is made current.
- gfx::InitializeGLExtensionBindings(kGLImplementation, stub_context.get());
+ gfx::InitializeDynamicGLBindings(kGLImplementation, stub_context.get());
if (render_as_thumbnails_) {
CHECK_EQ(window_dimensions_.size(), 1U);

Powered by Google App Engine
This is Rietveld 408576698