| 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 20 matching lines...) Expand all Loading... |
| 31 }; | 31 }; |
| 32 | 32 |
| 33 } // namespace anonymous | 33 } // namespace anonymous |
| 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 GLContextGLX::~GLContextGLX() { | |
| 42 Destroy(); | |
| 43 } | |
| 44 | |
| 45 Display* GLContextGLX::display() { | 41 Display* GLContextGLX::display() { |
| 46 return display_; | 42 return display_; |
| 47 } | 43 } |
| 48 | 44 |
| 49 bool GLContextGLX::Initialize( | 45 bool GLContextGLX::Initialize( |
| 50 GLSurface* compatible_surface, GpuPreference gpu_preference) { | 46 GLSurface* compatible_surface, GpuPreference gpu_preference) { |
| 51 display_ = static_cast<Display*>(compatible_surface->GetDisplay()); | 47 display_ = static_cast<Display*>(compatible_surface->GetDisplay()); |
| 52 | 48 |
| 53 GLXContext share_handle = static_cast<GLXContext>( | 49 GLXContext share_handle = static_cast<GLXContext>( |
| 54 share_group() ? share_group()->GetHandle() : NULL); | 50 share_group() ? share_group()->GetHandle() : NULL); |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 return GLContext::GetExtensions() + " " + extensions; | 239 return GLContext::GetExtensions() + " " + extensions; |
| 244 } | 240 } |
| 245 | 241 |
| 246 return GLContext::GetExtensions(); | 242 return GLContext::GetExtensions(); |
| 247 } | 243 } |
| 248 | 244 |
| 249 bool GLContextGLX::WasAllocatedUsingARBRobustness() { | 245 bool GLContextGLX::WasAllocatedUsingARBRobustness() { |
| 250 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); | 246 return GLSurfaceGLX::IsCreateContextRobustnessSupported(); |
| 251 } | 247 } |
| 252 | 248 |
| 249 GLContextGLX::~GLContextGLX() { |
| 250 Destroy(); |
| 251 } |
| 252 |
| 253 } // namespace gfx | 253 } // namespace gfx |
| OLD | NEW |