Changeset 71185 in webkit
- Timestamp:
- Nov 2, 2010 4:25:00 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r71184 r71185 1 2010-11-01 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 blendFunc should generate INVALID_OPERATION if constant color and constant alpha are together as source and destination factors 6 https://bugs.webkit.org/show_bug.cgi?id=48674 7 8 * fast/canvas/webgl/webgl-specific-expected.txt: Added. 9 * fast/canvas/webgl/webgl-specific.html: Added. 10 1 11 2010-11-02 Dmitry Titov <dimich@chromium.org> 2 12 -
trunk/WebCore/ChangeLog
r71182 r71185 1 2010-11-01 Zhenyao Mo <zmo@google.com> 2 3 Reviewed by Kenneth Russell. 4 5 blendFunc should generate INVALID_OPERATION if constant color and constant alpha are together as source and destination factors 6 https://bugs.webkit.org/show_bug.cgi?id=48674 7 8 Test: fast/canvas/webgl/webgl-specific.html 9 10 * html/canvas/WebGLRenderingContext.cpp: 11 (WebCore::WebGLRenderingContext::blendFunc): 12 (WebCore::WebGLRenderingContext::blendFuncSeparate): 13 * html/canvas/WebGLRenderingContext.h: 14 (WebCore::WebGLRenderingContext::validateBlendFuncFactors): Helper function to do the checking. 15 1 16 2010-11-02 Simon Fraser <simon.fraser@apple.com> 2 17 -
trunk/WebCore/html/canvas/WebGLRenderingContext.cpp
r71164 r71185 354 354 void WebGLRenderingContext::blendFunc(unsigned long sfactor, unsigned long dfactor) 355 355 { 356 if (!validateBlendFuncFactors(sfactor, dfactor)) 357 return; 356 358 m_context->blendFunc(sfactor, dfactor); 357 359 cleanupAfterGraphicsCall(false); … … 360 362 void WebGLRenderingContext::blendFuncSeparate(unsigned long srcRGB, unsigned long dstRGB, unsigned long srcAlpha, unsigned long dstAlpha) 361 363 { 364 if (!validateBlendFuncFactors(srcRGB, dstRGB)) 365 return; 362 366 m_context->blendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha); 363 367 cleanupAfterGraphicsCall(false); … … 3394 3398 } 3395 3399 3400 bool WebGLRenderingContext::validateBlendFuncFactors(unsigned long src, unsigned long dst) 3401 { 3402 if (((src == GraphicsContext3D::CONSTANT_COLOR || src == GraphicsContext3D::ONE_MINUS_CONSTANT_COLOR) 3403 && (dst == GraphicsContext3D::CONSTANT_ALPHA || dst == GraphicsContext3D::ONE_MINUS_CONSTANT_ALPHA)) 3404 || ((dst == GraphicsContext3D::CONSTANT_COLOR || dst == GraphicsContext3D::ONE_MINUS_CONSTANT_COLOR) 3405 && (src == GraphicsContext3D::CONSTANT_ALPHA || src == GraphicsContext3D::ONE_MINUS_CONSTANT_ALPHA))) { 3406 m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION); 3407 return false; 3408 } 3409 return true; 3410 } 3411 3396 3412 bool WebGLRenderingContext::validateCapability(unsigned long cap) 3397 3413 { -
trunk/WebCore/html/canvas/WebGLRenderingContext.h
r70661 r71185 496 496 bool validateBlendEquation(unsigned long); 497 497 498 // Helper function to validate blend func factors. 499 bool validateBlendFuncFactors(unsigned long src, unsigned long dst); 500 498 501 // Helper function to validate a GL capability. 499 502 bool validateCapability(unsigned long);
Note: See TracChangeset
for help on using the changeset viewer.