| 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) | |
| 9 #include <windows.h> | |
| 10 #endif | |
| 11 | |
| 12 #include <string> | 8 #include <string> |
| 13 | 9 |
| 14 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 15 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 16 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
| 17 #include "ui/gfx/vsync_provider.h" | 13 #include "ui/gfx/vsync_provider.h" |
| 18 #include "ui/gl/gl_bindings.h" | 14 #include "ui/gl/gl_bindings.h" |
| 19 #include "ui/gl/gl_surface.h" | 15 #include "ui/gl/gl_surface.h" |
| 20 | 16 |
| 21 namespace gfx { | 17 namespace gfx { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 // initialization guards. | 37 // initialization guards. |
| 42 static const char* GetEGLExtensions(); | 38 static const char* GetEGLExtensions(); |
| 43 static bool HasEGLExtension(const char* name); | 39 static bool HasEGLExtension(const char* name); |
| 44 static bool IsCreateContextRobustnessSupported(); | 40 static bool IsCreateContextRobustnessSupported(); |
| 45 static bool IsEGLSurfacelessContextSupported(); | 41 static bool IsEGLSurfacelessContextSupported(); |
| 46 | 42 |
| 47 protected: | 43 protected: |
| 48 ~GLSurfaceEGL() override; | 44 ~GLSurfaceEGL() override; |
| 49 | 45 |
| 50 private: | 46 private: |
| 51 #if defined(OS_WIN) | |
| 52 friend struct DriverEGL; | |
| 53 static EGLDisplay GetPlatformDisplay(EGLNativeDisplayType native_display); | |
| 54 #endif | |
| 55 | |
| 56 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); | 47 DISALLOW_COPY_AND_ASSIGN(GLSurfaceEGL); |
| 57 }; | 48 }; |
| 58 | 49 |
| 59 // Encapsulates an EGL surface bound to a view. | 50 // Encapsulates an EGL surface bound to a view. |
| 60 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { | 51 class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL { |
| 61 public: | 52 public: |
| 62 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); | 53 explicit NativeViewGLSurfaceEGL(EGLNativeWindowType window); |
| 63 | 54 |
| 64 // Implement GLSurface. | 55 // Implement GLSurface. |
| 65 EGLConfig GetConfig() override; | 56 EGLConfig GetConfig() override; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 89 private: | 80 private: |
| 90 EGLSurface surface_; | 81 EGLSurface surface_; |
| 91 bool supports_post_sub_buffer_; | 82 bool supports_post_sub_buffer_; |
| 92 EGLConfig config_; | 83 EGLConfig config_; |
| 93 gfx::Size size_; | 84 gfx::Size size_; |
| 94 | 85 |
| 95 scoped_ptr<VSyncProvider> vsync_provider_; | 86 scoped_ptr<VSyncProvider> vsync_provider_; |
| 96 | 87 |
| 97 int swap_interval_; | 88 int swap_interval_; |
| 98 | 89 |
| 99 #if defined(OS_WIN) | |
| 100 bool vsync_override_; | |
| 101 | |
| 102 unsigned int swap_generation_; | |
| 103 static unsigned int current_swap_generation_; | |
| 104 static unsigned int swaps_this_generation_; | |
| 105 static unsigned int last_multiswap_generation_; | |
| 106 #endif | |
| 107 | |
| 108 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); | 90 DISALLOW_COPY_AND_ASSIGN(NativeViewGLSurfaceEGL); |
| 109 }; | 91 }; |
| 110 | 92 |
| 111 // Encapsulates a pbuffer EGL surface. | 93 // Encapsulates a pbuffer EGL surface. |
| 112 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { | 94 class GL_EXPORT PbufferGLSurfaceEGL : public GLSurfaceEGL { |
| 113 public: | 95 public: |
| 114 explicit PbufferGLSurfaceEGL(const gfx::Size& size); | 96 explicit PbufferGLSurfaceEGL(const gfx::Size& size); |
| 115 | 97 |
| 116 // Implement GLSurface. | 98 // Implement GLSurface. |
| 117 EGLConfig GetConfig() override; | 99 EGLConfig GetConfig() override; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 ~SurfacelessEGL() override; | 139 ~SurfacelessEGL() override; |
| 158 | 140 |
| 159 private: | 141 private: |
| 160 gfx::Size size_; | 142 gfx::Size size_; |
| 161 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 143 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
| 162 }; | 144 }; |
| 163 | 145 |
| 164 } // namespace gfx | 146 } // namespace gfx |
| 165 | 147 |
| 166 #endif // UI_GL_GL_SURFACE_EGL_H_ | 148 #endif // UI_GL_GL_SURFACE_EGL_H_ |
| OLD | NEW |