| 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 #ifndef UI_GL_GL_SURFACE_GLX_H_ | 5 #ifndef UI_GL_GL_SURFACE_GLX_H_ |
| 6 #define UI_GL_GL_SURFACE_GLX_H_ | 6 #define UI_GL_GL_SURFACE_GLX_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX, | 52 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX, |
| 53 public ui::PlatformEventDispatcher { | 53 public ui::PlatformEventDispatcher { |
| 54 public: | 54 public: |
| 55 explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window); | 55 explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window); |
| 56 | 56 |
| 57 // Implement GLSurfaceGLX. | 57 // Implement GLSurfaceGLX. |
| 58 bool Initialize() override; | 58 bool Initialize() override; |
| 59 void Destroy() override; | 59 void Destroy() override; |
| 60 bool Resize(const gfx::Size& size) override; | 60 bool Resize(const gfx::Size& size) override; |
| 61 bool IsOffscreen() override; | 61 bool IsOffscreen() override; |
| 62 bool SwapBuffers() override; | 62 gfx::SwapResult SwapBuffers() override; |
| 63 gfx::Size GetSize() override; | 63 gfx::Size GetSize() override; |
| 64 void* GetHandle() override; | 64 void* GetHandle() override; |
| 65 bool SupportsPostSubBuffer() override; | 65 bool SupportsPostSubBuffer() override; |
| 66 void* GetConfig() override; | 66 void* GetConfig() override; |
| 67 bool PostSubBuffer(int x, int y, int width, int height) override; | 67 gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override; |
| 68 VSyncProvider* GetVSyncProvider() override; | 68 VSyncProvider* GetVSyncProvider() override; |
| 69 | 69 |
| 70 protected: | 70 protected: |
| 71 ~NativeViewGLSurfaceGLX() override; | 71 ~NativeViewGLSurfaceGLX() override; |
| 72 | 72 |
| 73 private: | 73 private: |
| 74 // The handle for the drawable to make current or swap. | 74 // The handle for the drawable to make current or swap. |
| 75 gfx::AcceleratedWidget GetDrawableHandle() const; | 75 gfx::AcceleratedWidget GetDrawableHandle() const; |
| 76 | 76 |
| 77 // PlatformEventDispatcher implementation | 77 // PlatformEventDispatcher implementation |
| (...skipping 16 matching lines...) Expand all Loading... |
| 94 | 94 |
| 95 // A surface used to render to an offscreen pbuffer. | 95 // A surface used to render to an offscreen pbuffer. |
| 96 class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX { | 96 class GL_EXPORT PbufferGLSurfaceGLX : public GLSurfaceGLX { |
| 97 public: | 97 public: |
| 98 explicit PbufferGLSurfaceGLX(const gfx::Size& size); | 98 explicit PbufferGLSurfaceGLX(const gfx::Size& size); |
| 99 | 99 |
| 100 // Implement GLSurfaceGLX. | 100 // Implement GLSurfaceGLX. |
| 101 bool Initialize() override; | 101 bool Initialize() override; |
| 102 void Destroy() override; | 102 void Destroy() override; |
| 103 bool IsOffscreen() override; | 103 bool IsOffscreen() override; |
| 104 bool SwapBuffers() override; | 104 gfx::SwapResult SwapBuffers() override; |
| 105 gfx::Size GetSize() override; | 105 gfx::Size GetSize() override; |
| 106 void* GetHandle() override; | 106 void* GetHandle() override; |
| 107 void* GetConfig() override; | 107 void* GetConfig() override; |
| 108 | 108 |
| 109 protected: | 109 protected: |
| 110 ~PbufferGLSurfaceGLX() override; | 110 ~PbufferGLSurfaceGLX() override; |
| 111 | 111 |
| 112 private: | 112 private: |
| 113 gfx::Size size_; | 113 gfx::Size size_; |
| 114 void* config_; | 114 void* config_; |
| 115 XID pbuffer_; | 115 XID pbuffer_; |
| 116 | 116 |
| 117 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); | 117 DISALLOW_COPY_AND_ASSIGN(PbufferGLSurfaceGLX); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace gfx | 120 } // namespace gfx |
| 121 | 121 |
| 122 #endif // UI_GL_GL_SURFACE_GLX_H_ | 122 #endif // UI_GL_GL_SURFACE_GLX_H_ |
| OLD | NEW |