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 extern "C" { | 5 extern "C" { |
6 #include <X11/Xlib.h> | 6 #include <X11/Xlib.h> |
7 } | 7 } |
8 | 8 |
9 #include "ui/gl/gl_context_glx.h" | 9 #include "ui/gl/gl_context_glx.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 // scoped_ptr functor for XFree(). Use as follows: | 23 // scoped_ptr functor for XFree(). Use as follows: |
24 // scoped_ptr_malloc<XVisualInfo, ScopedPtrXFree> foo(...); | 24 // scoped_ptr_malloc<XVisualInfo, ScopedPtrXFree> foo(...); |
25 // where "XVisualInfo" is any X type that is freed with XFree. | 25 // where "XVisualInfo" is any X type that is freed with XFree. |
26 class ScopedPtrXFree { | 26 class ScopedPtrXFree { |
27 public: | 27 public: |
28 void operator()(void* x) const { | 28 void operator()(void* x) const { |
29 ::XFree(x); | 29 ::XFree(x); |
30 } | 30 } |
31 }; | 31 }; |
32 | 32 |
33 } // namespace anonymous | 33 } // namespace |
34 | 34 |
35 GLContextGLX::GLContextGLX(GLShareGroup* share_group) | 35 GLContextGLX::GLContextGLX(GLShareGroup* share_group) |
36 : GLContext(share_group), | 36 : GLContext(share_group), |
37 context_(NULL), | 37 context_(NULL), |
38 display_(NULL) { | 38 display_(NULL) { |
39 } | 39 } |
40 | 40 |
41 Display* GLContextGLX::display() { | 41 Display* GLContextGLX::display() { |
42 return display_; | 42 return display_; |
43 } | 43 } |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 bool GLContextGLX::WasAllocatedUsingARBRobustness() { | 247 bool GLContextGLX::WasAllocatedUsingARBRobustness() { |
248 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 248 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
249 } | 249 } |
250 | 250 |
251 GLContextGLX::~GLContextGLX() { | 251 GLContextGLX::~GLContextGLX() { |
252 Destroy(); | 252 Destroy(); |
253 } | 253 } |
254 | 254 |
255 } // namespace gfx | 255 } // namespace gfx |
OLD | NEW |