Make FilterEffect::apply() independent of image data management
authorkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2011 13:27:31 +0000 (13:27 +0000)
committerkrit@webkit.org <krit@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Oct 2011 13:27:31 +0000 (13:27 +0000)
commit48e3c138efa0d5a34394817b31de8fc044d778e3
treee6ec0a112030fcc32e85f8424ff0369fb06a7edc
parent90c770d7526c9d04e4ba023589e0a7428c672782
Make FilterEffect::apply() independent of image data management
https://bugs.webkit.org/show_bug.cgi?id=70350

Reviewed by Zoltan Herczeg.

FilterEffect::apply() needs to be independent from the image data management in FilterEffect.
This allows implementing effective hardware accelerated alternatives, like OpenGL, CI or OpenCL
based filters, to the software rendering. The software rendering code will be used as fallback
and moves to platformApplySoftware().

The patch does not change the behavior of SVG filters. Did not add new test cases.

* platform/graphics/filters/FEBlend.cpp: Renamed apply() to platformApplyGeneric()
    and removed validity checks that are done by FilterEffect::apply(). This is a
    recurring pattern for all following effects.
(WebCore::FEBlend::platformApplySoftware):
* platform/graphics/filters/FEBlend.h:
* platform/graphics/filters/FEColorMatrix.cpp:
(WebCore::FEColorMatrix::platformApplySoftware):
* platform/graphics/filters/FEColorMatrix.h:
* platform/graphics/filters/FEComponentTransfer.cpp:
(WebCore::FEComponentTransfer::platformApplySoftware):
* platform/graphics/filters/FEComponentTransfer.h:
* platform/graphics/filters/FEComposite.cpp:
(WebCore::FEComposite::platformApplySoftware):
* platform/graphics/filters/FEComposite.h:
* platform/graphics/filters/FEConvolveMatrix.cpp:
(WebCore::FEConvolveMatrix::platformApplySoftware):
* platform/graphics/filters/FEConvolveMatrix.h:
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDisplacementMap.h:
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.h:
* platform/graphics/filters/FEFlood.cpp:
(WebCore::FEFlood::platformApplySoftware):
* platform/graphics/filters/FEFlood.h:
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApplySoftware):
* platform/graphics/filters/FELighting.h:
* platform/graphics/filters/FEMerge.cpp:
(WebCore::FEMerge::platformApplySoftware):
* platform/graphics/filters/FEMerge.h:
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FEMorphology.h:
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/FEOffset.h:
* platform/graphics/filters/FETile.cpp:
(WebCore::FETile::platformApplySoftware):
* platform/graphics/filters/FETile.h:
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::platformApplySoftware):
* platform/graphics/filters/FETurbulence.h:
* platform/graphics/filters/FilterEffect.cpp: Added non-virtual apply() function. This will call the platform specific apply functions,
    which need to be virtual now.
(WebCore::FilterEffect::hasResult): Added a comment for new implementations. This function needs to be updated for every new port.
(WebCore::FilterEffect::apply):
(WebCore::FilterEffect::createImageBufferResult): Removed determineAbsolutePaintRect() call. This is done in apply() now.
(WebCore::FilterEffect::createUnmultipliedImageResult): Ditto.
(WebCore::FilterEffect::createPremultipliedImageResult): Ditto.
* platform/graphics/filters/FilterEffect.h:
* platform/graphics/filters/SourceAlpha.cpp:
(WebCore::SourceAlpha::platformApplySoftware):
* platform/graphics/filters/SourceAlpha.h:
* platform/graphics/filters/SourceGraphic.cpp:
(WebCore::SourceGraphic::platformApplySoftware):
* platform/graphics/filters/SourceGraphic.h:
* svg/graphics/filters/SVGFEImage.cpp:
(WebCore::FEImage::platformApplySoftware):
* svg/graphics/filters/SVGFEImage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@97853 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/filters/FEBlend.cpp
Source/WebCore/platform/graphics/filters/FEBlend.h
Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
Source/WebCore/platform/graphics/filters/FEColorMatrix.h
Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
Source/WebCore/platform/graphics/filters/FEComponentTransfer.h
Source/WebCore/platform/graphics/filters/FEComposite.cpp
Source/WebCore/platform/graphics/filters/FEComposite.h
Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h
Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
Source/WebCore/platform/graphics/filters/FEDisplacementMap.h
Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
Source/WebCore/platform/graphics/filters/FEDropShadow.h
Source/WebCore/platform/graphics/filters/FEFlood.cpp
Source/WebCore/platform/graphics/filters/FEFlood.h
Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
Source/WebCore/platform/graphics/filters/FELighting.cpp
Source/WebCore/platform/graphics/filters/FELighting.h
Source/WebCore/platform/graphics/filters/FEMerge.cpp
Source/WebCore/platform/graphics/filters/FEMerge.h
Source/WebCore/platform/graphics/filters/FEMorphology.cpp
Source/WebCore/platform/graphics/filters/FEMorphology.h
Source/WebCore/platform/graphics/filters/FEOffset.cpp
Source/WebCore/platform/graphics/filters/FEOffset.h
Source/WebCore/platform/graphics/filters/FETile.cpp
Source/WebCore/platform/graphics/filters/FETile.h
Source/WebCore/platform/graphics/filters/FETurbulence.cpp
Source/WebCore/platform/graphics/filters/FETurbulence.h
Source/WebCore/platform/graphics/filters/FilterEffect.cpp
Source/WebCore/platform/graphics/filters/FilterEffect.h
Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
Source/WebCore/platform/graphics/filters/SourceAlpha.h
Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
Source/WebCore/platform/graphics/filters/SourceGraphic.h
Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
Source/WebCore/svg/graphics/filters/SVGFEImage.h