Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(326)

Side by Side Diff: Source/core/svg/SVGFEConvolveMatrixElement.cpp

Issue 195313003: [SVG2] Add getters and setters to SVG*List interfaces. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: s/slength/size Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/svg/SVGFEColorMatrixElement.cpp ('k') | Source/core/svg/SVGLengthList.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFEColorMatrixElement.cpp ('k') | Source/core/svg/SVGLengthList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698