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

Unified Diff: ui/gfx/gl/gl_surface_glx.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 | « ui/gfx/gl/gl_surface_glx.h ('k') | webkit/gpu/webgraphicscontext3d_in_process_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/gl/gl_surface_glx.cc
diff --git a/ui/gfx/gl/gl_surface_glx.cc b/ui/gfx/gl/gl_surface_glx.cc
index 373bc857d48d02593c7663405aa97ddbebb222dc..3b8cbe9a789d1071ce9886171c4eedd9c0f7531d 100644
--- a/ui/gfx/gl/gl_surface_glx.cc
+++ b/ui/gfx/gl/gl_surface_glx.cc
@@ -73,10 +73,12 @@ bool GLSurfaceGLX::InitializeOneOff() {
return true;
}
+// static
const char* GLSurfaceGLX::GetGLXExtensions() {
return g_glx_extensions;
}
+// static
bool GLSurfaceGLX::HasGLXExtension(const char* name) {
DCHECK(name);
const char* c_extensions = GetGLXExtensions();
@@ -91,6 +93,7 @@ bool GLSurfaceGLX::HasGLXExtension(const char* name) {
return extensions.find(delimited_name) != std::string::npos;
}
+// static
bool GLSurfaceGLX::IsCreateContextRobustnessSupported() {
return g_glx_create_context_robustness_supported;
}
@@ -142,6 +145,15 @@ void* NativeViewGLSurfaceGLX::GetHandle() {
return reinterpret_cast<void*>(window_);
}
+std::string NativeViewGLSurfaceGLX::GetExtensions() {
+ std::string extensions = GLSurface::GetExtensions();
+ if (g_GLX_MESA_copy_sub_buffer) {
+ extensions += extensions.empty() ? "" : " ";
+ extensions += "GL_CHROMIUM_post_sub_buffer";
+ }
+ return extensions;
+}
+
void* NativeViewGLSurfaceGLX::GetConfig() {
if (!config_) {
// This code path is expensive, but we only take it when
@@ -203,13 +215,9 @@ void* NativeViewGLSurfaceGLX::GetConfig() {
return config_;
}
-bool NativeViewGLSurfaceGLX::SupportsPostSubBuffer() {
- return g_GLX_MESA_copy_sub_buffer;
-}
-
bool NativeViewGLSurfaceGLX::PostSubBuffer(
int x, int y, int width, int height) {
- DCHECK(SupportsPostSubBuffer());
+ DCHECK(g_GLX_MESA_copy_sub_buffer);
glXCopySubBufferMESA(g_display, window_, x, y, width, height);
return true;
}
« no previous file with comments | « ui/gfx/gl/gl_surface_glx.h ('k') | webkit/gpu/webgraphicscontext3d_in_process_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698