| 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_surface_glx.h" | 9 #include "ui/gl/gl_surface_glx.h" |
| 10 | 10 |
| (...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 } | 608 } |
| 609 | 609 |
| 610 gfx::Size NativeViewGLSurfaceGLX::GetSize() { | 610 gfx::Size NativeViewGLSurfaceGLX::GetSize() { |
| 611 return size_; | 611 return size_; |
| 612 } | 612 } |
| 613 | 613 |
| 614 void* NativeViewGLSurfaceGLX::GetHandle() { | 614 void* NativeViewGLSurfaceGLX::GetHandle() { |
| 615 return reinterpret_cast<void*>(GetDrawableHandle()); | 615 return reinterpret_cast<void*>(GetDrawableHandle()); |
| 616 } | 616 } |
| 617 | 617 |
| 618 std::string NativeViewGLSurfaceGLX::GetExtensions() { | 618 bool NativeViewGLSurfaceGLX::SupportsPostSubBuffer() { |
| 619 std::string extensions = GLSurface::GetExtensions(); | 619 return gfx::g_driver_glx.ext.b_GLX_MESA_copy_sub_buffer; |
| 620 if (gfx::g_driver_glx.ext.b_GLX_MESA_copy_sub_buffer) { | |
| 621 extensions += extensions.empty() ? "" : " "; | |
| 622 extensions += "GL_CHROMIUM_post_sub_buffer"; | |
| 623 } | |
| 624 return extensions; | |
| 625 } | 620 } |
| 626 | 621 |
| 627 void* NativeViewGLSurfaceGLX::GetConfig() { | 622 void* NativeViewGLSurfaceGLX::GetConfig() { |
| 628 if (!config_) { | 623 if (!config_) { |
| 629 // This code path is expensive, but we only take it when | 624 // This code path is expensive, but we only take it when |
| 630 // attempting to use GLX_ARB_create_context_robustness, in which | 625 // attempting to use GLX_ARB_create_context_robustness, in which |
| 631 // case we need a GLXFBConfig for the window in order to create a | 626 // case we need a GLXFBConfig for the window in order to create a |
| 632 // context for it. | 627 // context for it. |
| 633 // | 628 // |
| 634 // TODO(kbr): this is not a reliable code path. On platforms which | 629 // TODO(kbr): this is not a reliable code path. On platforms which |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 794 | 789 |
| 795 void* PbufferGLSurfaceGLX::GetConfig() { | 790 void* PbufferGLSurfaceGLX::GetConfig() { |
| 796 return config_; | 791 return config_; |
| 797 } | 792 } |
| 798 | 793 |
| 799 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { | 794 PbufferGLSurfaceGLX::~PbufferGLSurfaceGLX() { |
| 800 Destroy(); | 795 Destroy(); |
| 801 } | 796 } |
| 802 | 797 |
| 803 } // namespace gfx | 798 } // namespace gfx |
| OLD | NEW |