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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 int orderXValue = orderX()->currentValue()->value(); | 196 int orderXValue = orderX()->currentValue()->value(); |
197 int orderYValue = orderY()->currentValue()->value(); | 197 int orderYValue = orderY()->currentValue()->value(); |
198 if (!hasAttribute(SVGNames::orderAttr)) { | 198 if (!hasAttribute(SVGNames::orderAttr)) { |
199 orderXValue = 3; | 199 orderXValue = 3; |
200 orderYValue = 3; | 200 orderYValue = 3; |
201 } | 201 } |
202 // Spec says order must be > 0. Bail if it is not. | 202 // Spec says order must be > 0. Bail if it is not. |
203 if (orderXValue < 1 || orderYValue < 1) | 203 if (orderXValue < 1 || orderYValue < 1) |
204 return nullptr; | 204 return nullptr; |
205 RefPtr<SVGNumberList> kernelMatrix = this->m_kernelMatrix->currentValue(); | 205 RefPtr<SVGNumberList> kernelMatrix = this->m_kernelMatrix->currentValue(); |
206 size_t kernelMatrixSize = kernelMatrix->numberOfItems(); | 206 size_t kernelMatrixSize = kernelMatrix->length(); |
207 // The spec says this is a requirement, and should bail out if fails | 207 // The spec says this is a requirement, and should bail out if fails |
208 if (orderXValue * orderYValue != static_cast<int>(kernelMatrixSize)) | 208 if (orderXValue * orderYValue != static_cast<int>(kernelMatrixSize)) |
209 return nullptr; | 209 return nullptr; |
210 | 210 |
211 int targetXValue = m_targetX->currentValue()->value(); | 211 int targetXValue = m_targetX->currentValue()->value(); |
212 int targetYValue = m_targetY->currentValue()->value(); | 212 int targetYValue = m_targetY->currentValue()->value(); |
213 if (hasAttribute(SVGNames::targetXAttr) && (targetXValue < 0 || targetXValue
>= orderXValue)) | 213 if (hasAttribute(SVGNames::targetXAttr) && (targetXValue < 0 || targetXValue
>= orderXValue)) |
214 return nullptr; | 214 return nullptr; |
215 // The spec says the default value is: targetX = floor ( orderX / 2 )) | 215 // The spec says the default value is: targetX = floor ( orderX / 2 )) |
216 if (!hasAttribute(SVGNames::targetXAttr)) | 216 if (!hasAttribute(SVGNames::targetXAttr)) |
(...skipping 27 matching lines...) Expand all Loading... |
244 | 244 |
245 RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, | 245 RefPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, |
246 IntSize(orderXValue, orderYValue), divisorValue, | 246 IntSize(orderXValue, orderYValue), divisorValue, |
247 m_bias->currentValue()->value(), IntPoint(targetXValue, targ
etYValue), m_edgeMode->currentValue()->enumValue(), | 247 m_bias->currentValue()->value(), IntPoint(targetXValue, targ
etYValue), m_edgeMode->currentValue()->enumValue(), |
248 FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue),
m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue()->toFloa
tVector()); | 248 FloatPoint(kernelUnitLengthXValue, kernelUnitLengthYValue),
m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue()->toFloa
tVector()); |
249 effect->inputEffects().append(input1); | 249 effect->inputEffects().append(input1); |
250 return effect.release(); | 250 return effect.release(); |
251 } | 251 } |
252 | 252 |
253 } // namespace WebCore | 253 } // namespace WebCore |
OLD | NEW |