[Webkit-unassigned] [Bug 98504] [CSS Shaders] Implement overlay, color-dodge, color-burn, hard-light, soft-light blend modes.
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Oct 10 15:34:47 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=98504
--- Comment #7 from Max Vujovic <mvujovic at adobe.com> 2012-10-10 15:35:26 PST ---
(From update of attachment 167959)
This looks great! Thanks for making the changes. I don't have any other change requests.
View in context: https://bugs.webkit.org/attachment.cgi?id=167959&action=review
>> Source/WebCore/platform/graphics/filters/CustomFilterValidatedProgram.cpp:234
>> + blendComponentExpression = SHADER(
>
> I don't check the divide by zero, because 1.0 - Cs can not zero if Cs < 1.0.
> I don't use clamp, because we are checking Cs < 1.0, not Co < 1.0. (clamp(genIType x, genIType minVal, genIType maxVal))
> Please let me know if I misunderstand your suggestion.
Ok, the divide by zero check should be fine.
Not using clamp should be fine, too.
Regarding clamp, my assumption was that some of these expressions could produce a Co that is out of the range [0.0, 1.0]. That would be a problem because the alpha compositing operation after this blending operation expects colors in the range [0.0, 1.0].
However, I analyzed the blending expressions and it appears they're all carefully crafted to make sure Co ends up in [0.0, 1.0] if Cs and Cb are in [0.0, 1.0]. Thus, I think what you have is ok, and we don't need an extra clamp(Co, 0.0, 1.0).
Unrelated to this bug, I think we need to clamp multipliedColor before passing it to css_BlendColor, so that Cs is in the [0.0, 1.0] range. A matrix multiplication can definitely push multipliedColor out of the [0.0, 1.0] range. I'll make a bug for this issue.
For the record, OS X Grapher [1] is amazing at analyzing these expressions. I made 3D graphs which mapped Co => z, Cb => x, Cb => y, and verified that z stayed between 0 and 1 while x and y were between 0 and 1.
[1]: http://en.wikipedia.org/wiki/Grapher
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list