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 |
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 "config.h" | 20 #include "config.h" |
21 #include "core/svg/SVGFEDropShadowElement.h" | 21 #include "core/svg/SVGFEDropShadowElement.h" |
22 | 22 |
23 #include "core/SVGNames.h" | 23 #include "core/SVGNames.h" |
24 #include "core/layout/LayoutObject.h" | 24 #include "core/layout/LayoutObject.h" |
25 #include "core/layout/style/LayoutStyle.h" | 25 #include "core/layout/style/ComputedStyle.h" |
26 #include "core/layout/style/SVGLayoutStyle.h" | 26 #include "core/layout/style/SVGComputedStyle.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 blink { | 30 namespace blink { |
31 | 31 |
32 inline 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)) |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuil
der* filterBuilder, Filter* filter) | 95 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDropShadowElement::build(SVGFilterBuil
der* filterBuilder, Filter* filter) |
96 { | 96 { |
97 LayoutObject* renderer = this->layoutObject(); | 97 LayoutObject* renderer = this->layoutObject(); |
98 if (!renderer) | 98 if (!renderer) |
99 return nullptr; | 99 return nullptr; |
100 | 100 |
101 if (stdDeviationX()->currentValue()->value() < 0 || stdDeviationY()->current
Value()->value() < 0) | 101 if (stdDeviationX()->currentValue()->value() < 0 || stdDeviationY()->current
Value()->value() < 0) |
102 return nullptr; | 102 return nullptr; |
103 | 103 |
104 ASSERT(renderer->style()); | 104 ASSERT(renderer->style()); |
105 const SVGLayoutStyle& svgStyle = renderer->style()->svgStyle(); | 105 const SVGComputedStyle& svgStyle = renderer->style()->svgStyle(); |
106 | 106 |
107 Color color = svgStyle.floodColor(); | 107 Color color = svgStyle.floodColor(); |
108 float opacity = svgStyle.floodOpacity(); | 108 float opacity = svgStyle.floodOpacity(); |
109 | 109 |
110 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); | 110 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr
entValue()->value())); |
111 if (!input1) | 111 if (!input1) |
112 return nullptr; | 112 return nullptr; |
113 | 113 |
114 RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDe
viationX()->currentValue()->value(), stdDeviationY()->currentValue()->value(), m
_dx->currentValue()->value(), m_dy->currentValue()->value(), color, opacity); | 114 RefPtrWillBeRawPtr<FilterEffect> effect = FEDropShadow::create(filter, stdDe
viationX()->currentValue()->value(), stdDeviationY()->currentValue()->value(), m
_dx->currentValue()->value(), m_dy->currentValue()->value(), color, opacity); |
115 effect->inputEffects().append(input1); | 115 effect->inputEffects().append(input1); |
116 return effect.release(); | 116 return effect.release(); |
117 } | 117 } |
118 | 118 |
119 } // namespace blink | 119 } // namespace blink |
OLD | NEW |