| 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/gfx/gl/gl_surface_glx.h" | 9 #include "ui/gfx/gl/gl_surface_glx.h" |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 Destroy(); | 117 Destroy(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool NativeViewGLSurfaceGLX::Initialize() { | 120 bool NativeViewGLSurfaceGLX::Initialize() { |
| 121 return true; | 121 return true; |
| 122 } | 122 } |
| 123 | 123 |
| 124 void NativeViewGLSurfaceGLX::Destroy() { | 124 void NativeViewGLSurfaceGLX::Destroy() { |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool NativeViewGLSurfaceGLX::Resize(const gfx::Size& size) { |
| 128 // On Intel drivers, the frame buffer won't be resize until the next swap. If |
| 129 // we only do PostSubBuffer, then we're stuck in the old size. Force a swap |
| 130 // now. |
| 131 if (gfx::g_GLX_MESA_copy_sub_buffer) |
| 132 SwapBuffers(); |
| 133 return true; |
| 134 } |
| 135 |
| 127 bool NativeViewGLSurfaceGLX::IsOffscreen() { | 136 bool NativeViewGLSurfaceGLX::IsOffscreen() { |
| 128 return false; | 137 return false; |
| 129 } | 138 } |
| 130 | 139 |
| 131 bool NativeViewGLSurfaceGLX::SwapBuffers() { | 140 bool NativeViewGLSurfaceGLX::SwapBuffers() { |
| 132 glXSwapBuffers(g_display, window_); | 141 glXSwapBuffers(g_display, window_); |
| 133 return true; | 142 return true; |
| 134 } | 143 } |
| 135 | 144 |
| 136 gfx::Size NativeViewGLSurfaceGLX::GetSize() { | 145 gfx::Size NativeViewGLSurfaceGLX::GetSize() { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 | 315 |
| 307 void* PbufferGLSurfaceGLX::GetHandle() { | 316 void* PbufferGLSurfaceGLX::GetHandle() { |
| 308 return reinterpret_cast<void*>(pbuffer_); | 317 return reinterpret_cast<void*>(pbuffer_); |
| 309 } | 318 } |
| 310 | 319 |
| 311 void* PbufferGLSurfaceGLX::GetConfig() { | 320 void* PbufferGLSurfaceGLX::GetConfig() { |
| 312 return config_; | 321 return config_; |
| 313 } | 322 } |
| 314 | 323 |
| 315 } // namespace gfx | 324 } // namespace gfx |
| OLD | NEW |