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

Unified Diff: ui/gl/gl_gl_api_implementation.cc

Issue 1497863002: Fix disabled extensions for virtual contexts and respect command line. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed GL_NUM_EXTENSIONS Created 5 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
« no previous file with comments | « ui/gl/gl_gl_api_implementation.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_gl_api_implementation.cc
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index b6d55980a0cd2e7f0a7eb4cac6fd14854d2afc64..e40d27a23027b3c387fa0156d8ef284df11a0e1c 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -527,6 +527,8 @@ void VirtualGLApi::Initialize(DriverGL* driver, GLContext* real_context) {
DCHECK(real_context->IsCurrent(NULL));
extensions_ = real_context->GetExtensions();
+ extensions_vec_ = base::SplitString(extensions_, " ", base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
}
bool VirtualGLApi::MakeCurrent(GLContext* virtual_context, GLSurface* surface) {
@@ -600,6 +602,17 @@ void VirtualGLApi::OnReleaseVirtuallyCurrent(GLContext* virtual_context) {
current_context_ = NULL;
}
+void VirtualGLApi::glGetIntegervFn(GLenum pname, GLint* params) {
+ switch (pname) {
+ case GL_NUM_EXTENSIONS:
+ *params = static_cast<GLint>(extensions_vec_.size());
+ break;
+ default:
+ driver_->fn.glGetIntegervFn(pname, params);
+ break;
+ }
+}
+
const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) {
switch (name) {
case GL_EXTENSIONS:
@@ -609,6 +622,17 @@ const GLubyte* VirtualGLApi::glGetStringFn(GLenum name) {
}
}
+const GLubyte* VirtualGLApi::glGetStringiFn(GLenum name, GLuint index) {
+ switch (name) {
+ case GL_EXTENSIONS:
+ if (index >= extensions_vec_.size())
+ return NULL;
+ return reinterpret_cast<const GLubyte*>(extensions_vec_[index].c_str());
+ default:
+ return driver_->fn.glGetStringiFn(name, index);
+ }
+}
+
void VirtualGLApi::glFlushFn() {
GLApiBase::glFlushFn();
}
« no previous file with comments | « ui/gl/gl_gl_api_implementation.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698