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_CONTEXT_H_ | 5 #ifndef UI_GL_GL_CONTEXT_H_ |
6 #define UI_GL_GL_CONTEXT_H_ | 6 #define UI_GL_GL_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 public: | 35 public: |
36 explicit GLContext(GLShareGroup* share_group); | 36 explicit GLContext(GLShareGroup* share_group); |
37 | 37 |
38 // Initializes the GL context to be compatible with the given surface. The GL | 38 // Initializes the GL context to be compatible with the given surface. The GL |
39 // context can be made with other surface's of the same type. The compatible | 39 // context can be made with other surface's of the same type. The compatible |
40 // surface is only needed for certain platforms like WGL, OSMesa and GLX. It | 40 // surface is only needed for certain platforms like WGL, OSMesa and GLX. It |
41 // should be specific for all platforms though. | 41 // should be specific for all platforms though. |
42 virtual bool Initialize( | 42 virtual bool Initialize( |
43 GLSurface* compatible_surface, GpuPreference gpu_preference) = 0; | 43 GLSurface* compatible_surface, GpuPreference gpu_preference) = 0; |
44 | 44 |
45 // Destroys the GL context. | |
46 virtual void Destroy() = 0; | |
47 | |
48 // Makes the GL context and a surface current on the current thread. | 45 // Makes the GL context and a surface current on the current thread. |
49 virtual bool MakeCurrent(GLSurface* surface) = 0; | 46 virtual bool MakeCurrent(GLSurface* surface) = 0; |
50 | 47 |
51 // Releases this GL context and surface as current on the current thread. | 48 // Releases this GL context and surface as current on the current thread. |
52 virtual void ReleaseCurrent(GLSurface* surface) = 0; | 49 virtual void ReleaseCurrent(GLSurface* surface) = 0; |
53 | 50 |
54 // Returns true if this context and surface is current. Pass a null surface | 51 // Returns true if this context and surface is current. Pass a null surface |
55 // if the current surface is not important. | 52 // if the current surface is not important. |
56 virtual bool IsCurrent(GLSurface* surface) = 0; | 53 virtual bool IsCurrent(GLSurface* surface) = 0; |
57 | 54 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void SetCurrent(GLSurface* surface) override; | 204 void SetCurrent(GLSurface* surface) override; |
208 | 205 |
209 private: | 206 private: |
210 scoped_ptr<gfx::GPUTiming> gpu_timing_; | 207 scoped_ptr<gfx::GPUTiming> gpu_timing_; |
211 DISALLOW_COPY_AND_ASSIGN(GLContextReal); | 208 DISALLOW_COPY_AND_ASSIGN(GLContextReal); |
212 }; | 209 }; |
213 | 210 |
214 } // namespace gfx | 211 } // namespace gfx |
215 | 212 |
216 #endif // UI_GL_GL_CONTEXT_H_ | 213 #endif // UI_GL_GL_CONTEXT_H_ |
OLD | NEW |