OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/gl/gl_context_glx.h" | 5 #include "ui/gl/gl_context_glx.h" |
6 | 6 |
7 extern "C" { | 7 extern "C" { |
8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 } | 9 } |
10 #include <memory> | 10 #include <memory> |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 static_cast<GLXContext>(context_))) { | 107 static_cast<GLXContext>(context_))) { |
108 LOG(ERROR) << "Couldn't make context current with X drawable."; | 108 LOG(ERROR) << "Couldn't make context current with X drawable."; |
109 Destroy(); | 109 Destroy(); |
110 return false; | 110 return false; |
111 } | 111 } |
112 | 112 |
113 // Set this as soon as the context is current, since we might call into GL. | 113 // Set this as soon as the context is current, since we might call into GL. |
114 SetRealGLApi(); | 114 SetRealGLApi(); |
115 | 115 |
116 SetCurrent(surface); | 116 SetCurrent(surface); |
117 if (!InitializeDynamicBindings()) { | 117 InitializeDynamicBindings(); |
118 Destroy(); | |
119 return false; | |
120 } | |
121 | 118 |
122 if (!surface->OnMakeCurrent(this)) { | 119 if (!surface->OnMakeCurrent(this)) { |
123 LOG(ERROR) << "Could not make current."; | 120 LOG(ERROR) << "Could not make current."; |
124 Destroy(); | 121 Destroy(); |
125 return false; | 122 return false; |
126 } | 123 } |
127 | 124 |
128 release_current.Cancel(); | 125 release_current.Cancel(); |
129 return true; | 126 return true; |
130 } | 127 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 192 |
196 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { | 193 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { |
197 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 194 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
198 } | 195 } |
199 | 196 |
200 GLContextGLX::~GLContextGLX() { | 197 GLContextGLX::~GLContextGLX() { |
201 Destroy(); | 198 Destroy(); |
202 } | 199 } |
203 | 200 |
204 } // namespace gl | 201 } // namespace gl |
OLD | NEW |