Do some minor FEColorMatrix code cleanup and optimization
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2017 00:01:25 +0000 (00:01 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2017 00:01:25 +0000 (00:01 +0000)
commitdcc85c3cdfb81b5a44f00e56370d014882408667
tree82e461a69bddf760749a28d78f00f17963c6b3b5
parentacf8d5cb0bc6e5eed42a68cf3e343dc03ebade08
Do some minor FEColorMatrix code cleanup and optimization
https://bugs.webkit.org/show_bug.cgi?id=170474

Reviewed by Dean Jackson.

Don't switch inside of a pixel processing loop; repeat the loop inside switch (filterType).

Change matrix() and saturateAndHueRotate() to dereference the source pixels once, instead
of multiple times, which is faster.

This kind of code benefits from aligning things with spaces for readability, so do so,
violating webkit style.

Add some off-by-default performance logging code.

Increases pixel processing performance from about 86ms per megapixel to 65ms per megapixel.

* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::matrix):
(WebCore::saturateAndHueRotate):
(WebCore::effectType):
(WebCore::FEColorMatrix::platformApplySoftware):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215068 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog