| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 return; | 187 return; |
| 188 } | 188 } |
| 189 | 189 |
| 190 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); | 190 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); |
| 191 } | 191 } |
| 192 | 192 |
| 193 FilterEffect* SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, | 193 FilterEffect* SVGFEConvolveMatrixElement::build(SVGFilterBuilder* filterBuilder, |
| 194 Filter* filter) { | 194 Filter* filter) { |
| 195 FilterEffect* input1 = filterBuilder->getEffectById( | 195 FilterEffect* input1 = filterBuilder->getEffectById( |
| 196 AtomicString(m_in1->currentValue()->value())); | 196 AtomicString(m_in1->currentValue()->value())); |
| 197 ASSERT(input1); | 197 DCHECK(input1); |
| 198 | 198 |
| 199 float divisorValue = m_divisor->currentValue()->value(); | 199 float divisorValue = m_divisor->currentValue()->value(); |
| 200 if (!m_divisor->isSpecified()) { | 200 if (!m_divisor->isSpecified()) { |
| 201 SVGNumberList* kernelMatrix = m_kernelMatrix->currentValue(); | 201 SVGNumberList* kernelMatrix = m_kernelMatrix->currentValue(); |
| 202 size_t kernelMatrixSize = kernelMatrix->length(); | 202 size_t kernelMatrixSize = kernelMatrix->length(); |
| 203 for (size_t i = 0; i < kernelMatrixSize; ++i) | 203 for (size_t i = 0; i < kernelMatrixSize; ++i) |
| 204 divisorValue += kernelMatrix->at(i)->value(); | 204 divisorValue += kernelMatrix->at(i)->value(); |
| 205 if (!divisorValue) | 205 if (!divisorValue) |
| 206 divisorValue = 1; | 206 divisorValue = 1; |
| 207 } | 207 } |
| 208 | 208 |
| 209 FilterEffect* effect = FEConvolveMatrix::create( | 209 FilterEffect* effect = FEConvolveMatrix::create( |
| 210 filter, matrixOrder(), divisorValue, m_bias->currentValue()->value(), | 210 filter, matrixOrder(), divisorValue, m_bias->currentValue()->value(), |
| 211 targetPoint(), m_edgeMode->currentValue()->enumValue(), | 211 targetPoint(), m_edgeMode->currentValue()->enumValue(), |
| 212 m_preserveAlpha->currentValue()->value(), | 212 m_preserveAlpha->currentValue()->value(), |
| 213 m_kernelMatrix->currentValue()->toFloatVector()); | 213 m_kernelMatrix->currentValue()->toFloatVector()); |
| 214 effect->inputEffects().push_back(input1); | 214 effect->inputEffects().push_back(input1); |
| 215 return effect; | 215 return effect; |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace blink | 218 } // namespace blink |
| OLD | NEW |