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