OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
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 11 matching lines...) Expand all Loading... |
22 #include "core/svg/SVGFEDropShadowElement.h" | 22 #include "core/svg/SVGFEDropShadowElement.h" |
23 | 23 |
24 #include "SVGNames.h" | 24 #include "SVGNames.h" |
25 #include "core/rendering/style/RenderStyle.h" | 25 #include "core/rendering/style/RenderStyle.h" |
26 #include "core/rendering/style/SVGRenderStyle.h" | 26 #include "core/rendering/style/SVGRenderStyle.h" |
27 #include "core/svg/SVGParserUtilities.h" | 27 #include "core/svg/SVGParserUtilities.h" |
28 #include "core/svg/graphics/filters/SVGFilterBuilder.h" | 28 #include "core/svg/graphics/filters/SVGFilterBuilder.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 SVGFEDropShadowElement::SVGFEDropShadowElement(Document& document) | 32 inline SVGFEDropShadowElement::SVGFEDropShadowElement(Document& document) |
33 : SVGFilterPrimitiveStandardAttributes(SVGNames::feDropShadowTag, document) | 33 : SVGFilterPrimitiveStandardAttributes(SVGNames::feDropShadowTag, document) |
34 , m_dx(SVGAnimatedNumber::create(this, SVGNames::dxAttr, SVGNumber::create(2
))) | 34 , m_dx(SVGAnimatedNumber::create(this, SVGNames::dxAttr, SVGNumber::create(2
))) |
35 , m_dy(SVGAnimatedNumber::create(this, SVGNames::dyAttr, SVGNumber::create(2
))) | 35 , m_dy(SVGAnimatedNumber::create(this, SVGNames::dyAttr, SVGNumber::create(2
))) |
36 , m_stdDeviation(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::std
DeviationAttr, 2, 2)) | 36 , m_stdDeviation(SVGAnimatedNumberOptionalNumber::create(this, SVGNames::std
DeviationAttr, 2, 2)) |
37 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) | 37 , m_in1(SVGAnimatedString::create(this, SVGNames::inAttr, SVGString::create(
))) |
38 { | 38 { |
39 ScriptWrappable::init(this); | 39 ScriptWrappable::init(this); |
40 | 40 |
41 addToPropertyMap(m_dx); | 41 addToPropertyMap(m_dx); |
42 addToPropertyMap(m_dy); | 42 addToPropertyMap(m_dy); |
43 addToPropertyMap(m_stdDeviation); | 43 addToPropertyMap(m_stdDeviation); |
44 addToPropertyMap(m_in1); | 44 addToPropertyMap(m_in1); |
45 } | 45 } |
46 | 46 |
| 47 DEFINE_NODE_FACTORY(SVGFEDropShadowElement) |
| 48 |
47 void SVGFEDropShadowElement::setStdDeviation(float x, float y) | 49 void SVGFEDropShadowElement::setStdDeviation(float x, float y) |
48 { | 50 { |
49 stdDeviationX()->baseValue()->setValue(x); | 51 stdDeviationX()->baseValue()->setValue(x); |
50 stdDeviationY()->baseValue()->setValue(y); | 52 stdDeviationY()->baseValue()->setValue(y); |
51 invalidate(); | 53 invalidate(); |
52 } | 54 } |
53 | 55 |
54 bool SVGFEDropShadowElement::isSupportedAttribute(const QualifiedName& attrName) | 56 bool SVGFEDropShadowElement::isSupportedAttribute(const QualifiedName& attrName) |
55 { | 57 { |
56 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 58 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 126 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
125 if (!input1) | 127 if (!input1) |
126 return nullptr; | 128 return nullptr; |
127 | 129 |
128 RefPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDeviationX()->
currentValue()->value(), stdDeviationY()->currentValue()->value(), m_dx->current
Value()->value(), m_dy->currentValue()->value(), color, opacity); | 130 RefPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDeviationX()->
currentValue()->value(), stdDeviationY()->currentValue()->value(), m_dx->current
Value()->value(), m_dy->currentValue()->value(), color, opacity); |
129 effect->inputEffects().append(input1); | 131 effect->inputEffects().append(input1); |
130 return effect.release(); | 132 return effect.release(); |
131 } | 133 } |
132 | 134 |
133 } | 135 } |
OLD | NEW |