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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 GLContextGLX::GLContextGLX(GLShareGroup* share_group) | 152 GLContextGLX::GLContextGLX(GLShareGroup* share_group) |
153 : GLContextReal(share_group), | 153 : GLContextReal(share_group), |
154 context_(nullptr), | 154 context_(nullptr), |
155 display_(nullptr) { | 155 display_(nullptr) { |
156 } | 156 } |
157 | 157 |
158 XDisplay* GLContextGLX::display() { | 158 XDisplay* GLContextGLX::display() { |
159 return display_; | 159 return display_; |
160 } | 160 } |
161 | 161 |
162 bool GLContextGLX::Initialize( | 162 bool GLContextGLX::Initialize(GLSurface* compatible_surface, |
163 GLSurface* compatible_surface, GpuPreference gpu_preference) { | 163 const GLContextAttribs& attribs) { |
164 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay()); | 164 display_ = static_cast<XDisplay*>(compatible_surface->GetDisplay()); |
165 | 165 |
166 GLXContext share_handle = static_cast<GLXContext>( | 166 GLXContext share_handle = static_cast<GLXContext>( |
167 share_group() ? share_group()->GetHandle() : nullptr); | 167 share_group() ? share_group()->GetHandle() : nullptr); |
168 | 168 |
169 if (GLSurfaceGLX::IsCreateContextSupported()) { | 169 if (GLSurfaceGLX::IsCreateContextSupported()) { |
170 DVLOG(1) << "GLX_ARB_create_context supported."; | 170 DVLOG(1) << "GLX_ARB_create_context supported."; |
171 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 171 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
172 switches::kCreateDefaultGLContext)) { | 172 switches::kCreateDefaultGLContext)) { |
173 context_ = CreateContextAttribs( | 173 context_ = CreateContextAttribs( |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 319 |
320 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { | 320 bool GLContextGLX::WasAllocatedUsingRobustnessExtension() { |
321 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 321 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
322 } | 322 } |
323 | 323 |
324 GLContextGLX::~GLContextGLX() { | 324 GLContextGLX::~GLContextGLX() { |
325 Destroy(); | 325 Destroy(); |
326 } | 326 } |
327 | 327 |
328 } // namespace gl | 328 } // namespace gl |
OLD | NEW |