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

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

Issue 1120953002: WebGL 2: add read/write framebuffer binding points to related APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: addressed kbr@'s feedback Created 5 years, 7 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 PassRefPtrWillBeRawPtr<WebGLBuffer> createBuffer(); 159 PassRefPtrWillBeRawPtr<WebGLBuffer> createBuffer();
160 PassRefPtrWillBeRawPtr<WebGLFramebuffer> createFramebuffer(); 160 PassRefPtrWillBeRawPtr<WebGLFramebuffer> createFramebuffer();
161 PassRefPtrWillBeRawPtr<WebGLProgram> createProgram(); 161 PassRefPtrWillBeRawPtr<WebGLProgram> createProgram();
162 PassRefPtrWillBeRawPtr<WebGLRenderbuffer> createRenderbuffer(); 162 PassRefPtrWillBeRawPtr<WebGLRenderbuffer> createRenderbuffer();
163 PassRefPtrWillBeRawPtr<WebGLShader> createShader(GLenum type); 163 PassRefPtrWillBeRawPtr<WebGLShader> createShader(GLenum type);
164 PassRefPtrWillBeRawPtr<WebGLTexture> createTexture(); 164 PassRefPtrWillBeRawPtr<WebGLTexture> createTexture();
165 165
166 void cullFace(GLenum mode); 166 void cullFace(GLenum mode);
167 167
168 void deleteBuffer(WebGLBuffer*); 168 void deleteBuffer(WebGLBuffer*);
169 void deleteFramebuffer(WebGLFramebuffer*); 169 virtual void deleteFramebuffer(WebGLFramebuffer*);
170 void deleteProgram(WebGLProgram*); 170 void deleteProgram(WebGLProgram*);
171 void deleteRenderbuffer(WebGLRenderbuffer*); 171 void deleteRenderbuffer(WebGLRenderbuffer*);
172 void deleteShader(WebGLShader*); 172 void deleteShader(WebGLShader*);
173 void deleteTexture(WebGLTexture*); 173 void deleteTexture(WebGLTexture*);
174 174
175 void depthFunc(GLenum); 175 void depthFunc(GLenum);
176 void depthMask(GLboolean); 176 void depthMask(GLboolean);
177 void depthRange(GLfloat zNear, GLfloat zFar); 177 void depthRange(GLfloat zNear, GLfloat zFar);
178 void detachShader(WebGLProgram*, WebGLShader*); 178 void detachShader(WebGLProgram*, WebGLShader*);
179 void disable(GLenum cap); 179 void disable(GLenum cap);
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 773
774 void handleTextureCompleteness(const char*, bool); 774 void handleTextureCompleteness(const char*, bool);
775 void createFallbackBlackTextures1x1(); 775 void createFallbackBlackTextures1x1();
776 776
777 // Helper function for copyTex{Sub}Image, check whether the internalformat 777 // Helper function for copyTex{Sub}Image, check whether the internalformat
778 // and the color buffer format of the current bound framebuffer combination 778 // and the color buffer format of the current bound framebuffer combination
779 // is valid. 779 // is valid.
780 bool isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat , GLenum colorBufferFormat); 780 bool isTexInternalFormatColorBufferCombinationValid(GLenum texInternalFormat , GLenum colorBufferFormat);
781 781
782 // Helper function to get the bound framebuffer's color buffer format. 782 // Helper function to get the bound framebuffer's color buffer format.
783 GLenum boundFramebufferColorFormat(); 783 virtual GLenum boundFramebufferColorFormat();
784 784
785 // Helper function to verify limits on the length of uniform and attribute l ocations. 785 // Helper function to verify limits on the length of uniform and attribute l ocations.
786 bool validateLocationLength(const char* functionName, const String&); 786 bool validateLocationLength(const char* functionName, const String&);
787 787
788 // Helper function to check if size is non-negative. 788 // Helper function to check if size is non-negative.
789 // Generate GL error and return false for negative inputs; otherwise, return true. 789 // Generate GL error and return false for negative inputs; otherwise, return true.
790 bool validateSize(const char* functionName, GLint x, GLint y); 790 bool validateSize(const char* functionName, GLint x, GLint y);
791 791
792 // Helper function to check if all characters in the string belong to the 792 // Helper function to check if all characters in the string belong to the
793 // ASCII subset as defined in GLSL ES 1.0 spec section 3.1. 793 // ASCII subset as defined in GLSL ES 1.0 spec section 3.1.
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
888 // Helper function to validate the target for checkFramebufferStatus and val idateFramebufferFuncParameters. 888 // Helper function to validate the target for checkFramebufferStatus and val idateFramebufferFuncParameters.
889 virtual bool validateFramebufferTarget(GLenum target); 889 virtual bool validateFramebufferTarget(GLenum target);
890 890
891 // Get the framebuffer bound to given target 891 // Get the framebuffer bound to given target
892 virtual WebGLFramebuffer* getFramebufferBinding(GLenum target); 892 virtual WebGLFramebuffer* getFramebufferBinding(GLenum target);
893 893
894 // Helper function to validate input parameters for framebuffer functions. 894 // Helper function to validate input parameters for framebuffer functions.
895 // Generate GL error if parameters are illegal. 895 // Generate GL error if parameters are illegal.
896 bool validateFramebufferFuncParameters(const char* functionName, GLenum targ et, GLenum attachment); 896 bool validateFramebufferFuncParameters(const char* functionName, GLenum targ et, GLenum attachment);
897 897
898 // Helper function to get draw Framebuffer target. Return GL_FRAMEBUFFER for
899 // WebGLRenderingContext. Return GL_DRAW_FRAMEBUFFER for WebGL2RenderingCont ext.
900 virtual GLenum getDrawFramebufferTarget();
901
898 // Helper function to validate blend equation mode. 902 // Helper function to validate blend equation mode.
899 bool validateBlendEquation(const char* functionName, GLenum); 903 bool validateBlendEquation(const char* functionName, GLenum);
900 904
901 // Helper function to validate blend func factors. 905 // Helper function to validate blend func factors.
902 bool validateBlendFuncFactors(const char* functionName, GLenum src, GLenum d st); 906 bool validateBlendFuncFactors(const char* functionName, GLenum src, GLenum d st);
903 907
904 // Helper function to validate a GL capability. 908 // Helper function to validate a GL capability.
905 virtual bool validateCapability(const char* functionName, GLenum); 909 virtual bool validateCapability(const char* functionName, GLenum);
906 910
907 // Helper function to validate input parameters for uniform functions. 911 // Helper function to validate input parameters for uniform functions.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 IntSize clampedCanvasSize(); 987 IntSize clampedCanvasSize();
984 988
985 // First time called, if EXT_draw_buffers is supported, query the value; oth erwise return 0. 989 // First time called, if EXT_draw_buffers is supported, query the value; oth erwise return 0.
986 // Later, return the cached value. 990 // Later, return the cached value.
987 GLint maxDrawBuffers(); 991 GLint maxDrawBuffers();
988 GLint maxColorAttachments(); 992 GLint maxColorAttachments();
989 993
990 void setBackDrawBuffer(GLenum); 994 void setBackDrawBuffer(GLenum);
991 void setFramebuffer(GLenum, WebGLFramebuffer*); 995 void setFramebuffer(GLenum, WebGLFramebuffer*);
992 996
993 void restoreCurrentFramebuffer(); 997 virtual void restoreCurrentFramebuffer();
994 void restoreCurrentTexture2D(); 998 void restoreCurrentTexture2D();
995 999
996 virtual void multisamplingChanged(bool) override; 1000 virtual void multisamplingChanged(bool) override;
997 1001
998 void findNewMaxNonDefaultTextureUnit(); 1002 void findNewMaxNonDefaultTextureUnit();
999 1003
1000 friend class WebGLStateRestorer; 1004 friend class WebGLStateRestorer;
1001 friend class WebGLRenderingContextEvictionManager; 1005 friend class WebGLRenderingContextEvictionManager;
1002 1006
1003 static Vector<WebGLRenderingContextBase*>& activeContexts(); 1007 static Vector<WebGLRenderingContextBase*>& activeContexts();
(...skipping 11 matching lines...) Expand all
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