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. | 17 // Initializes the GL context. |
22 bool Initialize(GLContext* shared_context); | 18 bool Initialize(GLContext* shared_context); |
23 | 19 |
24 // Implement GLContext. | 20 // Implement GLContext. |
25 virtual void Destroy(); | 21 virtual void Destroy(); |
26 virtual bool MakeCurrent(); | 22 virtual bool MakeCurrent(GLSurface* surface); |
27 virtual bool IsCurrent(); | 23 virtual void ReleaseCurrent(GLSurface* surface); |
28 virtual bool IsOffscreen(); | 24 virtual bool IsCurrent(GLSurface* surface); |
29 virtual bool SwapBuffers(); | |
30 virtual gfx::Size GetSize(); | |
31 virtual void* GetHandle(); | 25 virtual void* GetHandle(); |
32 virtual void SetSwapInterval(int interval); | 26 virtual void SetSwapInterval(int interval); |
33 | 27 |
34 private: | 28 private: |
35 scoped_ptr<GLSurfaceCGL> surface_; | |
36 void* context_; | 29 void* context_; |
37 | 30 |
38 DISALLOW_COPY_AND_ASSIGN(GLContextCGL); | 31 DISALLOW_COPY_AND_ASSIGN(GLContextCGL); |
39 }; | 32 }; |
40 | 33 |
41 } // namespace gfx | 34 } // namespace gfx |
OLD | NEW |