| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 private: | 54 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLX); | 55 DISALLOW_COPY_AND_ASSIGN(GLSurfaceGLX); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 // A surface used to render to a view. | 58 // A surface used to render to a view. |
| 59 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX { | 59 class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX { |
| 60 public: | 60 public: |
| 61 explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window); | 61 explicit NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window); |
| 62 | 62 |
| 63 // Implement GLSurfaceGLX. | 63 // Implement GLSurfaceGLX. |
| 64 bool Initialize(GLSurface::Format format) override; | 64 bool Initialize(GLSurfaceFormat format) override; |
| 65 void Destroy() override; | 65 void Destroy() override; |
| 66 bool Resize(const gfx::Size& size, | 66 bool Resize(const gfx::Size& size, |
| 67 float scale_factor, | 67 float scale_factor, |
| 68 bool has_alpha) override; | 68 bool has_alpha) override; |
| 69 bool IsOffscreen() override; | 69 bool IsOffscreen() override; |
| 70 gfx::SwapResult SwapBuffers() override; | 70 gfx::SwapResult SwapBuffers() override; |
| 71 gfx::Size GetSize() override; | 71 gfx::Size GetSize() override; |
| 72 void* GetHandle() override; | 72 void* GetHandle() override; |
| 73 bool SupportsPostSubBuffer() override; | 73 bool SupportsPostSubBuffer() override; |
| 74 void* GetConfig() override; | 74 void* GetConfig() override; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); | 114 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceGLX); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 // A surface used to render to an offscreen pbuffer. | 117 // A surface used to render to an offscreen pbuffer. |
| 118 class GL_EXPORT UnmappedNativeViewGLSurfaceGLX : public GLSurfaceGLX { | 118 class GL_EXPORT UnmappedNativeViewGLSurfaceGLX : public GLSurfaceGLX { |
| 119 public: | 119 public: |
| 120 explicit UnmappedNativeViewGLSurfaceGLX(const gfx::Size& size); | 120 explicit UnmappedNativeViewGLSurfaceGLX(const gfx::Size& size); |
| 121 | 121 |
| 122 // Implement GLSurfaceGLX. | 122 // Implement GLSurfaceGLX. |
| 123 bool Initialize(GLSurface::Format format) override; | 123 bool Initialize(GLSurfaceFormat format) override; |
| 124 void Destroy() override; | 124 void Destroy() override; |
| 125 bool IsOffscreen() override; | 125 bool IsOffscreen() override; |
| 126 gfx::SwapResult SwapBuffers() override; | 126 gfx::SwapResult SwapBuffers() override; |
| 127 gfx::Size GetSize() override; | 127 gfx::Size GetSize() override; |
| 128 void* GetHandle() override; | 128 void* GetHandle() override; |
| 129 void* GetConfig() override; | 129 void* GetConfig() override; |
| 130 unsigned long GetCompatibilityKey() override; | 130 unsigned long GetCompatibilityKey() override; |
| 131 | 131 |
| 132 protected: | 132 protected: |
| 133 ~UnmappedNativeViewGLSurfaceGLX() override; | 133 ~UnmappedNativeViewGLSurfaceGLX() override; |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 gfx::Size size_; | 136 gfx::Size size_; |
| 137 GLXFBConfig config_; | 137 GLXFBConfig config_; |
| 138 // Unmapped dummy window, used to provide a compatible surface. | 138 // Unmapped dummy window, used to provide a compatible surface. |
| 139 gfx::AcceleratedWidget window_; | 139 gfx::AcceleratedWidget window_; |
| 140 | 140 |
| 141 // GLXDrawable for the window. | 141 // GLXDrawable for the window. |
| 142 GLXWindow glx_window_; | 142 GLXWindow glx_window_; |
| 143 | 143 |
| 144 DISALLOW_COPY_AND_ASSIGN(UnmappedNativeViewGLSurfaceGLX); | 144 DISALLOW_COPY_AND_ASSIGN(UnmappedNativeViewGLSurfaceGLX); |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 } // namespace gl | 147 } // namespace gl |
| 148 | 148 |
| 149 #endif // UI_GL_GL_SURFACE_GLX_H_ | 149 #endif // UI_GL_GL_SURFACE_GLX_H_ |
| OLD | NEW |