Chromium Code Reviews| 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 |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #include "core/svg/SVGFEConvolveMatrixElement.h" | 20 #include "core/svg/SVGFEConvolveMatrixElement.h" |
| 21 | 21 |
| 22 #include "core/SVGNames.h" | 22 #include "core/SVGNames.h" |
| 23 #include "core/dom/Document.h" | 23 #include "core/dom/Document.h" |
| 24 #include "core/svg/SVGDocumentExtensions.h" | |
| 25 #include "core/svg/SVGParserUtilities.h" | |
| 26 #include "core/svg/graphics/filters/SVGFilterBuilder.h" | 24 #include "core/svg/graphics/filters/SVGFilterBuilder.h" |
| 27 #include "platform/geometry/FloatPoint.h" | 25 #include "platform/geometry/FloatPoint.h" |
| 28 #include "platform/geometry/IntPoint.h" | 26 #include "platform/geometry/IntPoint.h" |
| 29 #include "platform/geometry/IntSize.h" | 27 #include "platform/geometry/IntSize.h" |
| 30 #include "platform/graphics/filters/FilterEffect.h" | 28 #include "platform/graphics/filters/FilterEffect.h" |
| 31 | 29 |
| 32 namespace blink { | 30 namespace blink { |
| 33 | 31 |
| 34 template<> const SVGEnumerationStringEntries& getStaticStringEntries<EdgeModeTyp e>() | 32 template<> const SVGEnumerationStringEntries& getStaticStringEntries<EdgeModeTyp e>() |
| 35 { | 33 { |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 54 protected: | 52 protected: |
| 55 SVGAnimatedOrder(SVGElement* contextElement) | 53 SVGAnimatedOrder(SVGElement* contextElement) |
| 56 : SVGAnimatedIntegerOptionalInteger(contextElement, SVGNames::orderAttr, 0, 0) | 54 : SVGAnimatedIntegerOptionalInteger(contextElement, SVGNames::orderAttr, 0, 0) |
| 57 { | 55 { |
| 58 } | 56 } |
| 59 }; | 57 }; |
| 60 | 58 |
| 61 SVGParsingError SVGAnimatedOrder::setBaseValueAsString(const String& value) | 59 SVGParsingError SVGAnimatedOrder::setBaseValueAsString(const String& value) |
| 62 { | 60 { |
| 63 SVGParsingError parseStatus = SVGAnimatedIntegerOptionalInteger::setBaseValu eAsString(value); | 61 SVGParsingError parseStatus = SVGAnimatedIntegerOptionalInteger::setBaseValu eAsString(value); |
| 64 | 62 if (parseStatus == NoError && (firstInteger()->baseValue()->value() < 1 || s econdInteger()->baseValue()->value() < 1)) |
|
pdr.
2016/01/07 19:27:37
Pedantic but it looks like a value of zero incorre
fs
2016/01/07 20:03:50
Hmm, this was just me being more blind than usual.
| |
| 65 ASSERT(contextElement()); | 63 parseStatus = NegativeValueForbiddenError; |
| 66 if (parseStatus == NoError && (firstInteger()->baseValue()->value() < 1 || s econdInteger()->baseValue()->value() < 1)) { | |
| 67 contextElement()->document().accessSVGExtensions().reportWarning( | |
| 68 "feConvolveMatrix: problem parsing order=\"" + value + "\"."); | |
| 69 } | |
| 70 return parseStatus; | 64 return parseStatus; |
| 71 } | 65 } |
| 72 | 66 |
| 73 inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(Document& document ) | 67 inline SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement(Document& document ) |
| 74 : SVGFilterPrimitiveStandardAttributes(SVGNames::feConvolveMatrixTag, docume nt) | 68 : SVGFilterPrimitiveStandardAttributes(SVGNames::feConvolveMatrixTag, docume nt) |
| 75 , m_bias(SVGAnimatedNumber::create(this, SVGNames::biasAttr, SVGNumber::crea te())) | 69 , m_bias(SVGAnimatedNumber::create(this, SVGNames::biasAttr, SVGNumber::crea te())) |
| 76 , m_divisor(SVGAnimatedNumber::create(this, SVGNames::divisorAttr, SVGNumber ::create())) | 70 , m_divisor(SVGAnimatedNumber::create(this, SVGNames::divisorAttr, SVGNumber ::create())) |
| 77 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( ))) | 71 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create( ))) |
| 78 , m_edgeMode(SVGAnimatedEnumeration<EdgeModeType>::create(this, SVGNames::ed geModeAttr, EDGEMODE_DUPLICATE)) | 72 , m_edgeMode(SVGAnimatedEnumeration<EdgeModeType>::create(this, SVGNames::ed geModeAttr, EDGEMODE_DUPLICATE)) |
| 79 , m_kernelMatrix(SVGAnimatedNumberList::create(this, SVGNames::kernelMatrixA ttr, SVGNumberList::create())) | 73 , m_kernelMatrix(SVGAnimatedNumberList::create(this, SVGNames::kernelMatrixA ttr, SVGNumberList::create())) |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 190 | 184 |
| 191 RefPtrWillBeRawPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, | 185 RefPtrWillBeRawPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, |
| 192 IntSize(orderXValue, orderYValue), divisorValue, | 186 IntSize(orderXValue, orderYValue), divisorValue, |
| 193 m_bias->currentValue()->value(), IntPoint(targetXValue, targetYValue), m _edgeMode->currentValue()->enumValue(), | 187 m_bias->currentValue()->value(), IntPoint(targetXValue, targetYValue), m _edgeMode->currentValue()->enumValue(), |
| 194 m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue() ->toFloatVector()); | 188 m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue() ->toFloatVector()); |
| 195 effect->inputEffects().append(input1); | 189 effect->inputEffects().append(input1); |
| 196 return effect.release(); | 190 return effect.release(); |
| 197 } | 191 } |
| 198 | 192 |
| 199 } // namespace blink | 193 } // namespace blink |
| OLD | NEW |