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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 GLint target, GLint level, | 145 GLint target, GLint level, |
146 GLsizei* width, GLsizei* height, GLsizei* depth) const; | 146 GLsizei* width, GLsizei* height, GLsizei* depth) const; |
147 | 147 |
148 // Get the type of a level. Returns false if level does not exist. | 148 // Get the type of a level. Returns false if level does not exist. |
149 bool GetLevelType( | 149 bool GetLevelType( |
150 GLint target, GLint level, GLenum* type, GLenum* internal_format) const; | 150 GLint target, GLint level, GLenum* type, GLenum* internal_format) const; |
151 | 151 |
152 // Set the image for a particular level. | 152 // Set the image for a particular level. |
153 void SetLevelImage(GLenum target, | 153 void SetLevelImage(GLenum target, |
154 GLint level, | 154 GLint level, |
155 gfx::GLImage* image, | 155 gl::GLImage* image, |
156 ImageState state); | 156 ImageState state); |
157 | 157 |
158 // Get the image associated with a particular level. Returns NULL if level | 158 // Get the image associated with a particular level. Returns NULL if level |
159 // does not exist. | 159 // does not exist. |
160 gfx::GLImage* GetLevelImage(GLint target, | 160 gl::GLImage* GetLevelImage(GLint target, |
161 GLint level, | 161 GLint level, |
162 ImageState* state) const; | 162 ImageState* state) const; |
163 gfx::GLImage* GetLevelImage(GLint target, GLint level) const; | 163 gl::GLImage* GetLevelImage(GLint target, GLint level) const; |
164 | 164 |
165 bool HasImages() const { | 165 bool HasImages() const { |
166 return has_images_; | 166 return has_images_; |
167 } | 167 } |
168 | 168 |
169 // Returns true of the given dimensions are inside the dimensions of the | 169 // Returns true of the given dimensions are inside the dimensions of the |
170 // level. | 170 // level. |
171 bool ValidForTexture( | 171 bool ValidForTexture( |
172 GLint target, | 172 GLint target, |
173 GLint level, | 173 GLint level, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 gfx::Rect cleared_rect; | 256 gfx::Rect cleared_rect; |
257 GLenum target; | 257 GLenum target; |
258 GLint level; | 258 GLint level; |
259 GLenum internal_format; | 259 GLenum internal_format; |
260 GLsizei width; | 260 GLsizei width; |
261 GLsizei height; | 261 GLsizei height; |
262 GLsizei depth; | 262 GLsizei depth; |
263 GLint border; | 263 GLint border; |
264 GLenum format; | 264 GLenum format; |
265 GLenum type; | 265 GLenum type; |
266 scoped_refptr<gfx::GLImage> image; | 266 scoped_refptr<gl::GLImage> image; |
267 ImageState image_state; | 267 ImageState image_state; |
268 uint32 estimated_size; | 268 uint32 estimated_size; |
269 }; | 269 }; |
270 | 270 |
271 struct FaceInfo { | 271 struct FaceInfo { |
272 FaceInfo(); | 272 FaceInfo(); |
273 ~FaceInfo(); | 273 ~FaceInfo(); |
274 | 274 |
275 GLsizei num_mip_levels; | 275 GLsizei num_mip_levels; |
276 std::vector<LevelInfo> level_infos; | 276 std::vector<LevelInfo> level_infos; |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 } | 802 } |
803 } | 803 } |
804 | 804 |
805 size_t mem_represented() const { | 805 size_t mem_represented() const { |
806 return memory_type_tracker_->GetMemRepresented(); | 806 return memory_type_tracker_->GetMemRepresented(); |
807 } | 807 } |
808 | 808 |
809 void SetLevelImage(TextureRef* ref, | 809 void SetLevelImage(TextureRef* ref, |
810 GLenum target, | 810 GLenum target, |
811 GLint level, | 811 GLint level, |
812 gfx::GLImage* image, | 812 gl::GLImage* image, |
813 Texture::ImageState state); | 813 Texture::ImageState state); |
814 | 814 |
815 size_t GetSignatureSize() const; | 815 size_t GetSignatureSize() const; |
816 | 816 |
817 void AddToSignature( | 817 void AddToSignature( |
818 TextureRef* ref, | 818 TextureRef* ref, |
819 GLenum target, | 819 GLenum target, |
820 GLint level, | 820 GLint level, |
821 std::string* signature) const; | 821 std::string* signature) const; |
822 | 822 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
974 private: | 974 private: |
975 DecoderTextureState* texture_state_; | 975 DecoderTextureState* texture_state_; |
976 base::TimeTicks begin_time_; | 976 base::TimeTicks begin_time_; |
977 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 977 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
978 }; | 978 }; |
979 | 979 |
980 } // namespace gles2 | 980 } // namespace gles2 |
981 } // namespace gpu | 981 } // namespace gpu |
982 | 982 |
983 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 983 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |