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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 GLContextGLX::GLContextGLX(GLShareGroup* share_group) | 47 GLContextGLX::GLContextGLX(GLShareGroup* share_group) |
48 : GLContext(share_group), | 48 : GLContext(share_group), |
49 context_(NULL) { | 49 context_(NULL) { |
50 } | 50 } |
51 | 51 |
52 GLContextGLX::~GLContextGLX() { | 52 GLContextGLX::~GLContextGLX() { |
53 Destroy(); | 53 Destroy(); |
54 } | 54 } |
55 | 55 |
56 bool GLContextGLX::Initialize(GLSurface* compatible_surface) { | 56 bool GLContextGLX::Initialize( |
| 57 GLSurface* compatible_surface, GpuPreference gpu_preference) { |
57 GLSurfaceGLX* surface_glx = static_cast<GLSurfaceGLX*>(compatible_surface); | 58 GLSurfaceGLX* surface_glx = static_cast<GLSurfaceGLX*>(compatible_surface); |
58 | 59 |
59 GLXContext share_handle = static_cast<GLXContext>( | 60 GLXContext share_handle = static_cast<GLXContext>( |
60 share_group() ? share_group()->GetHandle() : NULL); | 61 share_group() ? share_group()->GetHandle() : NULL); |
61 | 62 |
62 if (GLSurfaceGLX::IsCreateContextRobustnessSupported()) { | 63 if (GLSurfaceGLX::IsCreateContextRobustnessSupported()) { |
63 DLOG(INFO) << "GLX_ARB_create_context_robustness supported."; | 64 DLOG(INFO) << "GLX_ARB_create_context_robustness supported."; |
64 | 65 |
65 std::vector<int> attribs; | 66 std::vector<int> attribs; |
66 attribs.push_back(GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB); | 67 attribs.push_back(GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 } | 248 } |
248 | 249 |
249 return GLContext::GetExtensions(); | 250 return GLContext::GetExtensions(); |
250 } | 251 } |
251 | 252 |
252 bool GLContextGLX::WasAllocatedUsingARBRobustness() { | 253 bool GLContextGLX::WasAllocatedUsingARBRobustness() { |
253 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 254 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
254 } | 255 } |
255 | 256 |
256 } // namespace gfx | 257 } // namespace gfx |
OLD | NEW |