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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h

Issue 2370703003: Validate internalformat/format/type for uploading DOM elements to texture (Closed)
Patch Set: fix some nits Created 4 years, 2 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after
909 DrawingBuffer* m_drawingBuffer; 909 DrawingBuffer* m_drawingBuffer;
910 Member<WebGLFramebuffer> m_readFramebufferBinding; 910 Member<WebGLFramebuffer> m_readFramebufferBinding;
911 }; 911 };
912 912
913 // Errors raised by synthesizeGLError() while the context is lost. 913 // Errors raised by synthesizeGLError() while the context is lost.
914 Vector<GLenum> m_lostContextErrors; 914 Vector<GLenum> m_lostContextErrors;
915 // Other errors raised by synthesizeGLError(). 915 // Other errors raised by synthesizeGLError().
916 Vector<GLenum> m_syntheticErrors; 916 Vector<GLenum> m_syntheticErrors;
917 917
918 bool m_isWebGL2FormatsTypesAdded; 918 bool m_isWebGL2FormatsTypesAdded;
919 bool m_isWebGL2TexImageSourceFormatsTypesAdded;
919 bool m_isWebGL2InternalFormatsCopyTexImageAdded; 920 bool m_isWebGL2InternalFormatsCopyTexImageAdded;
920 bool m_isOESTextureFloatFormatsTypesAdded; 921 bool m_isOESTextureFloatFormatsTypesAdded;
921 bool m_isOESTextureHalfFloatFormatsTypesAdded; 922 bool m_isOESTextureHalfFloatFormatsTypesAdded;
922 bool m_isWebGLDepthTextureFormatsTypesAdded; 923 bool m_isWebGLDepthTextureFormatsTypesAdded;
923 bool m_isEXTsRGBFormatsTypesAdded; 924 bool m_isEXTsRGBFormatsTypesAdded;
924 925
925 std::set<GLenum> m_supportedInternalFormats; 926 std::set<GLenum> m_supportedInternalFormats;
927 std::set<GLenum> m_supportedTexImageSourceInternalFormats;
926 std::set<GLenum> m_supportedInternalFormatsCopyTexImage; 928 std::set<GLenum> m_supportedInternalFormatsCopyTexImage;
927 std::set<GLenum> m_supportedFormats; 929 std::set<GLenum> m_supportedFormats;
930 std::set<GLenum> m_supportedTexImageSourceFormats;
928 std::set<GLenum> m_supportedTypes; 931 std::set<GLenum> m_supportedTypes;
932 std::set<GLenum> m_supportedTexImageSourceTypes;
929 933
930 // Helpers for getParameter and others 934 // Helpers for getParameter and others
931 ScriptValue getBooleanParameter(ScriptState*, GLenum); 935 ScriptValue getBooleanParameter(ScriptState*, GLenum);
932 ScriptValue getBooleanArrayParameter(ScriptState*, GLenum); 936 ScriptValue getBooleanArrayParameter(ScriptState*, GLenum);
933 ScriptValue getFloatParameter(ScriptState*, GLenum); 937 ScriptValue getFloatParameter(ScriptState*, GLenum);
934 ScriptValue getIntParameter(ScriptState*, GLenum); 938 ScriptValue getIntParameter(ScriptState*, GLenum);
935 ScriptValue getInt64Parameter(ScriptState*, GLenum); 939 ScriptValue getInt64Parameter(ScriptState*, GLenum);
936 ScriptValue getUnsignedIntParameter(ScriptState*, GLenum); 940 ScriptValue getUnsignedIntParameter(ScriptState*, GLenum);
937 ScriptValue getWebGLFloatArrayParameter(ScriptState*, GLenum); 941 ScriptValue getWebGLFloatArrayParameter(ScriptState*, GLenum);
938 ScriptValue getWebGLIntArrayParameter(ScriptState*, GLenum); 942 ScriptValue getWebGLIntArrayParameter(ScriptState*, GLenum);
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 virtual WebGLTexture* validateTexImageBinding(const char*, 1054 virtual WebGLTexture* validateTexImageBinding(const char*,
1051 TexImageFunctionID, 1055 TexImageFunctionID,
1052 GLenum); 1056 GLenum);
1053 1057
1054 // Helper function to check texture 2D target and texture bound to the target. 1058 // Helper function to check texture 2D target and texture bound to the target.
1055 // Generate GL errors and return 0 if target is invalid or texture bound is 1059 // Generate GL errors and return 0 if target is invalid or texture bound is
1056 // null. Otherwise, return the texture bound to the target. 1060 // null. Otherwise, return the texture bound to the target.
1057 WebGLTexture* validateTexture2DBinding(const char* functionName, 1061 WebGLTexture* validateTexture2DBinding(const char* functionName,
1058 GLenum target); 1062 GLenum target);
1059 1063
1060 // Helper function to check input internalformat/format/type for functions {co py}Tex{Sub}Image. 1064 void addExtensionSupportedFormatsTypes();
1065
1066 // Helper function to check input internalformat/format/type for functions Tex {Sub}Image taking TexImageSource source data.
1067 // Generates GL error and returns false if parameters are invalid.
1068 bool validateTexImageSourceFormatAndType(const char* functionName,
1069 TexImageFunctionType,
1070 GLenum internalformat,
1071 GLenum format,
1072 GLenum type);
1073
1074 // Helper function to check input internalformat/format/type for functions Tex {Sub}Image.
1061 // Generates GL error and returns false if parameters are invalid. 1075 // Generates GL error and returns false if parameters are invalid.
1062 bool validateTexFuncFormatAndType(const char* functionName, 1076 bool validateTexFuncFormatAndType(const char* functionName,
1063 TexImageFunctionType, 1077 TexImageFunctionType,
1064 GLenum internalformat, 1078 GLenum internalformat,
1065 GLenum format, 1079 GLenum format,
1066 GLenum type, 1080 GLenum type,
1067 GLint level); 1081 GLint level);
1068 1082
1069 // Helper function to check readbuffer validity for copyTex{Sub}Image. 1083 // Helper function to check readbuffer validity for copyTex{Sub}Image.
1070 // If yes, obtains the bound read framebuffer, returns true. 1084 // If yes, obtains the bound read framebuffer, returns true.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1137 GLenum target, 1151 GLenum target,
1138 GLint level, 1152 GLint level,
1139 GLsizei width, 1153 GLsizei width,
1140 GLsizei height, 1154 GLsizei height,
1141 GLsizei depth); 1155 GLsizei depth);
1142 1156
1143 // Helper function to check input parameters for functions {copy}Tex{Sub}Image . 1157 // Helper function to check input parameters for functions {copy}Tex{Sub}Image .
1144 // Generates GL error and returns false if parameters are invalid. 1158 // Generates GL error and returns false if parameters are invalid.
1145 bool validateTexFuncParameters(const char* functionName, 1159 bool validateTexFuncParameters(const char* functionName,
1146 TexImageFunctionType, 1160 TexImageFunctionType,
1161 TexFuncValidationSourceType,
1147 GLenum target, 1162 GLenum target,
1148 GLint level, 1163 GLint level,
1149 GLenum internalformat, 1164 GLenum internalformat,
1150 GLsizei width, 1165 GLsizei width,
1151 GLsizei height, 1166 GLsizei height,
1152 GLsizei depth, 1167 GLsizei depth,
1153 GLint border, 1168 GLint border,
1154 GLenum format, 1169 GLenum format,
1155 GLenum type); 1170 GLenum type);
1156 1171
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1495 context, 1510 context,
1496 context->is3d(), 1511 context->is3d(),
1497 context.is3d()); 1512 context.is3d());
1498 1513
1499 } // namespace blink 1514 } // namespace blink
1500 1515
1501 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS( 1516 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(
1502 blink::WebGLRenderingContextBase::TextureUnitState); 1517 blink::WebGLRenderingContextBase::TextureUnitState);
1503 1518
1504 #endif // WebGLRenderingContextBase_h 1519 #endif // WebGLRenderingContextBase_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698