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 #ifndef UI_GFX_GL_GL_SHARE_GROUP_H_ | 5 #ifndef UI_GFX_GL_GL_SHARE_GROUP_H_ |
6 #define UI_GFX_GL_GL_SHARE_GROUP_H_ | 6 #define UI_GFX_GL_GL_SHARE_GROUP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 | 23 |
24 // These two should only be called from the constructor and destructor of | 24 // These two should only be called from the constructor and destructor of |
25 // GLContext. | 25 // GLContext. |
26 void AddContext(GLContext* context); | 26 void AddContext(GLContext* context); |
27 void RemoveContext(GLContext* context); | 27 void RemoveContext(GLContext* context); |
28 | 28 |
29 // Returns a handle to any initialized context in the share group or NULL if | 29 // Returns a handle to any initialized context in the share group or NULL if |
30 // there are no initialized contexts in the share group. | 30 // there are no initialized contexts in the share group. |
31 void* GetHandle(); | 31 void* GetHandle(); |
32 | 32 |
| 33 // Returns a pointer to any initialized context in the share group |
| 34 // or NULL if there are no initialized contexts in the share group. |
| 35 GLContext* GetContext(); |
| 36 |
33 private: | 37 private: |
34 friend class base::RefCounted<GLShareGroup>; | 38 friend class base::RefCounted<GLShareGroup>; |
35 ~GLShareGroup(); | 39 ~GLShareGroup(); |
36 | 40 |
37 // References to GLContext are by raw pointer to avoid a reference count | 41 // References to GLContext are by raw pointer to avoid a reference count |
38 // cycle. | 42 // cycle. |
39 typedef std::set<GLContext*> ContextSet; | 43 typedef std::set<GLContext*> ContextSet; |
40 ContextSet contexts_; | 44 ContextSet contexts_; |
41 DISALLOW_COPY_AND_ASSIGN(GLShareGroup); | 45 DISALLOW_COPY_AND_ASSIGN(GLShareGroup); |
42 }; | 46 }; |
43 | 47 |
44 } // namespace gfx | 48 } // namespace gfx |
45 | 49 |
46 #endif // UI_GFX_GL_GL_SHARE_GROUP_H_ | 50 #endif // UI_GFX_GL_GL_SHARE_GROUP_H_ |
OLD | NEW |