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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 | 245 |
246 // Clears any renderable uncleared levels. | 246 // Clears any renderable uncleared levels. |
247 // Returns false if a GL error was generated. | 247 // Returns false if a GL error was generated. |
248 bool ClearRenderableLevels(GLES2Decoder* decoder); | 248 bool ClearRenderableLevels(GLES2Decoder* decoder); |
249 | 249 |
250 // Clears the level. | 250 // Clears the level. |
251 // Returns false if a GL error was generated. | 251 // Returns false if a GL error was generated. |
252 bool ClearLevel(GLES2Decoder* decoder, GLenum target, GLint level); | 252 bool ClearLevel(GLES2Decoder* decoder, GLenum target, GLint level); |
253 | 253 |
254 // Sets a texture parameter. | 254 // Sets a texture parameter. |
255 // TODO(gman): Expand to SetParameteri,f,iv,fv | 255 // TODO(gman): Expand to SetParameteriv,fv |
256 // Returns GL_NO_ERROR on success. Otherwise the error to generate. | 256 // Returns GL_NO_ERROR on success. Otherwise the error to generate. |
257 GLenum SetParameter( | 257 GLenum SetParameteri( |
258 const FeatureInfo* feature_info, GLenum pname, GLint param); | 258 const FeatureInfo* feature_info, GLenum pname, GLint param); |
| 259 GLenum SetParameterf( |
| 260 const FeatureInfo* feature_info, GLenum pname, GLfloat param); |
259 | 261 |
260 // Makes each of the mip levels as though they were generated. | 262 // Makes each of the mip levels as though they were generated. |
261 bool MarkMipmapsGenerated(const FeatureInfo* feature_info); | 263 bool MarkMipmapsGenerated(const FeatureInfo* feature_info); |
262 | 264 |
263 bool NeedsMips() const { | 265 bool NeedsMips() const { |
264 return min_filter_ != GL_NEAREST && min_filter_ != GL_LINEAR; | 266 return min_filter_ != GL_NEAREST && min_filter_ != GL_LINEAR; |
265 } | 267 } |
266 | 268 |
267 // True if this texture meets all the GLES2 criteria for rendering. | 269 // True if this texture meets all the GLES2 criteria for rendering. |
268 // See section 3.8.2 of the GLES2 spec. | 270 // See section 3.8.2 of the GLES2 spec. |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 | 571 |
570 // Maps an existing texture into the texture manager, at a given client ID. | 572 // Maps an existing texture into the texture manager, at a given client ID. |
571 TextureRef* Consume(GLuint client_id, Texture* texture); | 573 TextureRef* Consume(GLuint client_id, Texture* texture); |
572 | 574 |
573 // Sets a mip as cleared. | 575 // Sets a mip as cleared. |
574 void SetLevelCleared(TextureRef* ref, GLenum target, | 576 void SetLevelCleared(TextureRef* ref, GLenum target, |
575 GLint level, bool cleared); | 577 GLint level, bool cleared); |
576 | 578 |
577 // Sets a texture parameter of a Texture | 579 // Sets a texture parameter of a Texture |
578 // Returns GL_NO_ERROR on success. Otherwise the error to generate. | 580 // Returns GL_NO_ERROR on success. Otherwise the error to generate. |
579 // TODO(gman): Expand to SetParameteri,f,iv,fv | 581 // TODO(gman): Expand to SetParameteriv,fv |
580 void SetParameter( | 582 void SetParameteri( |
581 const char* function_name, ErrorState* error_state, | 583 const char* function_name, ErrorState* error_state, |
582 TextureRef* ref, GLenum pname, GLint param); | 584 TextureRef* ref, GLenum pname, GLint param); |
| 585 void SetParameterf( |
| 586 const char* function_name, ErrorState* error_state, |
| 587 TextureRef* ref, GLenum pname, GLfloat param); |
583 | 588 |
584 // Makes each of the mip levels as though they were generated. | 589 // Makes each of the mip levels as though they were generated. |
585 // Returns false if that's not allowed for the given texture. | 590 // Returns false if that's not allowed for the given texture. |
586 bool MarkMipmapsGenerated(TextureRef* ref); | 591 bool MarkMipmapsGenerated(TextureRef* ref); |
587 | 592 |
588 // Clears any uncleared renderable levels. | 593 // Clears any uncleared renderable levels. |
589 bool ClearRenderableLevels(GLES2Decoder* decoder, TextureRef* ref); | 594 bool ClearRenderableLevels(GLES2Decoder* decoder, TextureRef* ref); |
590 | 595 |
591 // Clear a specific level. | 596 // Clear a specific level. |
592 bool ClearTextureLevel( | 597 bool ClearTextureLevel( |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 private: | 803 private: |
799 DecoderTextureState* texture_state_; | 804 DecoderTextureState* texture_state_; |
800 base::TimeTicks begin_time_; | 805 base::TimeTicks begin_time_; |
801 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 806 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
802 }; | 807 }; |
803 | 808 |
804 } // namespace gles2 | 809 } // namespace gles2 |
805 } // namespace gpu | 810 } // namespace gpu |
806 | 811 |
807 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 812 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |