⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 101638 in webkit


Ignore:
Timestamp:
Dec 1, 2011, 1:02:53 AM (15 years ago)
Author:
commit-queue@webkit.org
Message:

SVG Gaussian blur in 1-dimension is incorrect
https://bugs.webkit.org/show_bug.cgi?id=73029

Patch by Florin Malita <fmalita@google.com> on 2011-12-01
Reviewed by Simon Fraser.

Source/WebCore:

Ensure that the last blurBox result is stored when applying one-dimensional blurs.

  • platform/graphics/filters/FEGaussianBlur.cpp:

(WebCore::FEGaussianBlur::platformApplyGeneric):

LayoutTests:

  • platform/chromium-win/svg/filters/feGaussianBlur-expected.png: Rebaseline.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r101636 r101638  
     12011-12-01  Florin Malita  <fmalita@google.com>
     2
     3        SVG Gaussian blur in 1-dimension is incorrect
     4        https://bugs.webkit.org/show_bug.cgi?id=73029
     5
     6        Reviewed by Simon Fraser.
     7
     8        * platform/chromium-win/svg/filters/feGaussianBlur-expected.png: Rebaseline.
     9
    1102011-12-01  Hayato Ito  <hayato@chromium.org>
    211
  • trunk/Source/WebCore/ChangeLog

    r101637 r101638  
     12011-12-01  Florin Malita  <fmalita@google.com>
     2
     3        SVG Gaussian blur in 1-dimension is incorrect
     4        https://bugs.webkit.org/show_bug.cgi?id=73029
     5
     6        Reviewed by Simon Fraser.
     7
     8        Ensure that the last blurBox result is stored when applying one-dimensional blurs.
     9
     10        * platform/graphics/filters/FEGaussianBlur.cpp:
     11        (WebCore::FEGaussianBlur::platformApplyGeneric):
     12
    1132011-12-01  Vsevolod Vlasov  <vsevik@chromium.org>
    214
  • trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp

    r100989 r101638  
    3838#include <wtf/ParallelJobs.h>
    3939
    40 using std::max;
     40using namespace std;
    4141
    4242static inline float gaussianKernelFactor()
     
    8989            int sum = 0;
    9090            // Fill the kernel
    91             int maxKernelSize = std::min(dxRight, effectWidth);
     91            int maxKernelSize = min(dxRight, effectWidth);
    9292            for (int i = 0; i < maxKernelSize; ++i)
    9393                sum += srcPixelArray->get(line + i * stride + channel);
     
    115115    int dyLeft = 0;
    116116    int dyRight = 0;
     117    ByteArray* src = srcPixelArray;
     118    ByteArray* dst = tmpPixelArray;
     119
    117120    for (int i = 0; i < 3; ++i) {
    118121        if (kernelSizeX) {
    119122            kernelPosition(i, kernelSizeX, dxLeft, dxRight);
    120             boxBlur(srcPixelArray, tmpPixelArray, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height(), isAlphaImage());
    121         } else {
    122             ByteArray* auxPixelArray = tmpPixelArray;
    123             tmpPixelArray = srcPixelArray;
    124             srcPixelArray = auxPixelArray;
     123            boxBlur(src, dst, kernelSizeX, dxLeft, dxRight, 4, stride, paintSize.width(), paintSize.height(), isAlphaImage());
     124            swap(src, dst);
    125125        }
    126126
    127127        if (kernelSizeY) {
    128128            kernelPosition(i, kernelSizeY, dyLeft, dyRight);
    129             boxBlur(tmpPixelArray, srcPixelArray, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width(), isAlphaImage());
    130         } else {
    131             ByteArray* auxPixelArray = tmpPixelArray;
    132             tmpPixelArray = srcPixelArray;
    133             srcPixelArray = auxPixelArray;
     129            boxBlur(src, dst, kernelSizeY, dyLeft, dyRight, stride, 4, paintSize.height(), paintSize.width(), isAlphaImage());
     130            swap(src, dst);
    134131        }
    135132    }
     133
     134    // The final result should be stored in srcPixelArray.
     135    if (dst == srcPixelArray) {
     136        ASSERT(src->length() == dst->length());
     137        memcpy(dst->data(), src->data(), src->length());
     138    }
     139
    136140}
    137141
Note: See TracChangeset for help on using the changeset viewer.