Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(71)

Side by Side Diff: gpu/command_buffer/service/texture_manager.h

Issue 1605323004: Check if internal_format is valid for GenerateMipmap(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 // Sets a texture parameter. 338 // Sets a texture parameter.
339 // TODO(gman): Expand to SetParameteriv,fv 339 // TODO(gman): Expand to SetParameteriv,fv
340 // Returns GL_NO_ERROR on success. Otherwise the error to generate. 340 // Returns GL_NO_ERROR on success. Otherwise the error to generate.
341 GLenum SetParameteri( 341 GLenum SetParameteri(
342 const FeatureInfo* feature_info, GLenum pname, GLint param); 342 const FeatureInfo* feature_info, GLenum pname, GLint param);
343 GLenum SetParameterf( 343 GLenum SetParameterf(
344 const FeatureInfo* feature_info, GLenum pname, GLfloat param); 344 const FeatureInfo* feature_info, GLenum pname, GLfloat param);
345 345
346 // Makes each of the mip levels as though they were generated. 346 // Makes each of the mip levels as though they were generated.
347 bool MarkMipmapsGenerated(const FeatureInfo* feature_info); 347 void MarkMipmapsGenerated(const FeatureInfo* feature_info);
348 348
349 bool NeedsMips() const { 349 bool NeedsMips() const {
350 return min_filter_ != GL_NEAREST && min_filter_ != GL_LINEAR; 350 return min_filter_ != GL_NEAREST && min_filter_ != GL_LINEAR;
351 } 351 }
352 352
353 // True if this texture meets all the GLES2 criteria for rendering. 353 // True if this texture meets all the GLES2 criteria for rendering.
354 // See section 3.8.2 of the GLES2 spec. 354 // See section 3.8.2 of the GLES2 spec.
355 bool CanRender(const FeatureInfo* feature_info) const; 355 bool CanRender(const FeatureInfo* feature_info) const;
356 356
357 // Returns true if mipmaps can be generated by GL. 357 // Returns true if mipmaps can be generated by GL.
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 // Returns GL_NO_ERROR on success. Otherwise the error to generate. 749 // Returns GL_NO_ERROR on success. Otherwise the error to generate.
750 // TODO(gman): Expand to SetParameteriv,fv 750 // TODO(gman): Expand to SetParameteriv,fv
751 void SetParameteri( 751 void SetParameteri(
752 const char* function_name, ErrorState* error_state, 752 const char* function_name, ErrorState* error_state,
753 TextureRef* ref, GLenum pname, GLint param); 753 TextureRef* ref, GLenum pname, GLint param);
754 void SetParameterf( 754 void SetParameterf(
755 const char* function_name, ErrorState* error_state, 755 const char* function_name, ErrorState* error_state,
756 TextureRef* ref, GLenum pname, GLfloat param); 756 TextureRef* ref, GLenum pname, GLfloat param);
757 757
758 // Makes each of the mip levels as though they were generated. 758 // Makes each of the mip levels as though they were generated.
759 // Returns false if that's not allowed for the given texture. 759 void MarkMipmapsGenerated(TextureRef* ref);
760 bool MarkMipmapsGenerated(TextureRef* ref);
761 760
762 // Clears any uncleared renderable levels. 761 // Clears any uncleared renderable levels.
763 bool ClearRenderableLevels(GLES2Decoder* decoder, TextureRef* ref); 762 bool ClearRenderableLevels(GLES2Decoder* decoder, TextureRef* ref);
764 763
765 // Clear a specific level. 764 // Clear a specific level.
766 bool ClearTextureLevel( 765 bool ClearTextureLevel(
767 GLES2Decoder* decoder, TextureRef* ref, GLenum target, GLint level); 766 GLES2Decoder* decoder, TextureRef* ref, GLenum target, GLint level);
768 767
769 // Creates a new texture info. 768 // Creates a new texture info.
770 TextureRef* CreateTexture(GLuint client_id, GLuint service_id); 769 TextureRef* CreateTexture(GLuint client_id, GLuint service_id);
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 private: 1050 private:
1052 DecoderTextureState* texture_state_; 1051 DecoderTextureState* texture_state_;
1053 base::TimeTicks begin_time_; 1052 base::TimeTicks begin_time_;
1054 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); 1053 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer);
1055 }; 1054 };
1056 1055
1057 } // namespace gles2 1056 } // namespace gles2
1058 } // namespace gpu 1057 } // namespace gpu
1059 1058
1060 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ 1059 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698