| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 extern "C" { | 5 extern "C" { |
| 6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
| 7 } | 7 } |
| 8 | 8 |
| 9 #include "ui/gfx/gl/gl_context_glx.h" | 9 #include "ui/gfx/gl/gl_context_glx.h" |
| 10 | 10 |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 if (!glXMakeCurrent( | 171 if (!glXMakeCurrent( |
| 172 display_, | 172 display_, |
| 173 reinterpret_cast<GLXDrawable>(surface->GetHandle()), | 173 reinterpret_cast<GLXDrawable>(surface->GetHandle()), |
| 174 static_cast<GLXContext>(context_))) { | 174 static_cast<GLXContext>(context_))) { |
| 175 LOG(ERROR) << "Couldn't make context current with X drawable."; | 175 LOG(ERROR) << "Couldn't make context current with X drawable."; |
| 176 Destroy(); | 176 Destroy(); |
| 177 return false; | 177 return false; |
| 178 } | 178 } |
| 179 | 179 |
| 180 SetCurrent(this, surface); | 180 SetCurrent(this, surface); |
| 181 if (!InitializeExtensionBindings()) { |
| 182 ReleaseCurrent(surface); |
| 183 return false; |
| 184 } |
| 185 |
| 181 if (!surface->OnMakeCurrent(this)) { | 186 if (!surface->OnMakeCurrent(this)) { |
| 182 LOG(ERROR) << "Could not make current."; | 187 LOG(ERROR) << "Could not make current."; |
| 183 return false; | 188 return false; |
| 184 } | 189 } |
| 185 | 190 |
| 186 return true; | 191 return true; |
| 187 } | 192 } |
| 188 | 193 |
| 189 void GLContextGLX::ReleaseCurrent(GLSurface* surface) { | 194 void GLContextGLX::ReleaseCurrent(GLSurface* surface) { |
| 190 if (!IsCurrent(surface)) | 195 if (!IsCurrent(surface)) |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 258 } |
| 254 | 259 |
| 255 return GLContext::GetExtensions(); | 260 return GLContext::GetExtensions(); |
| 256 } | 261 } |
| 257 | 262 |
| 258 bool GLContextGLX::WasAllocatedUsingARBRobustness() { | 263 bool GLContextGLX::WasAllocatedUsingARBRobustness() { |
| 259 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 264 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
| 260 } | 265 } |
| 261 | 266 |
| 262 } // namespace gfx | 267 } // namespace gfx |
| OLD | NEW |