OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 | 11 |
12 namespace gpu { | 12 namespace gpu { |
13 namespace gles2 { | 13 namespace gles2 { |
14 | 14 |
15 class GLES2Decoder; | 15 class GLES2Decoder; |
16 class BufferManager; | 16 class BufferManager; |
17 class FramebufferManager; | 17 class FramebufferManager; |
18 class RenderbufferManager; | 18 class RenderbufferManager; |
19 class IdManager; | |
20 class ProgramManager; | 19 class ProgramManager; |
21 class ShaderManager; | 20 class ShaderManager; |
22 class TextureManager; | 21 class TextureManager; |
23 | 22 |
24 // A Context Group helps manage multiple GLES2Decoders that share | 23 // A Context Group helps manage multiple GLES2Decoders that share |
25 // resources. | 24 // resources. |
26 class ContextGroup { | 25 class ContextGroup { |
27 public: | 26 public: |
28 ContextGroup(); | 27 ContextGroup(); |
29 ~ContextGroup(); | 28 ~ContextGroup(); |
30 | 29 |
31 // This should only be called by GLES2Decoder. | 30 // This should only be called by GLES2Decoder. |
32 bool Initialize(); | 31 bool Initialize(); |
33 | 32 |
34 uint32 max_vertex_attribs() const { | 33 uint32 max_vertex_attribs() const { |
35 return max_vertex_attribs_; | 34 return max_vertex_attribs_; |
36 } | 35 } |
37 | 36 |
38 uint32 max_texture_units() const { | 37 uint32 max_texture_units() const { |
39 return max_texture_units_; | 38 return max_texture_units_; |
40 } | 39 } |
41 | 40 |
42 // Map of client ids to GL ids. | |
43 IdManager* id_manager() const { | |
44 return id_manager_.get(); | |
45 } | |
46 | |
47 BufferManager* buffer_manager() const { | 41 BufferManager* buffer_manager() const { |
48 return buffer_manager_.get(); | 42 return buffer_manager_.get(); |
49 } | 43 } |
50 | 44 |
51 FramebufferManager* framebuffer_manager() const { | 45 FramebufferManager* framebuffer_manager() const { |
52 return framebuffer_manager_.get(); | 46 return framebuffer_manager_.get(); |
53 } | 47 } |
54 | 48 |
55 RenderbufferManager* renderbuffer_manager() const { | 49 RenderbufferManager* renderbuffer_manager() const { |
56 return renderbuffer_manager_.get(); | 50 return renderbuffer_manager_.get(); |
(...skipping 12 matching lines...) Expand all Loading... |
69 } | 63 } |
70 | 64 |
71 private: | 65 private: |
72 // Whether or not this context is initialized. | 66 // Whether or not this context is initialized. |
73 bool initialized_; | 67 bool initialized_; |
74 | 68 |
75 uint32 max_vertex_attribs_; | 69 uint32 max_vertex_attribs_; |
76 | 70 |
77 uint32 max_texture_units_; | 71 uint32 max_texture_units_; |
78 | 72 |
79 // Map of client ids to GL ids. | |
80 scoped_ptr<IdManager> id_manager_; | |
81 | |
82 scoped_ptr<BufferManager> buffer_manager_; | 73 scoped_ptr<BufferManager> buffer_manager_; |
83 | 74 |
84 scoped_ptr<FramebufferManager> framebuffer_manager_; | 75 scoped_ptr<FramebufferManager> framebuffer_manager_; |
85 | 76 |
86 scoped_ptr<RenderbufferManager> renderbuffer_manager_; | 77 scoped_ptr<RenderbufferManager> renderbuffer_manager_; |
87 | 78 |
88 scoped_ptr<TextureManager> texture_manager_; | 79 scoped_ptr<TextureManager> texture_manager_; |
89 | 80 |
90 scoped_ptr<ProgramManager> program_manager_; | 81 scoped_ptr<ProgramManager> program_manager_; |
91 | 82 |
92 scoped_ptr<ShaderManager> shader_manager_; | 83 scoped_ptr<ShaderManager> shader_manager_; |
93 | 84 |
94 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 85 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
95 }; | 86 }; |
96 | 87 |
97 } // namespace gles2 | 88 } // namespace gles2 |
98 } // namespace gpu | 89 } // namespace gpu |
99 | 90 |
100 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 91 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
101 | 92 |
102 | 93 |
OLD | NEW |