| 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" |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Create a GL surface that renders directly to a view. | 100 // Create a GL surface that renders directly to a view. |
| 101 static scoped_refptr<GLSurface> CreateViewGLSurface( | 101 static scoped_refptr<GLSurface> CreateViewGLSurface( |
| 102 bool software, | 102 bool software, |
| 103 gfx::AcceleratedWidget window); | 103 gfx::AcceleratedWidget window); |
| 104 | 104 |
| 105 // Create a GL surface used for offscreen rendering. | 105 // Create a GL surface used for offscreen rendering. |
| 106 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( | 106 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( |
| 107 bool software, | 107 bool software, |
| 108 const gfx::Size& size); | 108 const gfx::Size& size); |
| 109 | 109 |
| 110 // Returns the last GLSurface made current, virtual or real. |
| 110 static GLSurface* GetCurrent(); | 111 static GLSurface* GetCurrent(); |
| 111 | 112 |
| 113 // Returns the last real GLSurface made current. |
| 114 static GLSurface* GetRealCurrent(); |
| 115 |
| 112 protected: | 116 protected: |
| 113 virtual ~GLSurface(); | 117 virtual ~GLSurface(); |
| 114 static bool InitializeOneOffInternal(); | 118 static bool InitializeOneOffInternal(); |
| 115 static void SetCurrent(GLSurface* surface); | 119 static void SetCurrent(GLSurface* surface); |
| 120 static void SetRealCurrent(GLSurface* surface); |
| 116 | 121 |
| 117 static bool ExtensionsContain(const char* extensions, const char* name); | 122 static bool ExtensionsContain(const char* extensions, const char* name); |
| 118 | 123 |
| 119 private: | 124 private: |
| 120 friend class base::RefCounted<GLSurface>; | 125 friend class base::RefCounted<GLSurface>; |
| 121 friend class GLContext; | 126 friend class GLContext; |
| 122 | 127 |
| 123 DISALLOW_COPY_AND_ASSIGN(GLSurface); | 128 DISALLOW_COPY_AND_ASSIGN(GLSurface); |
| 124 }; | 129 }; |
| 125 | 130 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 162 |
| 158 private: | 163 private: |
| 159 scoped_refptr<GLSurface> surface_; | 164 scoped_refptr<GLSurface> surface_; |
| 160 | 165 |
| 161 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 166 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 162 }; | 167 }; |
| 163 | 168 |
| 164 } // namespace gfx | 169 } // namespace gfx |
| 165 | 170 |
| 166 #endif // UI_GL_GL_SURFACE_H_ | 171 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |