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_H_ | 5 #ifndef UI_GL_GL_SURFACE_H_ |
6 #define UI_GL_GL_SURFACE_H_ | 6 #define UI_GL_GL_SURFACE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "ui/gfx/geometry/rect.h" |
| 14 #include "ui/gfx/geometry/rect_f.h" |
| 15 #include "ui/gfx/geometry/size.h" |
13 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
14 #include "ui/gfx/overlay_transform.h" | 17 #include "ui/gfx/overlay_transform.h" |
15 #include "ui/gfx/rect.h" | |
16 #include "ui/gfx/rect_f.h" | |
17 #include "ui/gfx/size.h" | |
18 #include "ui/gl/gl_export.h" | 18 #include "ui/gl/gl_export.h" |
19 #include "ui/gl/gl_implementation.h" | 19 #include "ui/gl/gl_implementation.h" |
20 | 20 |
21 namespace gfx { | 21 namespace gfx { |
22 | 22 |
23 class GLContext; | 23 class GLContext; |
24 class GLImage; | 24 class GLImage; |
25 class VSyncProvider; | 25 class VSyncProvider; |
26 | 26 |
27 // Encapsulates a surface that can be rendered to with GL, hiding platform | 27 // Encapsulates a surface that can be rendered to with GL, hiding platform |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 // Create a GL surface that renders directly to a view. | 155 // Create a GL surface that renders directly to a view. |
156 static scoped_refptr<GLSurface> CreateViewGLSurface( | 156 static scoped_refptr<GLSurface> CreateViewGLSurface( |
157 gfx::AcceleratedWidget window); | 157 gfx::AcceleratedWidget window); |
158 | 158 |
159 // Create a GL surface used for offscreen rendering. | 159 // Create a GL surface used for offscreen rendering. |
160 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( | 160 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( |
161 const gfx::Size& size); | 161 const gfx::Size& size); |
162 | 162 |
163 static GLSurface* GetCurrent(); | 163 static GLSurface* GetCurrent(); |
164 | 164 |
| 165 // Called when the swap interval for the associated context changes. |
| 166 virtual void OnSetSwapInterval(int interval); |
| 167 |
165 protected: | 168 protected: |
166 virtual ~GLSurface(); | 169 virtual ~GLSurface(); |
167 static bool InitializeOneOffImplementation(GLImplementation impl, | 170 static bool InitializeOneOffImplementation(GLImplementation impl, |
168 bool fallback_to_osmesa, | 171 bool fallback_to_osmesa, |
169 bool gpu_service_logging, | 172 bool gpu_service_logging, |
170 bool disable_gl_drawing); | 173 bool disable_gl_drawing); |
171 static bool InitializeOneOffInternal(); | 174 static bool InitializeOneOffInternal(); |
172 static void SetCurrent(GLSurface* surface); | 175 static void SetCurrent(GLSurface* surface); |
173 | 176 |
174 static bool ExtensionsContain(const char* extensions, const char* name); | 177 static bool ExtensionsContain(const char* extensions, const char* name); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 | 229 |
227 private: | 230 private: |
228 scoped_refptr<GLSurface> surface_; | 231 scoped_refptr<GLSurface> surface_; |
229 | 232 |
230 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 233 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
231 }; | 234 }; |
232 | 235 |
233 } // namespace gfx | 236 } // namespace gfx |
234 | 237 |
235 #endif // UI_GL_GL_SURFACE_H_ | 238 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |