[Apple] Use Accelerate framework to speed-up FEGaussianBlur
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Dec 2014 01:31:37 +0000 (01:31 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 9 Dec 2014 01:31:37 +0000 (01:31 +0000)
commit11d59389e178a87c0acc7c6ac8798fa99aa1790f
tree36fe7a0088213c9ce6be0f4a4252ccdbac47d10b
parent8fc4911ba66ea4e8561704e3ebcbc5e99a8a9aa0
[Apple] Use Accelerate framework to speed-up FEGaussianBlur
https://bugs.webkit.org/show_bug.cgi?id=139310
<rdar://problem/18434594>

PerformanceTests:

Reviewed by Simon Fraser.

Add an interactive performance test that measures the speed of a set
of blur operations on a generated images.

* Interactive/blur-filter-timing.html: Added.

Source/WebCore:

<rdar://problem/18434594>

Reviewed by Simon Fraser.

Using Apple's Accelerate framework provides faster blurs
than the parallel jobs approach, especially since r168577
which started performing retina-accurate filters.

Using Accelerate.framework to replace the existing box blur (what
we use to approximate Gaussian blurs) gets about a 20% speedup on
desktop class machines, but between a 2x-6x speedup on iOS hardware.
Obviously this depends on the size of the content being blurred,
but it is still good.

The change is to intercept the platformApply function on
FEGaussianBlur and send it off to Accelerate.

There is an interactive performance test: PerformanceTests/Interactive/blur-filter-timing.html

* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::kernelPosition): Move this to a file static function from the .h.
(WebCore::accelerateBoxBlur): The Accelerate implementation.
(WebCore::standardBoxBlur): The default generic/standard implementation.
(WebCore::FEGaussianBlur::platformApplyGeneric): Use accelerate or the default form.
(WebCore::FEGaussianBlur::platformApply): Don't try the parallelJobs approach if Accelerate is available.
* platform/graphics/filters/FEGaussianBlur.h:
(WebCore::FEGaussianBlur::kernelPosition): Deleted. Move into the .cpp.

Source/WTF:

<rdar://problem/18434594>

Reviewed by Simon Fraser.

Add a HAVE_ACCELERATE flag, true on Apple platforms.

* wtf/Platform.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@177000 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PerformanceTests/ChangeLog
PerformanceTests/Interactive/blur-filter-timing.html [new file with mode: 0644]
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
Source/WebCore/platform/graphics/filters/FEGaussianBlur.h