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

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

Issue 1414853008: Validate pixel data array is enough for request by texImage3D and texSubImage3D (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clean rebase 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 /* 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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 bool validateTexFuncParameters(const char* functionName, TexImageFunctionTyp e, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei hei ght, GLsizei depth, GLint border, GLenum format, GLenum type); 927 bool validateTexFuncParameters(const char* functionName, TexImageFunctionTyp e, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei hei ght, GLsizei depth, GLint border, GLenum format, GLenum type);
928 928
929 enum NullDisposition { 929 enum NullDisposition {
930 NullAllowed, 930 NullAllowed,
931 NullNotAllowed 931 NullNotAllowed
932 }; 932 };
933 933
934 // Helper function to validate that the given ArrayBufferView 934 // Helper function to validate that the given ArrayBufferView
935 // is of the correct type and contains enough data for the texImage call. 935 // is of the correct type and contains enough data for the texImage call.
936 // Generates GL error and returns false if parameters are invalid. 936 // Generates GL error and returns false if parameters are invalid.
937 bool validateTexFuncData(const char* functionName, GLint level, GLsizei widt h, GLsizei height, GLenum format, GLenum type, DOMArrayBufferView* pixels, NullD isposition); 937 bool validateTexFuncData(const char* functionName, GLint level, GLsizei widt h, GLsizei height, GLsizei depth, GLenum format, GLenum type, DOMArrayBufferView * pixels, NullDisposition);
938 938
939 // Helper function to validate that a copyTexSubImage call is valid. 939 // Helper function to validate that a copyTexSubImage call is valid.
940 bool validateCopyTexSubImage(const char* functionName, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei wi dth, GLsizei height); 940 bool validateCopyTexSubImage(const char* functionName, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei wi dth, GLsizei height);
941 941
942 // Helper function to validate a given texture format is settable as in 942 // Helper function to validate a given texture format is settable as in
943 // you can supply data to texImage2D, or call texImage2D, copyTexImage2D and 943 // you can supply data to texImage2D, or call texImage2D, copyTexImage2D and
944 // copyTexSubImage2D. 944 // copyTexSubImage2D.
945 // Generates GL error and returns false if the format is not settable. 945 // Generates GL error and returns false if the format is not settable.
946 bool validateSettableTexFormat(const char* functionName, GLenum format); 946 bool validateSettableTexFormat(const char* functionName, GLenum format);
947 947
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 static WebGLRenderingContextBase* oldestEvictedContext(); 1132 static WebGLRenderingContextBase* oldestEvictedContext();
1133 }; 1133 };
1134 1134
1135 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1135 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1136 1136
1137 } // namespace blink 1137 } // namespace blink
1138 1138
1139 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1139 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1140 1140
1141 #endif // WebGLRenderingContextBase_h 1141 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698