OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 4 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #include "config.h" | 22 #include "config.h" |
23 | |
24 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h" | 23 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h" |
25 | 24 |
26 #include "core/SVGNames.h" | 25 #include "core/SVGNames.h" |
27 #include "platform/graphics/filters/FilterEffect.h" | 26 #include "core/rendering/svg/RenderSVGResourceContainer.h" |
28 #include "core/rendering/svg/RenderSVGResourceFilterPrimitive.h" | 27 #include "core/rendering/svg/RenderSVGResourceFilterPrimitive.h" |
29 #include "core/svg/SVGLength.h" | 28 #include "core/svg/SVGLength.h" |
| 29 #include "platform/graphics/filters/FilterEffect.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const
QualifiedName& tagName, Document& document) | 33 SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const
QualifiedName& tagName, Document& document) |
34 : SVGElement(tagName, document) | 34 : SVGElement(tagName, document) |
35 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) | 35 , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(Len
gthModeWidth), AllowNegativeLengths)) |
36 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) | 36 , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(Len
gthModeHeight), AllowNegativeLengths)) |
37 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) | 37 , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::cr
eate(LengthModeWidth), ForbidNegativeLengths)) |
38 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) | 38 , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::
create(LengthModeHeight), ForbidNegativeLengths)) |
39 , m_result(SVGAnimatedString::create(this, SVGNames::resultAttr, SVGString::
create())) | 39 , m_result(SVGAnimatedString::create(this, SVGNames::resultAttr, SVGString::
create())) |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 | 120 |
121 bool SVGFilterPrimitiveStandardAttributes::rendererIsNeeded(const RenderStyle& s
tyle) | 121 bool SVGFilterPrimitiveStandardAttributes::rendererIsNeeded(const RenderStyle& s
tyle) |
122 { | 122 { |
123 if (isSVGFilterElement(parentNode())) | 123 if (isSVGFilterElement(parentNode())) |
124 return SVGElement::rendererIsNeeded(style); | 124 return SVGElement::rendererIsNeeded(style); |
125 | 125 |
126 return false; | 126 return false; |
127 } | 127 } |
128 | 128 |
| 129 void SVGFilterPrimitiveStandardAttributes::invalidate() |
| 130 { |
| 131 if (RenderObject* primitiveRenderer = renderer()) |
| 132 markForLayoutAndParentResourceInvalidation(primitiveRenderer); |
| 133 } |
| 134 |
129 void SVGFilterPrimitiveStandardAttributes::primitiveAttributeChanged(const Quali
fiedName& attribute) | 135 void SVGFilterPrimitiveStandardAttributes::primitiveAttributeChanged(const Quali
fiedName& attribute) |
130 { | 136 { |
131 if (RenderObject* primitiveRenderer = renderer()) | 137 if (RenderObject* primitiveRenderer = renderer()) |
132 static_cast<RenderSVGResourceFilterPrimitive*>(primitiveRenderer)->primi
tiveAttributeChanged(attribute); | 138 static_cast<RenderSVGResourceFilterPrimitive*>(primitiveRenderer)->primi
tiveAttributeChanged(attribute); |
133 } | 139 } |
134 | 140 |
135 void invalidateFilterPrimitiveParent(SVGElement* element) | 141 void invalidateFilterPrimitiveParent(SVGElement* element) |
136 { | 142 { |
137 if (!element) | 143 if (!element) |
138 return; | 144 return; |
139 | 145 |
140 ContainerNode* parent = element->parentNode(); | 146 ContainerNode* parent = element->parentNode(); |
141 | 147 |
142 if (!parent) | 148 if (!parent) |
143 return; | 149 return; |
144 | 150 |
145 RenderObject* renderer = parent->renderer(); | 151 RenderObject* renderer = parent->renderer(); |
146 if (!renderer || !renderer->isSVGResourceFilterPrimitive()) | 152 if (!renderer || !renderer->isSVGResourceFilterPrimitive()) |
147 return; | 153 return; |
148 | 154 |
149 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, fals
e); | 155 RenderSVGResourceContainer::markForLayoutAndParentResourceInvalidation(rende
rer, false); |
150 } | 156 } |
151 | 157 |
152 } | 158 } |
OLD | NEW |