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

Unified Diff: ui/gl/gl_surface_glx.cc

Issue 11467008: Always use glXCreateContextAttribsARB to create GLX contexts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback" Created 8 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_surface_glx.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_surface_glx.cc
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index b349e7c9e56bb19498ad680274ec826c2c8b305e..a933e1f08f7196f5a2fb204b7cd86faf6faef810 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -451,10 +451,24 @@ bool NativeViewGLSurfaceGLX::Initialize() {
else if (g_glx_sgi_video_sync_supported)
vsync_provider_.reset(new SGIVideoSyncVSyncProvider(window_));
+ glx_window_ = glXCreateWindow(
+ g_display,
+ static_cast<GLXFBConfig>(GetConfig()),
+ window_,
+ NULL);
+ if (!glx_window_) {
+ LOG(ERROR) << "glXCreateWindow failed for window " << window_ << ".";
+ return false;
+ }
+
return true;
}
void NativeViewGLSurfaceGLX::Destroy() {
+ if (glx_window_) {
+ glXDestroyWindow(g_display, glx_window_);
+ glx_window_ = 0;
+ }
}
bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) {
@@ -472,7 +486,7 @@ bool NativeViewGLSurfaceGLX::IsOffscreen() {
}
bool NativeViewGLSurfaceGLX::SwapBuffers() {
- glXSwapBuffers(g_display, window_);
+ glXSwapBuffers(g_display, glx_window_);
// For latency_tests.cc:
UNSHIPPED_TRACE_EVENT_INSTANT0("test_gpu", "CompositorSwapBuffersComplete");
return true;
@@ -483,7 +497,7 @@ gfx::Size NativeViewGLSurfaceGLX::GetSize() {
}
void* NativeViewGLSurfaceGLX::GetHandle() {
- return reinterpret_cast<void*>(window_);
+ return reinterpret_cast<void*>(glx_window_);
}
std::string NativeViewGLSurfaceGLX::GetExtensions() {
@@ -512,10 +526,10 @@ void* NativeViewGLSurfaceGLX::GetConfig() {
XWindowAttributes attributes;
if (!XGetWindowAttributes(
g_display,
- reinterpret_cast<GLXDrawable>(GetHandle()),
+ window_,
&attributes)) {
LOG(ERROR) << "XGetWindowAttributes failed for window " <<
- reinterpret_cast<GLXDrawable>(GetHandle()) << ".";
+ window_ << ".";
return NULL;
}
@@ -559,7 +573,7 @@ void* NativeViewGLSurfaceGLX::GetConfig() {
bool NativeViewGLSurfaceGLX::PostSubBuffer(
int x, int y, int width, int height) {
DCHECK(gfx::g_driver_glx.ext.b_GLX_MESA_copy_sub_buffer);
- glXCopySubBufferMESA(g_display, window_, x, y, width, height);
+ glXCopySubBufferMESA(g_display, glx_window_, x, y, width, height);
return true;
}
« no previous file with comments | « ui/gl/gl_surface_glx.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698