| 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 bool vsync_override_; |
| 97 |
| 98 #if defined(OS_WIN) |
| 99 unsigned int swap_generation_; |
| 100 static unsigned int current_swap_generation_; |
| 101 static unsigned int swaps_this_generation_; |
| 102 static unsigned int last_multiswap_generation_; |
| 103 #endif |
| 104 |
| 93 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); | 105 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); |
| 94 }; | 106 }; |
| 95 | 107 |
| 96 // Encapsulates a pbuffer EGL surface. | 108 // Encapsulates a pbuffer EGL surface. |
| 97 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { | 109 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { |
| 98 public: | 110 public: |
| 99 explicit PbufferGLSurfaceEGL(const gfx::Size& size); | 111 explicit PbufferGLSurfaceEGL(const gfx::Size& size); |
| 100 | 112 |
| 101 // Implement GLSurface. | 113 // Implement GLSurface. |
| 102 EGLConfig GetConfig() override; | 114 EGLConfig GetConfig() override; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 ~SurfacelessEGL() override; | 154 ~SurfacelessEGL() override; |
| 143 | 155 |
| 144 private: | 156 private: |
| 145 gfx::Size size_; | 157 gfx::Size size_; |
| 146 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 158 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 147 }; | 159 }; |
| 148 | 160 |
| 149 } // namespace gfx | 161 } // namespace gfx |
| 150 | 162 |
| 151 #endif // UI_GL_GL_SURFACE_EGL_H_ | 163 #endif // UI_GL_GL_SURFACE_EGL_H_ |
| OLD | NEW |