| 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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 // Sets the TextureInfo's target | 222 // Sets the TextureInfo's target |
| 223 // Parameters: | 223 // Parameters: |
| 224 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP | 224 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP |
| 225 // max_levels: The maximum levels this type of target can have. | 225 // max_levels: The maximum levels this type of target can have. |
| 226 void SetInfoTarget(TextureInfo* info, GLenum target) { | 226 void SetInfoTarget(TextureInfo* info, GLenum target) { |
| 227 DCHECK(info); | 227 DCHECK(info); |
| 228 info->SetTarget(target, MaxLevelsForTarget(target)); | 228 info->SetTarget(target, MaxLevelsForTarget(target)); |
| 229 } | 229 } |
| 230 | 230 |
| 231 // Creates a new texture info. | 231 // Creates a new texture info. |
| 232 void CreateTextureInfo(GLuint texture_id); | 232 TextureInfo* CreateTextureInfo(GLuint texture_id); |
| 233 | 233 |
| 234 // Gets the texture info for the given texture. | 234 // Gets the texture info for the given texture. |
| 235 TextureInfo* GetTextureInfo(GLuint texture_id); | 235 TextureInfo* GetTextureInfo(GLuint texture_id); |
| 236 | 236 |
| 237 // Removes a texture info. | 237 // Removes a texture info. |
| 238 void RemoveTextureInfo(GLuint texture_id); | 238 void RemoveTextureInfo(GLuint texture_id); |
| 239 | 239 |
| 240 private: | 240 private: |
| 241 // Info for each texture in the system. | 241 // Info for each texture in the system. |
| 242 // TODO(gman): Choose a faster container. | 242 // TODO(gman): Choose a faster container. |
| 243 typedef std::map<GLuint, TextureInfo::Ref> TextureInfoMap; | 243 typedef std::map<GLuint, TextureInfo::Ref> TextureInfoMap; |
| 244 TextureInfoMap texture_infos_; | 244 TextureInfoMap texture_infos_; |
| 245 | 245 |
| 246 GLsizei max_texture_size_; | 246 GLsizei max_texture_size_; |
| 247 GLsizei max_cube_map_texture_size_; | 247 GLsizei max_cube_map_texture_size_; |
| 248 GLint max_levels_; | 248 GLint max_levels_; |
| 249 GLint max_cube_map_levels_; | 249 GLint max_cube_map_levels_; |
| 250 | 250 |
| 251 DISALLOW_COPY_AND_ASSIGN(TextureManager); | 251 DISALLOW_COPY_AND_ASSIGN(TextureManager); |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 } // namespace gles2 | 254 } // namespace gles2 |
| 255 } // namespace gpu | 255 } // namespace gpu |
| 256 | 256 |
| 257 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 257 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| 258 | 258 |
| OLD | NEW |