OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <string> | |
6 | |
7 #include "base/memory/scoped_ptr.h" | |
8 #include "ui/gfx/gl/gl_context.h" | 5 #include "ui/gfx/gl/gl_context.h" |
9 #include "ui/gfx/size.h" | |
10 | 6 |
11 namespace gfx { | 7 namespace gfx { |
12 | 8 |
13 class GLSurfaceCGL; | 9 class GLSurface; |
14 | 10 |
15 // Encapsulates a CGL OpenGL context. | 11 // Encapsulates a CGL OpenGL context. |
16 class GLContextCGL : public GLContext { | 12 class GLContextCGL : public GLContext { |
17 public: | 13 public: |
18 explicit GLContextCGL(GLSurfaceCGL* surface); | 14 GLContextCGL(); |
19 virtual ~GLContextCGL(); | 15 virtual ~GLContextCGL(); |
20 | 16 |
21 // Initializes the GL context. | |
22 bool Initialize(GLContext* shared_context); | |
23 | |
24 // Implement GLContext. | 17 // Implement GLContext. |
| 18 virtual bool Initialize(GLContext* shared_context, |
| 19 GLSurface* compatible_surface); |
25 virtual void Destroy(); | 20 virtual void Destroy(); |
26 virtual bool MakeCurrent(); | 21 virtual bool MakeCurrent(GLSurface* surface); |
27 virtual bool IsCurrent(); | 22 virtual void ReleaseCurrent(GLSurface* surface); |
28 virtual bool IsOffscreen(); | 23 virtual bool IsCurrent(GLSurface* surface); |
29 virtual bool SwapBuffers(); | |
30 virtual gfx::Size GetSize(); | |
31 virtual void* GetHandle(); | 24 virtual void* GetHandle(); |
32 virtual void SetSwapInterval(int interval); | 25 virtual void SetSwapInterval(int interval); |
33 | 26 |
34 private: | 27 private: |
35 scoped_ptr<GLSurfaceCGL> surface_; | |
36 void* context_; | 28 void* context_; |
37 | 29 |
38 DISALLOW_COPY_AND_ASSIGN(GLContextCGL); | 30 DISALLOW_COPY_AND_ASSIGN(GLContextCGL); |
39 }; | 31 }; |
40 | 32 |
41 } // namespace gfx | 33 } // namespace gfx |
OLD | NEW |