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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 207 |
208 bool PbufferGLSurfaceGLX::Initialize() { | 208 bool PbufferGLSurfaceGLX::Initialize() { |
209 DCHECK(!pbuffer_); | 209 DCHECK(!pbuffer_); |
210 | 210 |
211 static const int config_attributes[] = { | 211 static const int config_attributes[] = { |
212 GLX_BUFFER_SIZE, 32, | 212 GLX_BUFFER_SIZE, 32, |
213 GLX_ALPHA_SIZE, 8, | 213 GLX_ALPHA_SIZE, 8, |
214 GLX_BLUE_SIZE, 8, | 214 GLX_BLUE_SIZE, 8, |
215 GLX_GREEN_SIZE, 8, | 215 GLX_GREEN_SIZE, 8, |
216 GLX_RED_SIZE, 8, | 216 GLX_RED_SIZE, 8, |
217 GLX_DEPTH_SIZE, 16, // TODO(apatrick): support optional depth buffer | |
218 GLX_STENCIL_SIZE, 8, | |
219 GLX_RENDER_TYPE, GLX_RGBA_BIT, | 217 GLX_RENDER_TYPE, GLX_RGBA_BIT, |
220 GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, | 218 GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT, |
221 GLX_DOUBLEBUFFER, False, | 219 GLX_DOUBLEBUFFER, False, |
222 0 | 220 0 |
223 }; | 221 }; |
224 | 222 |
225 int num_elements = 0; | 223 int num_elements = 0; |
226 scoped_ptr_malloc<GLXFBConfig, ScopedPtrXFree> configs( | 224 scoped_ptr_malloc<GLXFBConfig, ScopedPtrXFree> configs( |
227 glXChooseFBConfig(g_display, | 225 glXChooseFBConfig(g_display, |
228 DefaultScreen(g_display), | 226 DefaultScreen(g_display), |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 278 |
281 void* PbufferGLSurfaceGLX::GetHandle() { | 279 void* PbufferGLSurfaceGLX::GetHandle() { |
282 return reinterpret_cast<void*>(pbuffer_); | 280 return reinterpret_cast<void*>(pbuffer_); |
283 } | 281 } |
284 | 282 |
285 void* PbufferGLSurfaceGLX::GetConfig() { | 283 void* PbufferGLSurfaceGLX::GetConfig() { |
286 return config_; | 284 return config_; |
287 } | 285 } |
288 | 286 |
289 } // namespace gfx | 287 } // namespace gfx |
OLD | NEW |