SVG FELighting performance issues
authorzherczeg@webkit.org <zherczeg@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Nov 2010 08:36:22 +0000 (08:36 +0000)
committerzherczeg@webkit.org <zherczeg@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Nov 2010 08:36:22 +0000 (08:36 +0000)
commitf9e11683d119cd0f7b98689fc53cf99e17a1e9fb
tree38488c6cf76f76ff8a7db096b7e53a3a78467c12
parent2a37fb0572e31c487695f4db107936f39321df55
SVG FELighting performance issues
https://bugs.webkit.org/show_bug.cgi?id=48212

Reviewed by Dirk Schulze.

This patch speeds-up FELighting filter painting by 40%
It reduces the number of floating point operations and
empolys faster pixel manipulation (both for read and
write). Furthermore the length() member of FloatPoint3D
is made inline to speed up vector length calculations.

The lighting filter pixels tests are cover this patch.

* platform/graphics/FloatPoint3D.cpp:
* platform/graphics/FloatPoint3D.h:
(WebCore::FloatPoint3D::length):
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::LightingData::topLeft):
(WebCore::FELighting::LightingData::topRow):
(WebCore::FELighting::LightingData::topRight):
(WebCore::FELighting::LightingData::leftColumn):
(WebCore::FELighting::LightingData::interior):
(WebCore::FELighting::LightingData::rightColumn):
(WebCore::FELighting::LightingData::bottomLeft):
(WebCore::FELighting::LightingData::bottomRow):
(WebCore::FELighting::LightingData::bottomRight):
(WebCore::FELighting::inlineSetPixel):
(WebCore::FELighting::setPixel):
(WebCore::FELighting::drawLighting):
(WebCore::FELighting::apply):
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/LightSource.cpp:
(WebCore::PointLightSource::updatePaintingData):
(WebCore::SpotLightSource::updatePaintingData):
(WebCore::DistantLightSource::initPaintingData):
* platform/graphics/filters/LightSource.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@71222 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/platform/graphics/FloatPoint3D.cpp
WebCore/platform/graphics/FloatPoint3D.h
WebCore/platform/graphics/filters/FELighting.cpp
WebCore/platform/graphics/filters/FELighting.h
WebCore/platform/graphics/filters/LightSource.cpp
WebCore/platform/graphics/filters/LightSource.h