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_SHADER_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // True if compilation succeeded. | 84 // True if compilation succeeded. |
85 bool valid_; | 85 bool valid_; |
86 | 86 |
87 // The shader source as passed to glShaderSource. | 87 // The shader source as passed to glShaderSource. |
88 std::string source_; | 88 std::string source_; |
89 | 89 |
90 // The shader translation log. | 90 // The shader translation log. |
91 std::string log_info_; | 91 std::string log_info_; |
92 }; | 92 }; |
93 | 93 |
94 ShaderManager() { | 94 ShaderManager() { } |
95 } | 95 ~ShaderManager(); |
| 96 |
| 97 // Must call before destruction. |
| 98 void Destroy(bool have_context); |
96 | 99 |
97 // Creates a shader info for the given shader ID. | 100 // Creates a shader info for the given shader ID. |
98 void CreateShaderInfo(GLuint client_id, | 101 void CreateShaderInfo(GLuint client_id, |
99 GLuint service_id, | 102 GLuint service_id, |
100 GLenum shader_type); | 103 GLenum shader_type); |
101 | 104 |
102 // Gets an existing shader info for the given shader ID. Returns NULL if none | 105 // Gets an existing shader info for the given shader ID. Returns NULL if none |
103 // exists. | 106 // exists. |
104 ShaderInfo* GetShaderInfo(GLuint client_id); | 107 ShaderInfo* GetShaderInfo(GLuint client_id); |
105 | 108 |
106 // Deletes the shader info for the given shader. | 109 // Deletes the shader info for the given shader. |
107 void RemoveShaderInfo(GLuint client_id); | 110 void RemoveShaderInfo(GLuint client_id); |
108 | 111 |
109 // Gets a client id for a given service id. | 112 // Gets a client id for a given service id. |
110 bool GetClientId(GLuint service_id, GLuint* client_id) const; | 113 bool GetClientId(GLuint service_id, GLuint* client_id) const; |
111 | 114 |
112 private: | 115 private: |
113 // Info for each shader by service side shader Id. | 116 // Info for each shader by service side shader Id. |
114 typedef std::map<GLuint, ShaderInfo::Ref> ShaderInfoMap; | 117 typedef std::map<GLuint, ShaderInfo::Ref> ShaderInfoMap; |
115 ShaderInfoMap shader_infos_; | 118 ShaderInfoMap shader_infos_; |
116 | 119 |
117 DISALLOW_COPY_AND_ASSIGN(ShaderManager); | 120 DISALLOW_COPY_AND_ASSIGN(ShaderManager); |
118 }; | 121 }; |
119 | 122 |
120 } // namespace gles2 | 123 } // namespace gles2 |
121 } // namespace gpu | 124 } // namespace gpu |
122 | 125 |
123 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ | 126 #endif // GPU_COMMAND_BUFFER_SERVICE_SHADER_MANAGER_H_ |
124 | 127 |
OLD | NEW |