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

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

Issue 1426903002: gpu: Make glTexSubImage2D work with GL_SRGB_ALPHA on OpenGL (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 <algorithm> 8 #include <algorithm>
9 #include <list> 9 #include <list>
10 #include <set> 10 #include <set>
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
863 // Presumes the pointer is valid. 863 // Presumes the pointer is valid.
864 TextureRef** texture_ref); 864 TextureRef** texture_ref);
865 865
866 void ValidateAndDoTexImage( 866 void ValidateAndDoTexImage(
867 DecoderTextureState* texture_state, 867 DecoderTextureState* texture_state,
868 ContextState* state, 868 ContextState* state,
869 DecoderFramebufferState* framebuffer_state, 869 DecoderFramebufferState* framebuffer_state,
870 const char* function_name, 870 const char* function_name,
871 const DoTexImageArguments& args); 871 const DoTexImageArguments& args);
872 872
873 struct DoTexSubImageArguments {
874 GLenum target;
875 GLint level;
876 GLint xoffset;
877 GLint yoffset;
878 GLsizei width;
879 GLsizei height;
880 GLenum format;
881 GLenum type;
882 const void* pixels;
883 uint32 pixels_size;
884 // TODO(kkinnunen): currently this is used only for TexSubImage2D.
885 };
886
887 bool ValidateTexSubImage(
888 ContextState* state,
889 const char* function_name,
890 const DoTexSubImageArguments& args,
891 // Pointer to TextureRef filled in if validation successful.
892 // Presumes the pointer is valid.
893 TextureRef** texture_ref);
894
895 void ValidateAndDoTexSubImage(GLES2Decoder* decoder,
896 DecoderTextureState* texture_state,
897 ContextState* state,
898 DecoderFramebufferState* framebuffer_state,
899 const char* function_name,
900 const DoTexSubImageArguments& args);
901
873 // TODO(kloveless): Make GetTexture* private once this is no longer called 902 // TODO(kloveless): Make GetTexture* private once this is no longer called
874 // from gles2_cmd_decoder. 903 // from gles2_cmd_decoder.
875 TextureRef* GetTextureInfoForTarget(ContextState* state, GLenum target); 904 TextureRef* GetTextureInfoForTarget(ContextState* state, GLenum target);
876 TextureRef* GetTextureInfoForTargetUnlessDefault( 905 TextureRef* GetTextureInfoForTargetUnlessDefault(
877 ContextState* state, GLenum target); 906 ContextState* state, GLenum target);
878 907
879 // Note that internal_format is only checked in relation to the format 908 // Note that internal_format is only checked in relation to the format
880 // parameter, so that this function may be used to validate texSubImage2D. 909 // parameter, so that this function may be used to validate texSubImage2D.
881 bool ValidateTextureParameters( 910 bool ValidateTextureParameters(
882 ErrorState* error_state, const char* function_name, 911 ErrorState* error_state, const char* function_name,
883 GLenum format, GLenum type, GLenum internal_format, GLint level); 912 GLenum format, GLenum type, GLenum internal_format, GLint level);
884 913
885 // base::trace_event::MemoryDumpProvider implementation. 914 // base::trace_event::MemoryDumpProvider implementation.
886 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args, 915 bool OnMemoryDump(const base::trace_event::MemoryDumpArgs& args,
887 base::trace_event::ProcessMemoryDump* pmd) override; 916 base::trace_event::ProcessMemoryDump* pmd) override;
888 917
918 // Returns the union of |rect1| and |rect2| if one of the rectangles is empty,
919 // contains the other rectangle or shares an edge with the other rectangle.
920 // Part of the public interface because texture pixel data rectangle
921 // operations are also implemented in decoder at the moment.
922 static bool CombineAdjacentRects(const gfx::Rect& rect1,
923 const gfx::Rect& rect2,
924 gfx::Rect* result);
925
889 private: 926 private:
890 friend class Texture; 927 friend class Texture;
891 friend class TextureRef; 928 friend class TextureRef;
892 929
893 // Helper for Initialize(). 930 // Helper for Initialize().
894 scoped_refptr<TextureRef> CreateDefaultAndBlackTextures( 931 scoped_refptr<TextureRef> CreateDefaultAndBlackTextures(
895 GLenum target, 932 GLenum target,
896 GLuint* black_texture); 933 GLuint* black_texture);
897 934
898 void DoTexImage( 935 void DoTexImage(
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
974 private: 1011 private:
975 DecoderTextureState* texture_state_; 1012 DecoderTextureState* texture_state_;
976 base::TimeTicks begin_time_; 1013 base::TimeTicks begin_time_;
977 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer); 1014 DISALLOW_COPY_AND_ASSIGN(ScopedTextureUploadTimer);
978 }; 1015 };
979 1016
980 } // namespace gles2 1017 } // namespace gles2
981 } // namespace gpu 1018 } // namespace gpu
982 1019
983 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_ 1020 #endif // GPU_COMMAND_BUFFER_SERVICE_TEXTURE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698