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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 } | 95 } |
96 | 96 |
97 int num_uncleared_mips() const { | 97 int num_uncleared_mips() const { |
98 return num_uncleared_mips_; | 98 return num_uncleared_mips_; |
99 } | 99 } |
100 | 100 |
101 uint32 estimated_size() const { | 101 uint32 estimated_size() const { |
102 return estimated_size_; | 102 return estimated_size_; |
103 } | 103 } |
104 | 104 |
| 105 // True if this texture meets all the GLES2 criteria for rendering. |
| 106 // See section 3.7.10 of the GLES2 spec. |
| 107 bool IsTextureComplete(const FeatureInfo* feature_info) const; |
| 108 |
105 bool CanRenderTo() const { | 109 bool CanRenderTo() const { |
106 return target_ != GL_TEXTURE_EXTERNAL_OES; | 110 return target_ != GL_TEXTURE_EXTERNAL_OES; |
107 } | 111 } |
108 | 112 |
109 // The service side OpenGL id of the texture. | 113 // The service side OpenGL id of the texture. |
110 GLuint service_id() const { | 114 GLuint service_id() const { |
111 return service_id_; | 115 return service_id_; |
112 } | 116 } |
113 | 117 |
114 void SetServiceId(GLuint service_id) { | 118 void SetServiceId(GLuint service_id) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 GLenum SetParameterf( | 318 GLenum SetParameterf( |
315 const FeatureInfo* feature_info, GLenum pname, GLfloat param); | 319 const FeatureInfo* feature_info, GLenum pname, GLfloat param); |
316 | 320 |
317 // Makes each of the mip levels as though they were generated. | 321 // Makes each of the mip levels as though they were generated. |
318 bool MarkMipmapsGenerated(const FeatureInfo* feature_info); | 322 bool MarkMipmapsGenerated(const FeatureInfo* feature_info); |
319 | 323 |
320 bool NeedsMips() const { | 324 bool NeedsMips() const { |
321 return min_filter_ != GL_NEAREST && min_filter_ != GL_LINEAR; | 325 return min_filter_ != GL_NEAREST && min_filter_ != GL_LINEAR; |
322 } | 326 } |
323 | 327 |
324 // True if this texture meets all the GLES2 criteria for rendering. | |
325 // See section 3.7.10 of the GLES2 spec. | |
326 bool IsTextureComplete(const FeatureInfo* feature_info) const; | |
327 | |
328 // Returns true if mipmaps can be generated by GL. | 328 // Returns true if mipmaps can be generated by GL. |
329 bool CanGenerateMipmaps(const FeatureInfo* feature_info) const; | 329 bool CanGenerateMipmaps(const FeatureInfo* feature_info) const; |
330 | 330 |
331 // Returns true if any of the texture dimensions are not a power of two. | 331 // Returns true if any of the texture dimensions are not a power of two. |
332 static bool TextureIsNPOT(GLsizei width, GLsizei height, GLsizei depth); | 332 static bool TextureIsNPOT(GLsizei width, GLsizei height, GLsizei depth); |
333 | 333 |
334 // Returns true if texture face is complete relative to the first face. | 334 // Returns true if texture face is complete relative to the first face. |
335 static bool TextureFaceComplete(const Texture::LevelInfo& first_face, | 335 static bool TextureFaceComplete(const Texture::LevelInfo& first_face, |
336 size_t face_index, | 336 size_t face_index, |
337 GLenum target, | 337 GLenum target, |
(...skipping 636 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 |