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

Unified Diff: ui/gfx/gl/gl_context.cc

Issue 8566041: Allow GLSurface to indicate that it supports a specific extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix gpu_unittests. Created 9 years, 1 month 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 | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gfx/gl/gl_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_context.cc
diff --git a/ui/gfx/gl/gl_context.cc b/ui/gfx/gl/gl_context.cc
index 998614fbc96e40e758a35ebc08a168355765b780..9fc541127b5944fd2ebb2e696c1fbff0cefc9483 100644
--- a/ui/gfx/gl/gl_context.cc
+++ b/ui/gfx/gl/gl_context.cc
@@ -39,8 +39,20 @@ GLContext::~GLContext() {
std::string GLContext::GetExtensions() {
DCHECK(IsCurrent(NULL));
- const char* ext = reinterpret_cast<const char*>(glGetString(GL_EXTENSIONS));
- return std::string(ext ? ext : "");
+
+ std::string extensions;
+ if (GLSurface::GetCurrent()) {
+ extensions = GLSurface::GetCurrent()->GetExtensions();
+ }
+
+ const char* gl_ext = reinterpret_cast<const char*>(
+ glGetString(GL_EXTENSIONS));
+ if (gl_ext) {
+ extensions += (!extensions.empty() && gl_ext[0]) ? " " : "";
+ extensions += gl_ext;
+ }
+
+ return extensions;
}
bool GLContext::HasExtension(const char* name) {
« no previous file with comments | « gpu/command_buffer/service/gles2_cmd_decoder.cc ('k') | ui/gfx/gl/gl_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698