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

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

Issue 19263002: Get rid of special casing for SVGNumber in the bindings generator (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix style issues Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGFEColorMatrixElement.cpp ('k') | Source/core/svg/SVGNumber.h » ('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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « Source/core/svg/SVGFEColorMatrixElement.cpp ('k') | Source/core/svg/SVGNumber.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698