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_EGL_H_ | 5 #ifndef UI_GL_GL_SURFACE_EGL_H_ |
6 #define UI_GL_GL_SURFACE_EGL_H_ | 6 #define UI_GL_GL_SURFACE_EGL_H_ |
7 | 7 |
8 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif | 10 #endif |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 75 |
76 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. | 76 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. |
77 // Takes ownership of the VSyncProvider. | 77 // Takes ownership of the VSyncProvider. |
78 virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider); | 78 virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider); |
79 | 79 |
80 protected: | 80 protected: |
81 ~NativeViewGLSurfaceEGL() override; | 81 ~NativeViewGLSurfaceEGL() override; |
82 | 82 |
83 EGLNativeWindowType window_; | 83 EGLNativeWindowType window_; |
84 | 84 |
| 85 virtual void SetSwapInterval(int interval) override; |
| 86 |
85 private: | 87 private: |
86 EGLSurface surface_; | 88 EGLSurface surface_; |
87 bool supports_post_sub_buffer_; | 89 bool supports_post_sub_buffer_; |
88 EGLConfig config_; | 90 EGLConfig config_; |
89 gfx::Size size_; | 91 gfx::Size size_; |
90 | 92 |
91 scoped_ptr<VSyncProvider> vsync_provider_; | 93 scoped_ptr<VSyncProvider> vsync_provider_; |
92 | 94 |
| 95 int swap_interval_; |
| 96 unsigned int swap_generation_; |
| 97 static unsigned int current_swap_generation_; |
| 98 |
93 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); | 99 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); |
94 }; | 100 }; |
95 | 101 |
96 // Encapsulates a pbuffer EGL surface. | 102 // Encapsulates a pbuffer EGL surface. |
97 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { | 103 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { |
98 public: | 104 public: |
99 explicit PbufferGLSurfaceEGL(const gfx::Size& size); | 105 explicit PbufferGLSurfaceEGL(const gfx::Size& size); |
100 | 106 |
101 // Implement GLSurface. | 107 // Implement GLSurface. |
102 EGLConfig GetConfig() override; | 108 EGLConfig GetConfig() override; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 ~SurfacelessEGL() override; | 148 ~SurfacelessEGL() override; |
143 | 149 |
144 private: | 150 private: |
145 gfx::Size size_; | 151 gfx::Size size_; |
146 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 152 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
147 }; | 153 }; |
148 | 154 |
149 } // namespace gfx | 155 } // namespace gfx |
150 | 156 |
151 #endif // UI_GL_GL_SURFACE_EGL_H_ | 157 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |