| 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_surface_glx.h" | 9 #include "ui/gfx/gl/gl_surface_glx.h" |
| 10 | 10 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 &visual_template, | 100 &visual_template, |
| 101 &num_visual_infos)); | 101 &num_visual_infos)); |
| 102 | 102 |
| 103 if (!num_visual_infos) | 103 if (!num_visual_infos) |
| 104 return false; | 104 return false; |
| 105 | 105 |
| 106 if (glXGetFBConfigFromVisualSGIX) { | 106 if (glXGetFBConfigFromVisualSGIX) { |
| 107 config_ = glXGetFBConfigFromVisualSGIX(g_display, visual_infos.get()); | 107 config_ = glXGetFBConfigFromVisualSGIX(g_display, visual_infos.get()); |
| 108 if (!config_) { | 108 if (!config_) { |
| 109 LOG(ERROR) << "glXGetFBConfigFromVisualSGIX failed."; | 109 LOG(ERROR) << "glXGetFBConfigFromVisualSGIX failed."; |
| 110 return false; | |
| 111 } | 110 } |
| 112 } else { | 111 } |
| 112 |
| 113 if (!config_) { |
| 113 int config_id; | 114 int config_id; |
| 114 if (glXGetConfig(g_display, | 115 if (glXGetConfig(g_display, |
| 115 visual_infos.get(), | 116 visual_infos.get(), |
| 116 GLX_FBCONFIG_ID, | 117 GLX_FBCONFIG_ID, |
| 117 &config_id)) { | 118 &config_id)) { |
| 118 LOG(ERROR) << "glXGetConfig failed."; | 119 LOG(ERROR) << "glXGetConfig failed."; |
| 119 return false; | 120 return false; |
| 120 } | 121 } |
| 121 | 122 |
| 122 const int config_attributes[] = { | 123 const int config_attributes[] = { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 | 272 |
| 272 void* PbufferGLSurfaceGLX::GetHandle() { | 273 void* PbufferGLSurfaceGLX::GetHandle() { |
| 273 return reinterpret_cast<void*>(pbuffer_); | 274 return reinterpret_cast<void*>(pbuffer_); |
| 274 } | 275 } |
| 275 | 276 |
| 276 void* PbufferGLSurfaceGLX::GetConfig() { | 277 void* PbufferGLSurfaceGLX::GetConfig() { |
| 277 return config_; | 278 return config_; |
| 278 } | 279 } |
| 279 | 280 |
| 280 } // namespace gfx | 281 } // namespace gfx |
| OLD | NEW |