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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContextBase.h

Issue 1205573003: WebGL 2: validate read buffer attachment when reading from FBO (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed zmo@'s feedback: readbuffer is per framebuffer, not per rendering context Created 5 years, 5 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
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 844 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 bool validateCompressedTexFormat(GLenum format); 855 bool validateCompressedTexFormat(GLenum format);
856 856
857 // Helper function to validate compressed texture dimensions are valid for 857 // Helper function to validate compressed texture dimensions are valid for
858 // the given format. 858 // the given format.
859 bool validateCompressedTexDimensions(const char* functionName, TexImageFunct ionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum forma t); 859 bool validateCompressedTexDimensions(const char* functionName, TexImageFunct ionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum forma t);
860 860
861 // Helper function to validate compressed texture dimensions are valid for 861 // Helper function to validate compressed texture dimensions are valid for
862 // the given format. 862 // the given format.
863 bool validateCompressedTexSubDimensions(const char* functionName, GLenum tar get, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, G Lenum format, WebGLTexture*); 863 bool validateCompressedTexSubDimensions(const char* functionName, GLenum tar get, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, G Lenum format, WebGLTexture*);
864 864
865 // Helper function to validate that the image is attached to read buffer
866 // when reading from FBO (readPixels/copyTexImage2D/copyTexSubImage2D).
867 bool validateReadBufferAttachment(const char* functionName, const WebGLFrame buffer* readFramebufferBinding);
868
865 // Helper function to validate mode for draw{Arrays/Elements}. 869 // Helper function to validate mode for draw{Arrays/Elements}.
866 bool validateDrawMode(const char* functionName, GLenum); 870 bool validateDrawMode(const char* functionName, GLenum);
867 871
868 // Helper function to validate if front/back stencilMask and stencilFunc set tings are the same. 872 // Helper function to validate if front/back stencilMask and stencilFunc set tings are the same.
869 bool validateStencilSettings(const char* functionName); 873 bool validateStencilSettings(const char* functionName);
870 874
871 // Helper function to validate stencil or depth func. 875 // Helper function to validate stencil or depth func.
872 bool validateStencilOrDepthFunc(const char* functionName, GLenum); 876 bool validateStencilOrDepthFunc(const char* functionName, GLenum);
873 877
874 // Helper function for texParameterf and texParameteri. 878 // Helper function for texParameterf and texParameteri.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 static IntSize oldestContextSize(); 1019 static IntSize oldestContextSize();
1016 }; 1020 };
1017 1021
1018 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1022 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1019 1023
1020 } // namespace blink 1024 } // namespace blink
1021 1025
1022 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1026 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1023 1027
1024 #endif // WebGLRenderingContextBase_h 1028 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698