Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 8 #include <algorithm> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 242 GLenum format; | 242 GLenum format; |
| 243 GLenum type; | 243 GLenum type; |
| 244 scoped_refptr<gfx::GLImage> image; | 244 scoped_refptr<gfx::GLImage> image; |
| 245 uint32 estimated_size; | 245 uint32 estimated_size; |
| 246 }; | 246 }; |
| 247 | 247 |
| 248 struct FaceInfo { | 248 struct FaceInfo { |
| 249 FaceInfo(); | 249 FaceInfo(); |
| 250 ~FaceInfo(); | 250 ~FaceInfo(); |
| 251 | 251 |
| 252 GLsizei num_mip_levels; | 252 GLsizei num_mip_levels; |
|
piman
2015/10/22 01:18:36
nit: can you add a comment indicating that this is
Zhenyao Mo
2015/10/22 01:43:20
Done.
| |
| 253 std::vector<LevelInfo> level_infos; | 253 std::vector<LevelInfo> level_infos; |
| 254 }; | 254 }; |
| 255 | 255 |
| 256 // Set the info for a particular level. | 256 // Set the info for a particular level. |
| 257 void SetLevelInfo(const FeatureInfo* feature_info, | 257 void SetLevelInfo(const FeatureInfo* feature_info, |
| 258 GLenum target, | 258 GLenum target, |
| 259 GLint level, | 259 GLint level, |
| 260 GLenum internal_format, | 260 GLenum internal_format, |
| 261 GLsizei width, | 261 GLsizei width, |
| 262 GLsizei height, | 262 GLsizei height, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 static bool TextureFaceComplete(const Texture::LevelInfo& first_face, | 332 static bool TextureFaceComplete(const Texture::LevelInfo& first_face, |
| 333 size_t face_index, | 333 size_t face_index, |
| 334 GLenum target, | 334 GLenum target, |
| 335 GLenum internal_format, | 335 GLenum internal_format, |
| 336 GLsizei width, | 336 GLsizei width, |
| 337 GLsizei height, | 337 GLsizei height, |
| 338 GLsizei depth, | 338 GLsizei depth, |
| 339 GLenum format, | 339 GLenum format, |
| 340 GLenum type); | 340 GLenum type); |
| 341 | 341 |
| 342 // Returns true if texture mip level is complete relative to first level. | 342 // Returns true if texture mip level is complete relative to base level. |
| 343 static bool TextureMipComplete(const Texture::LevelInfo& level0_face, | 343 // Note that level_diff = level - base_level. |
| 344 static bool TextureMipComplete(const Texture::LevelInfo& base_level_face, | |
| 344 GLenum target, | 345 GLenum target, |
| 345 GLint level, | 346 GLint level_diff, |
| 346 GLenum internal_format, | 347 GLenum internal_format, |
| 347 GLsizei width, | 348 GLsizei width, |
| 348 GLsizei height, | 349 GLsizei height, |
| 349 GLsizei depth, | 350 GLsizei depth, |
| 350 GLenum format, | 351 GLenum format, |
| 351 GLenum type); | 352 GLenum type); |
| 352 | 353 |
| 353 // Sets the Texture's target | 354 // Sets the Texture's target |
| 354 // Parameters: | 355 // Parameters: |
| 355 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP or | 356 // target: GL_TEXTURE_2D or GL_TEXTURE_CUBE_MAP or |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 395 void UpdateCanRenderCondition(); | 396 void UpdateCanRenderCondition(); |
| 396 | 397 |
| 397 // Updates the images count in all the managers referencing this | 398 // Updates the images count in all the managers referencing this |
| 398 // texture. | 399 // texture. |
| 399 void UpdateHasImages(); | 400 void UpdateHasImages(); |
| 400 | 401 |
| 401 // Increment the framebuffer state change count in all the managers | 402 // Increment the framebuffer state change count in all the managers |
| 402 // referencing this texture. | 403 // referencing this texture. |
| 403 void IncAllFramebufferStateChangeCount(); | 404 void IncAllFramebufferStateChangeCount(); |
| 404 | 405 |
| 406 void UpdateBaseLevel(GLint base_level); | |
| 407 void UpdateMaxLevel(GLint max_level); | |
| 408 void UpdateNumMipLevels(); | |
| 409 | |
| 405 MailboxManager* mailbox_manager_; | 410 MailboxManager* mailbox_manager_; |
| 406 | 411 |
| 407 // Info about each face and level of texture. | 412 // Info about each face and level of texture. |
| 408 std::vector<FaceInfo> face_infos_; | 413 std::vector<FaceInfo> face_infos_; |
| 409 | 414 |
| 410 // The texture refs that point to this Texture. | 415 // The texture refs that point to this Texture. |
| 411 typedef std::set<TextureRef*> RefSet; | 416 typedef std::set<TextureRef*> RefSet; |
| 412 RefSet refs_; | 417 RefSet refs_; |
| 413 | 418 |
| 414 // The single TextureRef that accounts for memory for this texture. Must be | 419 // The single TextureRef that accounts for memory for this texture. Must be |
| (...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 private: | 963 private: |
| 959 DecoderTextureState* texture_state_; | 964 DecoderTextureState* texture_state_; |
| 960 base::TimeTicks begin_time_; | 965 base::TimeTicks begin_time_; |
| 961 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 966 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
| 962 }; | 967 }; |
| 963 | 968 |
| 964 } // namespace gles2 | 969 } // namespace gles2 |
| 965 } // namespace gpu | 970 } // namespace gpu |
| 966 | 971 |
| 967 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 972 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| OLD | NEW |