| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 kRectangleARB, | 709 kRectangleARB, |
| 710 kNumDefaultTextures | 710 kNumDefaultTextures |
| 711 }; | 711 }; |
| 712 | 712 |
| 713 TextureManager(MemoryTracker* memory_tracker, | 713 TextureManager(MemoryTracker* memory_tracker, |
| 714 FeatureInfo* feature_info, | 714 FeatureInfo* feature_info, |
| 715 GLsizei max_texture_size, | 715 GLsizei max_texture_size, |
| 716 GLsizei max_cube_map_texture_size, | 716 GLsizei max_cube_map_texture_size, |
| 717 GLsizei max_rectangle_texture_size, | 717 GLsizei max_rectangle_texture_size, |
| 718 GLsizei max_3d_texture_size, | 718 GLsizei max_3d_texture_size, |
| 719 GLsizei max_array_texture_layers, |
| 719 bool use_default_textures); | 720 bool use_default_textures); |
| 720 ~TextureManager() override; | 721 ~TextureManager() override; |
| 721 | 722 |
| 722 void set_framebuffer_manager(FramebufferManager* manager) { | 723 void set_framebuffer_manager(FramebufferManager* manager) { |
| 723 framebuffer_manager_ = manager; | 724 framebuffer_manager_ = manager; |
| 724 } | 725 } |
| 725 | 726 |
| 726 // Init the texture manager. | 727 // Init the texture manager. |
| 727 bool Initialize(); | 728 bool Initialize(); |
| 728 | 729 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 754 return max_texture_size_; | 755 return max_texture_size_; |
| 755 case GL_TEXTURE_RECTANGLE: | 756 case GL_TEXTURE_RECTANGLE: |
| 756 return max_rectangle_texture_size_; | 757 return max_rectangle_texture_size_; |
| 757 case GL_TEXTURE_3D: | 758 case GL_TEXTURE_3D: |
| 758 return max_3d_texture_size_; | 759 return max_3d_texture_size_; |
| 759 default: | 760 default: |
| 760 return max_cube_map_texture_size_; | 761 return max_cube_map_texture_size_; |
| 761 } | 762 } |
| 762 } | 763 } |
| 763 | 764 |
| 765 GLsizei max_array_texture_layers() const { |
| 766 return max_array_texture_layers_; |
| 767 } |
| 768 |
| 764 // Returns the maxium number of levels a texture of the given size can have. | 769 // Returns the maxium number of levels a texture of the given size can have. |
| 765 static GLsizei ComputeMipMapCount(GLenum target, | 770 static GLsizei ComputeMipMapCount(GLenum target, |
| 766 GLsizei width, | 771 GLsizei width, |
| 767 GLsizei height, | 772 GLsizei height, |
| 768 GLsizei depth); | 773 GLsizei depth); |
| 769 | 774 |
| 770 static GLenum ExtractFormatFromStorageFormat(GLenum internalformat); | 775 static GLenum ExtractFormatFromStorageFormat(GLenum internalformat); |
| 771 static GLenum ExtractTypeFromStorageFormat(GLenum internalformat); | 776 static GLenum ExtractTypeFromStorageFormat(GLenum internalformat); |
| 772 | 777 |
| 773 // Checks if a dimensions are valid for a given target. | 778 // Checks if a dimensions are valid for a given target. |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1104 FramebufferManager* framebuffer_manager_; | 1109 FramebufferManager* framebuffer_manager_; |
| 1105 | 1110 |
| 1106 // Info for each texture in the system. | 1111 // Info for each texture in the system. |
| 1107 typedef base::hash_map<GLuint, scoped_refptr<TextureRef> > TextureMap; | 1112 typedef base::hash_map<GLuint, scoped_refptr<TextureRef> > TextureMap; |
| 1108 TextureMap textures_; | 1113 TextureMap textures_; |
| 1109 | 1114 |
| 1110 GLsizei max_texture_size_; | 1115 GLsizei max_texture_size_; |
| 1111 GLsizei max_cube_map_texture_size_; | 1116 GLsizei max_cube_map_texture_size_; |
| 1112 GLsizei max_rectangle_texture_size_; | 1117 GLsizei max_rectangle_texture_size_; |
| 1113 GLsizei max_3d_texture_size_; | 1118 GLsizei max_3d_texture_size_; |
| 1119 GLsizei max_array_texture_layers_; |
| 1114 GLint max_levels_; | 1120 GLint max_levels_; |
| 1115 GLint max_cube_map_levels_; | 1121 GLint max_cube_map_levels_; |
| 1116 GLint max_3d_levels_; | 1122 GLint max_3d_levels_; |
| 1117 | 1123 |
| 1118 const bool use_default_textures_; | 1124 const bool use_default_textures_; |
| 1119 | 1125 |
| 1120 int num_unsafe_textures_; | 1126 int num_unsafe_textures_; |
| 1121 int num_uncleared_mips_; | 1127 int num_uncleared_mips_; |
| 1122 int num_images_; | 1128 int num_images_; |
| 1123 | 1129 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 1151 private: | 1157 private: |
| 1152 DecoderTextureState* texture_state_; | 1158 DecoderTextureState* texture_state_; |
| 1153 base::TimeTicks begin_time_; | 1159 base::TimeTicks begin_time_; |
| 1154 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 1160 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
| 1155 }; | 1161 }; |
| 1156 | 1162 |
| 1157 } // namespace gles2 | 1163 } // namespace gles2 |
| 1158 } // namespace gpu | 1164 } // namespace gpu |
| 1159 | 1165 |
| 1160 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 1166 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
| OLD | NEW |