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

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 kbr@'s feedback: translate GL_BACK to GL_COLOR_ATTACHMENT0 on default fb of WebGL Created 5 years, 6 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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 GLint m_maxViewportDims[2]; 562 GLint m_maxViewportDims[2];
563 GLint m_maxTextureLevel; 563 GLint m_maxTextureLevel;
564 GLint m_maxCubeMapTextureLevel; 564 GLint m_maxCubeMapTextureLevel;
565 565
566 GLint m_maxDrawBuffers; 566 GLint m_maxDrawBuffers;
567 GLint m_maxColorAttachments; 567 GLint m_maxColorAttachments;
568 GLenum m_backDrawBuffer; 568 GLenum m_backDrawBuffer;
569 bool m_drawBuffersWebGLRequirementsChecked; 569 bool m_drawBuffersWebGLRequirementsChecked;
570 bool m_drawBuffersSupported; 570 bool m_drawBuffersSupported;
571 571
572 GLenum m_readbufferOfFBO;
573
572 GLint m_packAlignment; 574 GLint m_packAlignment;
573 GLint m_unpackAlignment; 575 GLint m_unpackAlignment;
574 bool m_unpackFlipY; 576 bool m_unpackFlipY;
575 bool m_unpackPremultiplyAlpha; 577 bool m_unpackPremultiplyAlpha;
576 GLenum m_unpackColorspaceConversion; 578 GLenum m_unpackColorspaceConversion;
577 WebGLContextAttributes m_requestedAttributes; 579 WebGLContextAttributes m_requestedAttributes;
578 580
579 GLfloat m_clearColor[4]; 581 GLfloat m_clearColor[4];
580 bool m_scissorEnabled; 582 bool m_scissorEnabled;
581 GLfloat m_clearDepth; 583 GLfloat m_clearDepth;
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 bool validateCompressedTexFormat(GLenum format); 857 bool validateCompressedTexFormat(GLenum format);
856 858
857 // Helper function to validate compressed texture dimensions are valid for 859 // Helper function to validate compressed texture dimensions are valid for
858 // the given format. 860 // the given format.
859 bool validateCompressedTexDimensions(const char* functionName, TexImageFunct ionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum forma t); 861 bool validateCompressedTexDimensions(const char* functionName, TexImageFunct ionType, GLenum target, GLint level, GLsizei width, GLsizei height, GLenum forma t);
860 862
861 // Helper function to validate compressed texture dimensions are valid for 863 // Helper function to validate compressed texture dimensions are valid for
862 // the given format. 864 // 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*); 865 bool validateCompressedTexSubDimensions(const char* functionName, GLenum tar get, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, G Lenum format, WebGLTexture*);
864 866
867 // Helper function to validate that the image is attached to read buffer
868 // when reading from FBO (readPixels/copyTexImage2D/copyTexSubImage2D).
869 bool validateReadBufferAttachment(const char* functionName, const WebGLFrame buffer* readFramebufferBinding);
870
865 // Helper function to validate mode for draw{Arrays/Elements}. 871 // Helper function to validate mode for draw{Arrays/Elements}.
866 bool validateDrawMode(const char* functionName, GLenum); 872 bool validateDrawMode(const char* functionName, GLenum);
867 873
868 // Helper function to validate if front/back stencilMask and stencilFunc set tings are the same. 874 // Helper function to validate if front/back stencilMask and stencilFunc set tings are the same.
869 bool validateStencilSettings(const char* functionName); 875 bool validateStencilSettings(const char* functionName);
870 876
871 // Helper function to validate stencil or depth func. 877 // Helper function to validate stencil or depth func.
872 bool validateStencilOrDepthFunc(const char* functionName, GLenum); 878 bool validateStencilOrDepthFunc(const char* functionName, GLenum);
873 879
874 // Helper function for texParameterf and texParameteri. 880 // Helper function for texParameterf and texParameteri.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1015 static IntSize oldestContextSize(); 1021 static IntSize oldestContextSize();
1016 }; 1022 };
1017 1023
1018 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1024 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1019 1025
1020 } // namespace blink 1026 } // namespace blink
1021 1027
1022 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1028 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1023 1029
1024 #endif // WebGLRenderingContextBase_h 1030 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698