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 |
11 | 11 |
| 12 #include <memory> |
12 #include <string> | 13 #include <string> |
13 | 14 |
14 #include "base/command_line.h" | 15 #include "base/command_line.h" |
15 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
16 #include "base/macros.h" | 17 #include "base/macros.h" |
17 #include "base/memory/scoped_ptr.h" | |
18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
19 #include "build/build_config.h" | 19 #include "build/build_config.h" |
20 #include "ui/gfx/geometry/size.h" | 20 #include "ui/gfx/geometry/size.h" |
21 #include "ui/gfx/vsync_provider.h" | 21 #include "ui/gfx/vsync_provider.h" |
22 #include "ui/gl/gl_bindings.h" | 22 #include "ui/gl/gl_bindings.h" |
23 #include "ui/gl/gl_surface.h" | 23 #include "ui/gl/gl_surface.h" |
24 #include "ui/gl/gl_surface_overlay.h" | 24 #include "ui/gl/gl_surface_overlay.h" |
25 | 25 |
26 namespace gfx { | 26 namespace gfx { |
27 | 27 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 bool ScheduleOverlayPlane(int z_order, | 105 bool ScheduleOverlayPlane(int z_order, |
106 OverlayTransform transform, | 106 OverlayTransform transform, |
107 gl::GLImage* image, | 107 gl::GLImage* image, |
108 const Rect& bounds_rect, | 108 const Rect& bounds_rect, |
109 const RectF& crop_rect) override; | 109 const RectF& crop_rect) override; |
110 bool FlipsVertically() const override; | 110 bool FlipsVertically() const override; |
111 bool BuffersFlipped() const override; | 111 bool BuffersFlipped() const override; |
112 | 112 |
113 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. | 113 // Create a NativeViewGLSurfaceEGL with an externally provided VSyncProvider. |
114 // Takes ownership of the VSyncProvider. | 114 // Takes ownership of the VSyncProvider. |
115 virtual bool Initialize(scoped_ptr<VSyncProvider> sync_provider); | 115 virtual bool Initialize(std::unique_ptr<VSyncProvider> sync_provider); |
116 | 116 |
117 // Takes care of the platform dependant bits, of any, for creating the window. | 117 // Takes care of the platform dependant bits, of any, for creating the window. |
118 virtual bool InitializeNativeWindow(); | 118 virtual bool InitializeNativeWindow(); |
119 | 119 |
120 protected: | 120 protected: |
121 ~NativeViewGLSurfaceEGL() override; | 121 ~NativeViewGLSurfaceEGL() override; |
122 | 122 |
123 EGLNativeWindowType window_; | 123 EGLNativeWindowType window_; |
124 gfx::Size size_; | 124 gfx::Size size_; |
125 bool enable_fixed_size_angle_; | 125 bool enable_fixed_size_angle_; |
126 | 126 |
127 void OnSetSwapInterval(int interval) override; | 127 void OnSetSwapInterval(int interval) override; |
128 | 128 |
129 private: | 129 private: |
130 // Commit the |pending_overlays_| and clear the vector. Returns false if any | 130 // Commit the |pending_overlays_| and clear the vector. Returns false if any |
131 // fail to be committed. | 131 // fail to be committed. |
132 bool CommitAndClearPendingOverlays(); | 132 bool CommitAndClearPendingOverlays(); |
133 | 133 |
134 EGLSurface surface_; | 134 EGLSurface surface_; |
135 bool supports_post_sub_buffer_; | 135 bool supports_post_sub_buffer_; |
136 bool flips_vertically_; | 136 bool flips_vertically_; |
137 | 137 |
138 scoped_ptr<VSyncProvider> vsync_provider_; | 138 std::unique_ptr<VSyncProvider> vsync_provider_; |
139 | 139 |
140 int swap_interval_; | 140 int swap_interval_; |
141 | 141 |
142 std::vector<GLSurfaceOverlay> pending_overlays_; | 142 std::vector<GLSurfaceOverlay> pending_overlays_; |
143 | 143 |
144 #if defined(OS_WIN) | 144 #if defined(OS_WIN) |
145 bool vsync_override_; | 145 bool vsync_override_; |
146 | 146 |
147 unsigned int swap_generation_; | 147 unsigned int swap_generation_; |
148 static unsigned int current_swap_generation_; | 148 static unsigned int current_swap_generation_; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 ~SurfacelessEGL() override; | 206 ~SurfacelessEGL() override; |
207 | 207 |
208 private: | 208 private: |
209 gfx::Size size_; | 209 gfx::Size size_; |
210 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); | 210 DISALLOW_COPY_AND_ASSIGN(SurfacelessEGL); |
211 }; | 211 }; |
212 | 212 |
213 } // namespace gfx | 213 } // namespace gfx |
214 | 214 |
215 #endif // UI_GL_GL_SURFACE_EGL_H_ | 215 #endif // UI_GL_GL_SURFACE_EGL_H_ |
OLD | NEW |