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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 #include "ui/gfx/size.h" | 13 #include "ui/gfx/size.h" |
14 #include "ui/gl/gl_export.h" | 14 #include "ui/gl/gl_export.h" |
| 15 #include "ui/gl/gl_implementation.h" |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 | 18 |
18 class GLContext; | 19 class GLContext; |
19 class VSyncProvider; | 20 class VSyncProvider; |
20 | 21 |
21 // Encapsulates a surface that can be rendered to with GL, hiding platform | 22 // Encapsulates a surface that can be rendered to with GL, hiding platform |
22 // specific management. | 23 // specific management. |
23 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { | 24 class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> { |
24 public: | 25 public: |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 gfx::AcceleratedWidget window); | 103 gfx::AcceleratedWidget window); |
103 | 104 |
104 // Create a GL surface used for offscreen rendering. | 105 // Create a GL surface used for offscreen rendering. |
105 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( | 106 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( |
106 const gfx::Size& size); | 107 const gfx::Size& size); |
107 | 108 |
108 static GLSurface* GetCurrent(); | 109 static GLSurface* GetCurrent(); |
109 | 110 |
110 protected: | 111 protected: |
111 virtual ~GLSurface(); | 112 virtual ~GLSurface(); |
| 113 static bool InitializePreBindingsInternal(GLImplementation impl); |
112 static bool InitializeOneOffInternal(); | 114 static bool InitializeOneOffInternal(); |
113 static void SetCurrent(GLSurface* surface); | 115 static void SetCurrent(GLSurface* surface); |
114 | 116 |
115 static bool ExtensionsContain(const char* extensions, const char* name); | 117 static bool ExtensionsContain(const char* extensions, const char* name); |
116 | 118 |
117 private: | 119 private: |
118 friend class base::RefCounted<GLSurface>; | 120 friend class base::RefCounted<GLSurface>; |
119 friend class GLContext; | 121 friend class GLContext; |
120 | 122 |
121 DISALLOW_COPY_AND_ASSIGN(GLSurface); | 123 DISALLOW_COPY_AND_ASSIGN(GLSurface); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 157 |
156 private: | 158 private: |
157 scoped_refptr<GLSurface> surface_; | 159 scoped_refptr<GLSurface> surface_; |
158 | 160 |
159 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 161 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
160 }; | 162 }; |
161 | 163 |
162 } // namespace gfx | 164 } // namespace gfx |
163 | 165 |
164 #endif // UI_GL_GL_SURFACE_H_ | 166 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |