Changeset 65138 in webkit


Ignore:
Timestamp:
Aug 11, 2010 1:43:13 AM (14 years ago)
Author:
alex
Message:

2010-08-11 Alejandro G. Castro <alex@igalia.com>

Reviewed by Dirk Schulze.

Fixes to the gaussian blur algorithm
https://bugs.webkit.org/show_bug.cgi?id=41605

Added the recomendations of SVG regarding the kernel size
calculation for the approximation of the gaussian
blur. http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement.
Modified also some variable names to clarify algorithm, reviewed
the situation where both standard deviations are 0.

  • platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::FEGaussianBlur): (WebCore::FEGaussianBlur::stdDeviationX): (WebCore::FEGaussianBlur::setStdDeviationX): (WebCore::FEGaussianBlur::stdDeviationY): (WebCore::FEGaussianBlur::setStdDeviationY): (WebCore::boxBlur): (WebCore::FEGaussianBlur::kernelPosition): Added the SVG kernel position recomendation. (WebCore::FEGaussianBlur::apply): (WebCore::FEGaussianBlur::externalRepresentation):
  • platform/graphics/filters/FEGaussianBlur.h:

2010-08-11 Alejandro G. Castro <alex@igalia.com>

Reviewed by Dirk Schulze.

Fixes to the gaussian blur algorithm
https://bugs.webkit.org/show_bug.cgi?id=41605

Unskipped test and generated results.

  • platform/gtk/Skipped:
  • platform/gtk/svg/filters/feGaussianBlur-expected.txt: Added.

Updated pixel tests.

  • platform/mac-leopard/svg/W3C-SVG-1.1/filters-gauss-01-b-expected.checksum:
  • platform/mac-leopard/svg/W3C-SVG-1.1/filters-gauss-01-b-expected.png:
  • platform/mac-leopard/svg/batik/text/textProperties-expected.checksum:
  • platform/mac-leopard/svg/batik/text/textProperties-expected.png:
  • platform/mac-leopard/svg/custom/mask-colorspace-expected.png:
  • platform/mac-leopard/svg/filters/feGaussianBlur-expected.checksum:
  • platform/mac-leopard/svg/filters/feGaussianBlur-expected.png:
  • platform/mac-leopard/svg/filters/shadow-on-filter-expected.checksum:
  • platform/mac-leopard/svg/filters/shadow-on-filter-expected.png:
  • platform/mac-leopard/svg/filters/shadow-on-rect-with-filter-expected.checksum:
  • platform/mac-leopard/svg/filters/shadow-on-rect-with-filter-expected.png:
  • platform/mac/svg/W3C-SVG-1.1/filters-example-01-b-expected.checksum:
  • platform/mac/svg/W3C-SVG-1.1/filters-example-01-b-expected.png:
  • platform/mac/svg/batik/text/textEffect-expected.checksum:
  • platform/mac/svg/batik/text/textEffect-expected.png:
  • platform/mac/svg/batik/text/textEffect3-expected.checksum:
  • platform/mac/svg/batik/text/textEffect3-expected.png:
  • platform/mac/svg/batik/text/textFeatures-expected.checksum:
  • platform/mac/svg/batik/text/textFeatures-expected.png:
  • platform/mac/svg/custom/non-opaque-filters-expected.checksum:
  • platform/mac/svg/custom/non-opaque-filters-expected.png:
  • platform/mac/svg/custom/recursive-filter-expected.checksum:
  • platform/mac/svg/custom/recursive-filter-expected.png:
  • platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum:
  • platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png:
  • platform/mac/svg/custom/text-filter-expected.checksum:
  • platform/mac/svg/custom/text-filter-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-diffuseConstant-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-diffuseConstant-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-in-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-in-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-lighting-color-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-lighting-color-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-surfaceScale-attr-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-surfaceScale-attr-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-lighting-color-css-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-lighting-color-css-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-diffuseConstant-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-diffuseConstant-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-in-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-in-prop-expected.png:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-surfaceScale-prop-expected.checksum:
  • platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-surfaceScale-prop-expected.png:
  • platform/mac/svg/filters/filter-on-filter-for-text-expected.checksum:
  • platform/mac/svg/filters/filter-on-filter-for-text-expected.png:
Location:
trunk
Files:
50 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r65135 r65138  
     12010-08-11  Alejandro G. Castro  <alex@igalia.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Fixes to the gaussian blur algorithm
     6        https://bugs.webkit.org/show_bug.cgi?id=41605
     7
     8        Unskipped test and generated results.
     9
     10        * platform/gtk/Skipped:
     11        * platform/gtk/svg/filters/feGaussianBlur-expected.txt: Added.
     12
     13        Updated pixel tests.
     14
     15        * platform/mac-leopard/svg/W3C-SVG-1.1/filters-gauss-01-b-expected.checksum:
     16        * platform/mac-leopard/svg/W3C-SVG-1.1/filters-gauss-01-b-expected.png:
     17        * platform/mac-leopard/svg/batik/text/textProperties-expected.checksum:
     18        * platform/mac-leopard/svg/batik/text/textProperties-expected.png:
     19        * platform/mac-leopard/svg/custom/mask-colorspace-expected.png:
     20        * platform/mac-leopard/svg/filters/feGaussianBlur-expected.checksum:
     21        * platform/mac-leopard/svg/filters/feGaussianBlur-expected.png:
     22        * platform/mac-leopard/svg/filters/shadow-on-filter-expected.checksum:
     23        * platform/mac-leopard/svg/filters/shadow-on-filter-expected.png:
     24        * platform/mac-leopard/svg/filters/shadow-on-rect-with-filter-expected.checksum:
     25        * platform/mac-leopard/svg/filters/shadow-on-rect-with-filter-expected.png:
     26        * platform/mac/svg/W3C-SVG-1.1/filters-example-01-b-expected.checksum:
     27        * platform/mac/svg/W3C-SVG-1.1/filters-example-01-b-expected.png:
     28        * platform/mac/svg/batik/text/textEffect-expected.checksum:
     29        * platform/mac/svg/batik/text/textEffect-expected.png:
     30        * platform/mac/svg/batik/text/textEffect3-expected.checksum:
     31        * platform/mac/svg/batik/text/textEffect3-expected.png:
     32        * platform/mac/svg/batik/text/textFeatures-expected.checksum:
     33        * platform/mac/svg/batik/text/textFeatures-expected.png:
     34        * platform/mac/svg/custom/non-opaque-filters-expected.checksum:
     35        * platform/mac/svg/custom/non-opaque-filters-expected.png:
     36        * platform/mac/svg/custom/recursive-filter-expected.checksum:
     37        * platform/mac/svg/custom/recursive-filter-expected.png:
     38        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum:
     39        * platform/mac/svg/custom/resource-invalidate-on-target-update-expected.png:
     40        * platform/mac/svg/custom/text-filter-expected.checksum:
     41        * platform/mac/svg/custom/text-filter-expected.png:
     42        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-diffuseConstant-attr-expected.checksum:
     43        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-diffuseConstant-attr-expected.png:
     44        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-in-attr-expected.checksum:
     45        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-in-attr-expected.png:
     46        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-lighting-color-attr-expected.checksum:
     47        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-lighting-color-attr-expected.png:
     48        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-surfaceScale-attr-expected.checksum:
     49        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-surfaceScale-attr-expected.png:
     50        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-lighting-color-css-prop-expected.checksum:
     51        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-lighting-color-css-prop-expected.png:
     52        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-diffuseConstant-prop-expected.checksum:
     53        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-diffuseConstant-prop-expected.png:
     54        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-in-prop-expected.checksum:
     55        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-in-prop-expected.png:
     56        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-surfaceScale-prop-expected.checksum:
     57        * platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-surfaceScale-prop-expected.png:
     58        * platform/mac/svg/filters/filter-on-filter-for-text-expected.checksum:
     59        * platform/mac/svg/filters/filter-on-filter-for-text-expected.png:
     60
    1612010-08-11  Fumitoshi Ukai  <ukai@chromium.org>
    262
  • trunk/LayoutTests/platform/gtk/Skipped

    r65113 r65138  
    51465146svg/custom/outer-svg-unknown-feature.svg
    51475147svg/filters/feComposite.svg
    5148 svg/filters/feGaussianBlur.svg
    51495148svg/filters/feMerge.svg
    51505149svg/filters/feMerge-wrong-input.svg
  • trunk/LayoutTests/platform/mac-leopard/svg/W3C-SVG-1.1/filters-gauss-01-b-expected.checksum

    r59987 r65138  
    1 34f79ef1fbb73a01e8aec8bb2e8455eb
     1dc3c93fea9c9f7c07f2e4bcd1aefe2b0
  • trunk/LayoutTests/platform/mac-leopard/svg/batik/text/textProperties-expected.checksum

    r61393 r65138  
    1 7ac90845492b90c794aca5a6d005acd8
     1a3d8bc0cc8481bd140592dcb3fcaf420
  • trunk/LayoutTests/platform/mac-leopard/svg/filters/feGaussianBlur-expected.checksum

    r59987 r65138  
    1 f3318b6d1298eda9ee6363189136f00b
     17cb949d5ea30e101ea1d193398d7dfbf
  • trunk/LayoutTests/platform/mac-leopard/svg/filters/shadow-on-filter-expected.checksum

    r59987 r65138  
    1 0dd0bccfd1290c9d1361ee69593a4d6e
     18e475e1e09357e8d50c695e6ca734b93
  • trunk/LayoutTests/platform/mac-leopard/svg/filters/shadow-on-rect-with-filter-expected.checksum

    r53576 r65138  
    1 c2f1aa1ba34ce5d2a4217daa9002179e
     119b5d78801f2d08d4249c8d238aded55
  • trunk/LayoutTests/platform/mac/svg/W3C-SVG-1.1/filters-example-01-b-expected.checksum

    r52647 r65138  
    1 c0ccdff2628158da021f32ba7af1e47c
     1f7717b50eeca605243da2930e64940ac
  • trunk/LayoutTests/platform/mac/svg/batik/text/textEffect-expected.checksum

    r61393 r65138  
    1 7651f6c33dceb07248402e7fb11c57f1
     10e76f04b2984b3e4bfaa1779eedf7af6
  • trunk/LayoutTests/platform/mac/svg/batik/text/textEffect3-expected.checksum

    r63721 r65138  
    1 d7f76e45d195413b296ca2deb3910c77
     111ee970a315adb062f1c0c3960253ff5
  • trunk/LayoutTests/platform/mac/svg/batik/text/textFeatures-expected.checksum

    r61393 r65138  
    1 c769d5472cf882e729c24a6bfde679df
     16b2078e5c0d3486665431e4b40cb7b4c
  • trunk/LayoutTests/platform/mac/svg/custom/non-opaque-filters-expected.checksum

    r51800 r65138  
    1 41be27d1eb69c595bf1008c91e33986e
     1233fea7c5e41ee0ca468848c6eb3da7d
  • trunk/LayoutTests/platform/mac/svg/custom/recursive-filter-expected.checksum

    r64275 r65138  
    1 0e4859e3b02f2f48bba2c68cad4e0e7b
     1bf1540c2d63cfbe404253f1cead165f7
  • trunk/LayoutTests/platform/mac/svg/custom/resource-invalidate-on-target-update-expected.checksum

    r52709 r65138  
    1 def3237c2a760761dec917e57f640cf2
     181be80c359177d1c77f3118e94802bee
  • trunk/LayoutTests/platform/mac/svg/custom/text-filter-expected.checksum

    r51800 r65138  
    1 30be532effae934d62209ee6e73a4476
     154c828205d2241acc305c3b40534794b
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-diffuseConstant-attr-expected.checksum

    r64191 r65138  
    1 17f613f518fa96eaf04b5665376f21c6
     1133d41ed5215bc4e93601ec45682bec0
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-in-attr-expected.checksum

    r64191 r65138  
    1 cb0a1ce11b98bb8f20caee21cc827537
     1fd5cc3a0a27955bf90c5558140012a9a
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-lighting-color-attr-expected.checksum

    r64191 r65138  
    1 0a7d21c1b0e8f4cfaf45b63f545a9f66
     19959235d96473029f2d29d73b9cc7112
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-dom-surfaceScale-attr-expected.checksum

    r64191 r65138  
    1 867d80dd6ba1e356566c66bad2bdc739
     1d7f015d11a52c6b3a881be30f65ddd20
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-lighting-color-css-prop-expected.checksum

    r64191 r65138  
    1 3ebe46f74da6ce45855377513b293ba7
     1d53a2e4153d3748984be458e53e813f2
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-diffuseConstant-prop-expected.checksum

    r64191 r65138  
    1 a25087cfe3b4741de25f13c273bbd06e
     1256adccb5136d5345d480eb3ee067579
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-in-prop-expected.checksum

    r64191 r65138  
    1 2061b100f62c1e13f737bfacf3b9a6d6
     1c43a3e81d71c9fb60a1ae1c7525a5f71
  • trunk/LayoutTests/platform/mac/svg/dynamic-updates/SVGFEDiffuseLightingElement-svgdom-surfaceScale-prop-expected.checksum

    r64191 r65138  
    1 4ba162b04759b146548003b5c1a17477
     18a344e71484fcdd6b1cbd3bc4da22aa6
  • trunk/LayoutTests/platform/mac/svg/filters/filter-on-filter-for-text-expected.checksum

    r60689 r65138  
    1 43ef38740a8ab2373ed5ee0df84f2699
     1b850bc401490e135c73688e0c90e760d
  • trunk/WebCore/ChangeLog

    r65137 r65138  
     12010-08-11  Alejandro G. Castro  <alex@igalia.com>
     2
     3        Reviewed by Dirk Schulze.
     4
     5        Fixes to the gaussian blur algorithm
     6        https://bugs.webkit.org/show_bug.cgi?id=41605
     7
     8        Added the recomendations of SVG regarding the kernel size
     9        calculation for the approximation of the gaussian
     10        blur. http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement.
     11        Modified also some variable names to clarify algorithm, reviewed
     12        the situation where both standard deviations are 0.
     13
     14        * platform/graphics/filters/FEGaussianBlur.cpp:
     15        (WebCore::FEGaussianBlur::FEGaussianBlur):
     16        (WebCore::FEGaussianBlur::stdDeviationX):
     17        (WebCore::FEGaussianBlur::setStdDeviationX):
     18        (WebCore::FEGaussianBlur::stdDeviationY):
     19        (WebCore::FEGaussianBlur::setStdDeviationY):
     20        (WebCore::boxBlur):
     21        (WebCore::FEGaussianBlur::kernelPosition): Added the SVG kernel
     22        position recomendation.
     23        (WebCore::FEGaussianBlur::apply):
     24        (WebCore::FEGaussianBlur::externalRepresentation):
     25        * platform/graphics/filters/FEGaussianBlur.h:
     26
    1272010-08-11  Kristian Monsen  <kristianm@google.com>
    228
  • trunk/WebCore/platform/graphics/filters/FEGaussianBlur.cpp

    r59069 r65138  
    44                  2005 Eric Seidel <eric@webkit.org>
    55                  2009 Dirk Schulze <krit@webkit.org>
     6                  2010 Igalia, S.L.
    67
    78    This library is free software; you can redistribute it and/or
     
    3031#include "GraphicsContext.h"
    3132#include "ImageData.h"
    32 #include <math.h>
    3333#include <wtf/MathExtras.h>
    3434
    3535using std::max;
     36
     37static const float gGaussianKernelFactor = (3 * sqrtf(2 * piFloat) / 4.f);
    3638
    3739namespace WebCore {
     
    4042    : FilterEffect()
    4143    , m_in(in)
    42     , m_x(x)
    43     , m_y(y)
     44    , m_stdX(x)
     45    , m_stdY(y)
    4446{
    4547}
     
    5254float FEGaussianBlur::stdDeviationX() const
    5355{
    54     return m_x;
     56    return m_stdX;
    5557}
    5658
    5759void FEGaussianBlur::setStdDeviationX(float x)
    5860{
    59     m_x = x;
     61    m_stdX = x;
    6062}
    6163
    6264float FEGaussianBlur::stdDeviationY() const
    6365{
    64     return m_y;
     66    return m_stdY;
    6567}
    6668
    6769void FEGaussianBlur::setStdDeviationY(float y)
    6870{
    69     m_y = y;
     71    m_stdY = y;
    7072}
    7173
    7274static void boxBlur(CanvasPixelArray*& srcPixelArray, CanvasPixelArray*& dstPixelArray,
    73                  unsigned dx, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
    74 {
    75     int dxLeft = dx / 2;
    76     int dxRight = dx - dxLeft;
    77 
     75                    unsigned dx, int dxLeft, int dxRight, int stride, int strideLine, int effectWidth, int effectHeight, bool alphaImage)
     76{
    7877    for (int y = 0; y < effectHeight; ++y) {
    7978        int line = y * strideLine;
     
    10099}
    101100
     101void FEGaussianBlur::kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight)
     102{
     103    // check http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement for details
     104    switch (boxBlur) {
     105    case 0:
     106        if (!(std % 2)) {
     107            dLeft = std / 2 - 1;
     108            dRight = std - dLeft;
     109        } else {
     110            dLeft = std / 2;
     111            dRight = std - dLeft;
     112        }
     113        break;
     114    case 1:
     115        if (!(std % 2)) {
     116            dLeft++;
     117            dRight--;
     118        }
     119        break;
     120    case 2:
     121        if (!(std % 2)) {
     122            dRight++;
     123            std++;
     124        }
     125        break;
     126    }
     127}
     128
    102129void FEGaussianBlur::apply(Filter* filter)
    103130{
     
    111138    setIsAlphaImage(m_in->isAlphaImage());
    112139
    113     if (m_x == 0 || m_y == 0)
    114         return;
    115 
    116     unsigned sdx = static_cast<unsigned>(floor(m_x * filter->filterResolution().width() * 3 * sqrt(2 * piDouble) / 4.f + 0.5f));
    117     unsigned sdy = static_cast<unsigned>(floor(m_y * filter->filterResolution().height() * 3 * sqrt(2 * piDouble) / 4.f + 0.5f));
    118     sdx = max(sdx, static_cast<unsigned>(1));
    119     sdy = max(sdy, static_cast<unsigned>(1));
    120 
    121140    IntRect effectDrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion());
    122141    RefPtr<ImageData> srcImageData(m_in->resultImage()->getPremultipliedImageData(effectDrawingRect));
     142    IntRect imageRect(IntPoint(), resultImage()->size());
     143
     144    if (!m_stdX && !m_stdY) {
     145        resultImage()->putPremultipliedImageData(srcImageData.get(), imageRect, IntPoint());
     146        return;
     147    }
     148
     149    unsigned kernelSizeX = 0;
     150    if (m_stdX)
     151        kernelSizeX = max(2U, static_cast<unsigned>(floor(m_stdX * filter->filterResolution().width() * gGaussianKernelFactor + 0.5f)));
     152
     153    unsigned kernelSizeY = 0;
     154    if (m_stdY)
     155        kernelSizeY = max(2U, static_cast<unsigned>(floor(m_stdY * filter->filterResolution().height() * gGaussianKernelFactor + 0.5f)));
     156
    123157    CanvasPixelArray* srcPixelArray(srcImageData->data());
    124 
    125     IntRect imageRect(IntPoint(), resultImage()->size());
    126158    RefPtr<ImageData> tmpImageData = ImageData::create(imageRect.width(), imageRect.height());
    127159    CanvasPixelArray* tmpPixelArray(tmpImageData->data());
    128160
    129161    int stride = 4 * imageRect.width();
     162    int dxLeft, dxRight, dyLeft, dyRight;
    130163    for (int i = 0; i < 3; ++i) {
    131         boxBlur(srcPixelArray, tmpPixelArray, sdx, 4, stride, imageRect.width(), imageRect.height(), isAlphaImage());
    132         boxBlur(tmpPixelArray, srcPixelArray, sdy, stride, 4, imageRect.height(), imageRect.width(), isAlphaImage());
     164        if (kernelSizeX) {
     165            kernelPosition(i, kernelSizeX, dxLeft, dxRight);
     166            boxBlur(srcPixelArray, tmpPixelArray, kernelSizeX, dxLeft, dxRight, 4, stride, imageRect.width(), imageRect.height(), isAlphaImage());
     167        } else {
     168            CanvasPixelArray* auxPixelArray = tmpPixelArray;
     169            tmpPixelArray = srcPixelArray;
     170            srcPixelArray = auxPixelArray;
     171        }
     172
     173        if (kernelSizeY) {
     174            kernelPosition(i, kernelSizeY, dyLeft, dyRight);
     175            boxBlur(tmpPixelArray, srcPixelArray, kernelSizeY, dyLeft, dyRight, stride, 4, imageRect.height(), imageRect.width(), isAlphaImage());
     176        } else {
     177            CanvasPixelArray* auxPixelArray = tmpPixelArray;
     178            tmpPixelArray = srcPixelArray;
     179            srcPixelArray = auxPixelArray;
     180        }
    133181    }
    134182
     
    145193    ts << "[feGaussianBlur";
    146194    FilterEffect::externalRepresentation(ts);
    147     ts << " stdDeviation=\"" << m_x << ", " << m_y << "\"]\n";
     195    ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n";
    148196    m_in->externalRepresentation(ts, indent + 1);
    149197    return ts;
  • trunk/WebCore/platform/graphics/filters/FEGaussianBlur.h

    r59069 r65138  
    4646private:
    4747    FEGaussianBlur(FilterEffect*, const float&, const float&);
     48    static void kernelPosition(int boxBlur, unsigned& std, int& dLeft, int& dRight);
    4849
    4950    RefPtr<FilterEffect> m_in;
    50     float m_x;
    51     float m_y;
     51    float m_stdX;
     52    float m_stdY;
    5253};
    5354
Note: See TracChangeset for help on using the changeset viewer.