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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 class FramebufferManager; | 23 class FramebufferManager; |
24 class RenderbufferManager; | 24 class RenderbufferManager; |
25 class ProgramManager; | 25 class ProgramManager; |
26 class ShaderManager; | 26 class ShaderManager; |
27 class TextureManager; | 27 class TextureManager; |
28 | 28 |
29 // A Context Group helps manage multiple GLES2Decoders that share | 29 // A Context Group helps manage multiple GLES2Decoders that share |
30 // resources. | 30 // resources. |
31 class ContextGroup { | 31 class ContextGroup { |
32 public: | 32 public: |
| 33 struct ExtensionFlags { |
| 34 ExtensionFlags() |
| 35 : ext_framebuffer_multisample(false) { |
| 36 } |
| 37 |
| 38 bool ext_framebuffer_multisample; |
| 39 }; |
| 40 |
33 ContextGroup(); | 41 ContextGroup(); |
34 ~ContextGroup(); | 42 ~ContextGroup(); |
35 | 43 |
36 // This should only be called by GLES2Decoder. | 44 // This should only be called by GLES2Decoder. |
37 bool Initialize(); | 45 bool Initialize(); |
38 | 46 |
39 // Destroys all the resources. MUST be called before destruction. | 47 // Destroys all the resources. MUST be called before destruction. |
40 void Destroy(bool have_context); | 48 void Destroy(bool have_context); |
41 | 49 |
42 uint32 max_vertex_attribs() const { | 50 uint32 max_vertex_attribs() const { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 IdAllocator* GetIdAllocator(unsigned namepsace_id); | 102 IdAllocator* GetIdAllocator(unsigned namepsace_id); |
95 | 103 |
96 const Validators* validators() const { | 104 const Validators* validators() const { |
97 return &validators_; | 105 return &validators_; |
98 } | 106 } |
99 | 107 |
100 const std::string& extensions() const { | 108 const std::string& extensions() const { |
101 return extensions_; | 109 return extensions_; |
102 } | 110 } |
103 | 111 |
| 112 const ExtensionFlags& extension_flags() const { |
| 113 return extension_flags_; |
| 114 } |
| 115 |
104 private: | 116 private: |
105 void AddExtensionString(const std::string& str); | 117 void AddExtensionString(const std::string& str); |
106 | 118 |
107 // Whether or not this context is initialized. | 119 // Whether or not this context is initialized. |
108 bool initialized_; | 120 bool initialized_; |
109 | 121 |
110 uint32 max_vertex_attribs_; | 122 uint32 max_vertex_attribs_; |
111 uint32 max_texture_units_; | 123 uint32 max_texture_units_; |
112 uint32 max_texture_image_units_; | 124 uint32 max_texture_image_units_; |
113 uint32 max_vertex_texture_image_units_; | 125 uint32 max_vertex_texture_image_units_; |
(...skipping 14 matching lines...) Expand all Loading... |
128 scoped_ptr<ShaderManager> shader_manager_; | 140 scoped_ptr<ShaderManager> shader_manager_; |
129 | 141 |
130 typedef std::map<uint32, linked_ptr<IdAllocator> > IdAllocatorMap; | 142 typedef std::map<uint32, linked_ptr<IdAllocator> > IdAllocatorMap; |
131 IdAllocatorMap id_namespaces_; | 143 IdAllocatorMap id_namespaces_; |
132 | 144 |
133 Validators validators_; | 145 Validators validators_; |
134 | 146 |
135 // The extensions string returned by glGetString(GL_EXTENSIONS); | 147 // The extensions string returned by glGetString(GL_EXTENSIONS); |
136 std::string extensions_; | 148 std::string extensions_; |
137 | 149 |
| 150 // Flags for some extensions |
| 151 ExtensionFlags extension_flags_; |
| 152 |
138 DISALLOW_COPY_AND_ASSIGN(ContextGroup); | 153 DISALLOW_COPY_AND_ASSIGN(ContextGroup); |
139 }; | 154 }; |
140 | 155 |
141 } // namespace gles2 | 156 } // namespace gles2 |
142 } // namespace gpu | 157 } // namespace gpu |
143 | 158 |
144 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ | 159 #endif // GPU_COMMAND_BUFFER_SERVICE_CONTEXT_GROUP_H_ |
145 | 160 |
146 | 161 |
OLD | NEW |