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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 // Get the image bound to a particular level. Returns NULL if level | 110 // Get the image bound to a particular level. Returns NULL if level |
111 // does not exist. | 111 // does not exist. |
112 gfx::GLImage* GetLevelImage(GLint target, GLint level) const; | 112 gfx::GLImage* GetLevelImage(GLint target, GLint level) const; |
113 | 113 |
114 bool HasImages() const { | 114 bool HasImages() const { |
115 return has_images_; | 115 return has_images_; |
116 } | 116 } |
117 | 117 |
118 // Returns true of the given dimensions are inside the dimensions of the | 118 // Returns true of the given dimensions are inside the dimensions of the |
119 // level and if the format and type match the level. | 119 // level and if the type matches the level. |
120 bool ValidForTexture( | 120 bool ValidForTexture( |
121 GLint target, | 121 GLint target, |
122 GLint level, | 122 GLint level, |
123 GLint xoffset, | 123 GLint xoffset, |
124 GLint yoffset, | 124 GLint yoffset, |
125 GLsizei width, | 125 GLsizei width, |
126 GLsizei height, | 126 GLsizei height, |
127 GLenum format, | |
128 GLenum type) const; | 127 GLenum type) const; |
129 | 128 |
130 bool IsValid() const { | 129 bool IsValid() const { |
131 return !!target(); | 130 return !!target(); |
132 } | 131 } |
133 | 132 |
134 bool IsAttachedToFramebuffer() const { | 133 bool IsAttachedToFramebuffer() const { |
135 return framebuffer_attachment_count_ != 0; | 134 return framebuffer_attachment_count_ != 0; |
136 } | 135 } |
137 | 136 |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 ContextState* state, | 699 ContextState* state, |
701 DecoderFramebufferState* framebuffer_state, | 700 DecoderFramebufferState* framebuffer_state, |
702 const DoTextImage2DArguments& args); | 701 const DoTextImage2DArguments& args); |
703 | 702 |
704 // TODO(kloveless): Make GetTexture* private once this is no longer called | 703 // TODO(kloveless): Make GetTexture* private once this is no longer called |
705 // from gles2_cmd_decoder. | 704 // from gles2_cmd_decoder. |
706 TextureRef* GetTextureInfoForTarget(ContextState* state, GLenum target); | 705 TextureRef* GetTextureInfoForTarget(ContextState* state, GLenum target); |
707 TextureRef* GetTextureInfoForTargetUnlessDefault( | 706 TextureRef* GetTextureInfoForTargetUnlessDefault( |
708 ContextState* state, GLenum target); | 707 ContextState* state, GLenum target); |
709 | 708 |
| 709 bool ValidateFormatAndTypeCombination( |
| 710 ErrorState* error_state, const char* function_name, |
| 711 GLenum format, GLenum type); |
| 712 |
| 713 // Note that internal_format is only checked in relation to the format |
| 714 // parameter, so that this function may be used to validate texSubImage2D. |
710 bool ValidateTextureParameters( | 715 bool ValidateTextureParameters( |
711 ErrorState* error_state, const char* function_name, | 716 ErrorState* error_state, const char* function_name, |
712 GLenum target, GLenum format, GLenum type, GLint level); | 717 GLenum format, GLenum type, GLenum internal_format, GLint level); |
713 | 718 |
714 private: | 719 private: |
715 friend class Texture; | 720 friend class Texture; |
716 friend class TextureRef; | 721 friend class TextureRef; |
717 | 722 |
718 // Helper for Initialize(). | 723 // Helper for Initialize(). |
719 scoped_refptr<TextureRef> CreateDefaultAndBlackTextures( | 724 scoped_refptr<TextureRef> CreateDefaultAndBlackTextures( |
720 GLenum target, | 725 GLenum target, |
721 GLuint* black_texture); | 726 GLuint* black_texture); |
722 | 727 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
787 private: | 792 private: |
788 DecoderTextureState* texture_state_; | 793 DecoderTextureState* texture_state_; |
789 base::TimeTicks begin_time_; | 794 base::TimeTicks begin_time_; |
790 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); | 795 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); |
791 }; | 796 }; |
792 | 797 |
793 } // namespace gles2 | 798 } // namespace gles2 |
794 } // namespace gpu | 799 } // namespace gpu |
795 | 800 |
796 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ | 801 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ |
OLD | NEW |