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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 if (!glXMakeCurrent( | 165 if (!glXMakeCurrent( |
166 GLSurfaceGLX::GetDisplay(), | 166 GLSurfaceGLX::GetDisplay(), |
167 reinterpret_cast<GLXDrawable>(surface->GetHandle()), | 167 reinterpret_cast<GLXDrawable>(surface->GetHandle()), |
168 static_cast<GLXContext>(context_))) { | 168 static_cast<GLXContext>(context_))) { |
169 LOG(ERROR) << "Couldn't make context current with X drawable."; | 169 LOG(ERROR) << "Couldn't make context current with X drawable."; |
170 Destroy(); | 170 Destroy(); |
171 return false; | 171 return false; |
172 } | 172 } |
173 | 173 |
| 174 surface->OnMakeCurrent(); |
174 return true; | 175 return true; |
175 } | 176 } |
176 | 177 |
177 void GLContextGLX::ReleaseCurrent(GLSurface* surface) { | 178 void GLContextGLX::ReleaseCurrent(GLSurface* surface) { |
178 if (!IsCurrent(surface)) | 179 if (!IsCurrent(surface)) |
179 return; | 180 return; |
180 | 181 |
181 glXMakeContextCurrent(GLSurfaceGLX::GetDisplay(), 0, 0, NULL); | 182 glXMakeContextCurrent(GLSurfaceGLX::GetDisplay(), 0, 0, NULL); |
182 } | 183 } |
183 | 184 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 } | 233 } |
233 | 234 |
234 return GLContext::GetExtensions(); | 235 return GLContext::GetExtensions(); |
235 } | 236 } |
236 | 237 |
237 bool GLContextGLX::WasAllocatedUsingARBRobustness() { | 238 bool GLContextGLX::WasAllocatedUsingARBRobustness() { |
238 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 239 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
239 } | 240 } |
240 | 241 |
241 } // namespace gfx | 242 } // namespace gfx |
OLD | NEW |