RESOLVED FIXED48674
blendFunc should generate INVALID_OPERATION if constant color and constant alpha are together as source and destination factors
https://bugs.webkit.org/show_bug.cgi?id=48674
Summary blendFunc should generate INVALID_OPERATION if constant color and constant al...
Zhenyao Mo
Reported 2010-10-29 14:15:56 PDT
WebGL spec: 6.8 Blending With Constant Color In the WebGL API, constant color and constant alpha cannot be used together as source and destination factors in the blend function. A call to blendFunc will generate an INVALID_OPERATION error if one of the two factors is set to CONSTANT_COLOR or ONE_MINUS_CONSTANT_COLOR and the other to CONSTANT_ALPHA or ONE_MINUS_CONSTANT_ALPHA. A call to blendFuncSeparate will generate an INVALID_OPERATION error if srcRGB is set to CONSTANT_COLOR or ONE_MINUS_CONSTANT_COLOR and dstRGB is set to CONSTANT_ALPHA or ONE_MINUS_CONSTANT_ALPHA or vice versa.
Attachments
patch (12.52 KB, patch)
2010-11-01 16:35 PDT, Zhenyao Mo
kbr: review-
zmo: commit-queue-
revised patch: responding to kbr's review (13.10 KB, patch)
2010-11-02 16:05 PDT, Zhenyao Mo
kbr: review+
zmo: commit-queue-
Zhenyao Mo
Comment 1 2010-11-01 16:35:49 PDT
Created attachment 72595 [details] patch test synched with khronos and I commented out the still failing parts.
Kenneth Russell
Comment 2 2010-11-02 12:09:30 PDT
Comment on attachment 72595 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=72595&action=review > WebCore/html/canvas/WebGLRenderingContext.cpp:372 > + && (srcRGB == GraphicsContext3D::CONSTANT_ALPHA || srcRGB == GraphicsContext3D::ONE_MINUS_CONSTANT_ALPHA))) { Please factor out this logic into a helper function or method and call it from both blendFunc and blendFuncSeparate.
Zhenyao Mo
Comment 3 2010-11-02 16:05:43 PDT
Created attachment 72759 [details] revised patch: responding to kbr's review
Kenneth Russell
Comment 4 2010-11-02 16:12:18 PDT
Comment on attachment 72759 [details] revised patch: responding to kbr's review Looks good.
Zhenyao Mo
Comment 5 2010-11-02 16:25:21 PDT
Note You need to log in before you can comment on or make changes to this bug.