[Webkit-unassigned] [Bug 103728] Optimize ColorMatrix filter

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 4 08:53:31 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=103728


Dirk Schulze <krit at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #176934|review?, commit-queue?      |review+
               Flag|                            |




--- Comment #4 from Dirk Schulze <krit at webkit.org>  2012-12-04 08:55:57 PST ---
(From update of attachment 176934)
View in context: https://bugs.webkit.org/attachment.cgi?id=176934&action=review

Looks reasonable to me. r=me. I am just not sure about the following:

> Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp:136
> +    if (filterType == FECOLORMATRIX_TYPE_SATURATE) {
> +        components[0] = (0.213 + 0.787 * values[0]);
> +        components[1] = (0.715 - 0.715 * values[0]);
> +        components[2] = (0.072 - 0.072 * values[0]);
> +        components[3] = (0.213 - 0.213 * values[0]);
> +        components[4] = (0.715 + 0.285 * values[0]);
> +        components[5] = (0.072 - 0.072 * values[0]);
> +        components[6] = (0.213 - 0.213 * values[0]);
> +        components[7] = (0.715 - 0.715 * values[0]);
> +        components[8] = (0.072 + 0.928 * values[0]);
> +    } else if (filterType == FECOLORMATRIX_TYPE_HUEROTATE) {
> +        float cosHue = cos(values[0] * piFloat / 180);
> +        float sinHue = sin(values[0] * piFloat / 180);
> +        components[0] = 0.213 + cosHue * 0.787 - sinHue * 0.213;
> +        components[1] = 0.715 - cosHue * 0.715 - sinHue * 0.715;
> +        components[2] = 0.072 - cosHue * 0.072 + sinHue * 0.928;
> +        components[3] = 0.213 - cosHue * 0.213 + sinHue * 0.143;
> +        components[4] = 0.715 + cosHue * 0.285 + sinHue * 0.140;
> +        components[5] = 0.072 - cosHue * 0.072 - sinHue * 0.283;
> +        components[6] = 0.213 - cosHue * 0.213 - sinHue * 0.787;
> +        components[7] = 0.715 - cosHue * 0.715 + sinHue * 0.715;
> +        components[8] = 0.072 + cosHue * 0.928 + sinHue * 0.072;
> +    }

Does it make sense to move this in inline functions? It looks so strange here and makes it less readable. Please consider it before landing.

-- 
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