Applying a filter on an SVG element, which is larger than 4096 pixels, causes this...
authorsaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 23:32:45 +0000 (23:32 +0000)
committersaid@apple.com <said@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 May 2015 23:32:45 +0000 (23:32 +0000)
commite75df6f97d84bcf9b7e7fac5d0bafdd4e8ae0701
treec436d2d2ead340a0863bb8f7ccee0567e1eabd9b
parent31ba74f27724e1afc88b32b9dc2a01ef09ca41ba
Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
https://bugs.webkit.org/show_bug.cgi?id=144335

Reviewed by Daniel Bates.

Address comments raised by Darin Adler in review.

* platform/graphics/ImageBuffer.cpp:
(WebCore::ImageBuffer::sizeNeedsClamping):
(WebCore::ImageBuffer::clampedSize):
(WebCore::ImageBuffer::isSizeClamped): Deleted.
* platform/graphics/ImageBuffer.h:
The condition for the negative width/height in isSizeClamped() was wrong. Use
FloatSize::isEmpty() instead and rename the function to sizeNeedsClamping().
The new function should return the opposite of the old function return value.

* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::apply):
(WebCore::FilterEffect::asUnmultipliedImage):
(WebCore::FilterEffect::asPremultipliedImage):
(WebCore::FilterEffect::copyUnmultipliedImage):
(WebCore::FilterEffect::copyPremultipliedImage):
(WebCore::FilterEffect::createUnmultipliedImageResult):
(WebCore::FilterEffect::createPremultipliedImageResult):
* rendering/FilterEffectRenderer.cpp:
(WebCore::FilterEffectRenderer::updateBackingStoreRect):
(WebCore::FilterEffectRendererHelper::beginFilterEffect):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::applyResource):
Call the new function and negate the condition for the return value.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183960 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ImageBuffer.cpp
Source/WebCore/platform/graphics/ImageBuffer.h
Source/WebCore/platform/graphics/filters/FilterEffect.cpp
Source/WebCore/rendering/FilterEffectRenderer.cpp
Source/WebCore/rendering/svg/RenderSVGResourceFilter.cpp