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 <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 TextureManager(MemoryTracker* memory_tracker, | 481 TextureManager(MemoryTracker* memory_tracker, |
482 FeatureInfo* feature_info, | 482 FeatureInfo* feature_info, |
483 GLsizei max_texture_size, | 483 GLsizei max_texture_size, |
484 GLsizei max_cube_map_texture_size); | 484 GLsizei max_cube_map_texture_size); |
485 ~TextureManager(); | 485 ~TextureManager(); |
486 | 486 |
487 void set_framebuffer_manager(FramebufferManager* manager) { | 487 void set_framebuffer_manager(FramebufferManager* manager) { |
488 framebuffer_manager_ = manager; | 488 framebuffer_manager_ = manager; |
489 } | 489 } |
490 | 490 |
| 491 void set_use_default_textures(bool use_default_textures) { |
| 492 use_default_textures_ = use_default_textures; |
| 493 } |
| 494 |
491 // Init the texture manager. | 495 // Init the texture manager. |
492 bool Initialize(); | 496 bool Initialize(); |
493 | 497 |
494 // Must call before destruction. | 498 // Must call before destruction. |
495 void Destroy(bool have_context); | 499 void Destroy(bool have_context); |
496 | 500 |
497 // Returns the maximum number of levels. | 501 // Returns the maximum number of levels. |
498 GLint MaxLevelsForTarget(GLenum target) const { | 502 GLint MaxLevelsForTarget(GLenum target) const { |
499 switch (target) { | 503 switch (target) { |
500 case GL_TEXTURE_2D: | 504 case GL_TEXTURE_2D: |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 | 771 |
768 // Info for each texture in the system. | 772 // Info for each texture in the system. |
769 typedef base::hash_map<GLuint, scoped_refptr<TextureRef> > TextureMap; | 773 typedef base::hash_map<GLuint, scoped_refptr<TextureRef> > TextureMap; |
770 TextureMap textures_; | 774 TextureMap textures_; |
771 | 775 |
772 GLsizei max_texture_size_; | 776 GLsizei max_texture_size_; |
773 GLsizei max_cube_map_texture_size_; | 777 GLsizei max_cube_map_texture_size_; |
774 GLint max_levels_; | 778 GLint max_levels_; |
775 GLint max_cube_map_levels_; | 779 GLint max_cube_map_levels_; |
776 | 780 |
| 781 bool use_default_textures_; |
| 782 |
777 int num_unrenderable_textures_; | 783 int num_unrenderable_textures_; |
778 int num_unsafe_textures_; | 784 int num_unsafe_textures_; |
779 int num_uncleared_mips_; | 785 int num_uncleared_mips_; |
780 int num_images_; | 786 int num_images_; |
781 | 787 |
782 // Counts the number of Textures allocated with 'this' as its manager. | 788 // Counts the number of Textures allocated with 'this' as its manager. |
783 // Allows to check no Texture will outlive this. | 789 // Allows to check no Texture will outlive this. |
784 unsigned int texture_count_; | 790 unsigned int texture_count_; |
785 | 791 |
786 bool have_context_; | 792 bool have_context_; |
(...skipping 20 matching lines...) Expand all Loading... |
807 private: | 813 private: |
808 DecoderTextureState* texture_state_; | 814 DecoderTextureState* texture_state_; |
809 base::TimeTicks begin_time_; | 815 base::TimeTicks begin_time_; |
810 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 816 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
811 }; | 817 }; |
812 | 818 |
813 } // namespace gles2 | 819 } // namespace gles2 |
814 } // namespace gpu | 820 } // namespace gpu |
815 | 821 |
816 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 822 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |