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_TEXTURE_MANAGER_H_ | 5 #ifndef GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 6 #define GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 bool cube_complete_; | 188 bool cube_complete_; |
189 | 189 |
190 // Whether or not this texture is non-power-of-two | 190 // Whether or not this texture is non-power-of-two |
191 bool npot_; | 191 bool npot_; |
192 | 192 |
193 DISALLOW_COPY_AND_ASSIGN(TextureInfo); | 193 DISALLOW_COPY_AND_ASSIGN(TextureInfo); |
194 }; | 194 }; |
195 | 195 |
196 TextureManager(GLsizei max_texture_size, | 196 TextureManager(GLsizei max_texture_size, |
197 GLsizei max_cube_map_texture_size); | 197 GLsizei max_cube_map_texture_size); |
| 198 ~TextureManager(); |
| 199 |
| 200 // Must call before destruction. |
| 201 void Destroy(bool have_context); |
198 | 202 |
199 // Returns the maximum number of levels. | 203 // Returns the maximum number of levels. |
200 GLint MaxLevelsForTarget(GLenum target) const { | 204 GLint MaxLevelsForTarget(GLenum target) const { |
201 return (target == GL_TEXTURE_2D) ? max_levels_ : max_cube_map_levels_; | 205 return (target == GL_TEXTURE_2D) ? max_levels_ : max_cube_map_levels_; |
202 } | 206 } |
203 | 207 |
204 // Returns the maximum size. | 208 // Returns the maximum size. |
205 GLsizei MaxSizeForTarget(GLenum target) const { | 209 GLsizei MaxSizeForTarget(GLenum target) const { |
206 return (target == GL_TEXTURE_2D) ? max_texture_size_ : | 210 return (target == GL_TEXTURE_2D) ? max_texture_size_ : |
207 max_cube_map_texture_size_; | 211 max_cube_map_texture_size_; |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 TextureInfo::Ref default_texture_cube_map_; | 284 TextureInfo::Ref default_texture_cube_map_; |
281 | 285 |
282 DISALLOW_COPY_AND_ASSIGN(TextureManager); | 286 DISALLOW_COPY_AND_ASSIGN(TextureManager); |
283 }; | 287 }; |
284 | 288 |
285 } // namespace gles2 | 289 } // namespace gles2 |
286 } // namespace gpu | 290 } // namespace gpu |
287 | 291 |
288 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 292 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
289 | 293 |
OLD | NEW |