OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 kernelUnitLengthYValue = 1; | 323 kernelUnitLengthYValue = 1; |
324 } | 324 } |
325 if (kernelUnitLengthXValue <= 0 || kernelUnitLengthYValue <= 0) | 325 if (kernelUnitLengthXValue <= 0 || kernelUnitLengthYValue <= 0) |
326 return 0; | 326 return 0; |
327 | 327 |
328 float divisorValue = divisorCurrentValue(); | 328 float divisorValue = divisorCurrentValue(); |
329 if (hasAttribute(SVGNames::divisorAttr) && !divisorValue) | 329 if (hasAttribute(SVGNames::divisorAttr) && !divisorValue) |
330 return 0; | 330 return 0; |
331 if (!hasAttribute(SVGNames::divisorAttr)) { | 331 if (!hasAttribute(SVGNames::divisorAttr)) { |
332 for (int i = 0; i < kernelMatrixSize; ++i) | 332 for (int i = 0; i < kernelMatrixSize; ++i) |
333 divisorValue += kernelMatrix.at(i); | 333 divisorValue += kernelMatrix.at(i).value(); |
334 if (!divisorValue) | 334 if (!divisorValue) |
335 divisorValue = 1; | 335 divisorValue = 1; |
336 } | 336 } |
337 | 337 |
338 RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, | 338 RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, |
339 IntSize(orderXValue, orderYValue), divisorValue, | 339 IntSize(orderXValue, orderYValue), divisorValue, |
340 biasCurrentValue(), IntPoint(targetXValue, targetYValue), ed
geModeCurrentValue(), | 340 biasCurrentValue(), IntPoint(targetXValue, targetYValue), ed
geModeCurrentValue(), |
341 FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue),
preserveAlphaCurrentValue(), kernelMatrix); | 341 FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue),
preserveAlphaCurrentValue(), kernelMatrix.toFloatVector()); |
342 effect->inputEffects().append(input1); | 342 effect->inputEffects().append(input1); |
343 return effect.release(); | 343 return effect.release(); |
344 } | 344 } |
345 | 345 |
346 } // namespace WebCore | 346 } // namespace WebCore |
OLD | NEW |