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 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> |
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> |
5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> |
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 23 matching lines...) Expand all Loading... |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 DEFINE_TRACE(FilterData) | 36 DEFINE_TRACE(FilterData) |
37 { | 37 { |
38 #if ENABLE(OILPAN) | 38 #if ENABLE(OILPAN) |
39 visitor->trace(filter); | 39 visitor->trace(filter); |
40 visitor->trace(builder); | 40 visitor->trace(builder); |
41 #endif | 41 #endif |
42 } | 42 } |
43 | 43 |
| 44 void FilterData::dispose() |
| 45 { |
| 46 m_context.clear(); |
| 47 m_displayItemList.clear(); |
| 48 builder = nullptr; |
| 49 filter = nullptr; |
| 50 } |
| 51 |
44 LayoutSVGResourceFilter::LayoutSVGResourceFilter(SVGFilterElement* node) | 52 LayoutSVGResourceFilter::LayoutSVGResourceFilter(SVGFilterElement* node) |
45 : LayoutSVGResourceContainer(node) | 53 : LayoutSVGResourceContainer(node) |
46 { | 54 { |
47 } | 55 } |
48 | 56 |
49 LayoutSVGResourceFilter::~LayoutSVGResourceFilter() | 57 LayoutSVGResourceFilter::~LayoutSVGResourceFilter() |
50 { | 58 { |
51 } | 59 } |
52 | 60 |
| 61 void LayoutSVGResourceFilter::disposeFilterMap() |
| 62 { |
| 63 #if ENABLE(OILPAN) |
| 64 for (auto& filter : m_filter) |
| 65 filter.value->dispose(); |
| 66 #endif |
| 67 m_filter.clear(); |
| 68 } |
| 69 |
53 void LayoutSVGResourceFilter::destroy() | 70 void LayoutSVGResourceFilter::destroy() |
54 { | 71 { |
55 m_filter.clear(); | 72 disposeFilterMap(); |
56 LayoutSVGResourceContainer::destroy(); | 73 LayoutSVGResourceContainer::destroy(); |
57 } | 74 } |
58 | 75 |
59 bool LayoutSVGResourceFilter::isChildAllowed(LayoutObject* child, const LayoutSt
yle&) const | 76 bool LayoutSVGResourceFilter::isChildAllowed(LayoutObject* child, const LayoutSt
yle&) const |
60 { | 77 { |
61 return child->isSVGResourceFilterPrimitive(); | 78 return child->isSVGResourceFilterPrimitive(); |
62 } | 79 } |
63 | 80 |
64 void LayoutSVGResourceFilter::removeAllClientsFromCache(bool markForInvalidation
) | 81 void LayoutSVGResourceFilter::removeAllClientsFromCache(bool markForInvalidation
) |
65 { | 82 { |
66 m_filter.clear(); | 83 disposeFilterMap(); |
67 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); | 84 markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInval
idation : ParentOnlyInvalidation); |
68 } | 85 } |
69 | 86 |
70 void LayoutSVGResourceFilter::removeClientFromCache(LayoutObject* client, bool m
arkForInvalidation) | 87 void LayoutSVGResourceFilter::removeClientFromCache(LayoutObject* client, bool m
arkForInvalidation) |
71 { | 88 { |
72 ASSERT(client); | 89 ASSERT(client); |
73 | 90 |
74 m_filter.remove(client); | 91 m_filter.remove(client); |
75 | 92 |
76 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); | 93 markClientForInvalidation(client, markForInvalidation ? BoundariesInvalidati
on : ParentOnlyInvalidation); |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if (SVGFilterElement* element = toSVGFilterElement(this->element())) | 125 if (SVGFilterElement* element = toSVGFilterElement(this->element())) |
109 return SVGLengthContext::resolveRectangle<SVGFilterElement>(element, ele
ment->filterUnits()->currentValue()->enumValue(), object->objectBoundingBox()); | 126 return SVGLengthContext::resolveRectangle<SVGFilterElement>(element, ele
ment->filterUnits()->currentValue()->enumValue(), object->objectBoundingBox()); |
110 | 127 |
111 return FloatRect(); | 128 return FloatRect(); |
112 } | 129 } |
113 | 130 |
114 void LayoutSVGResourceFilter::primitiveAttributeChanged(LayoutObject* object, co
nst QualifiedName& attribute) | 131 void LayoutSVGResourceFilter::primitiveAttributeChanged(LayoutObject* object, co
nst QualifiedName& attribute) |
115 { | 132 { |
116 FilterMap::iterator it = m_filter.begin(); | 133 FilterMap::iterator it = m_filter.begin(); |
117 FilterMap::iterator end = m_filter.end(); | 134 FilterMap::iterator end = m_filter.end(); |
118 SVGFilterPrimitiveStandardAttributes* primitve = static_cast<SVGFilterPrimit
iveStandardAttributes*>(object->node()); | 135 SVGFilterPrimitiveStandardAttributes* primitive = static_cast<SVGFilterPrimi
tiveStandardAttributes*>(object->node()); |
119 | 136 |
120 for (; it != end; ++it) { | 137 for (; it != end; ++it) { |
121 FilterData* filterData = it->value.get(); | 138 FilterData* filterData = it->value.get(); |
122 if (filterData->m_state != FilterData::ReadyToPaint) | 139 if (filterData->m_state != FilterData::ReadyToPaint) |
123 continue; | 140 continue; |
124 | 141 |
125 SVGFilterBuilder* builder = filterData->builder.get(); | 142 SVGFilterBuilder* builder = filterData->builder.get(); |
126 FilterEffect* effect = builder->effectByRenderer(object); | 143 FilterEffect* effect = builder->effectByRenderer(object); |
127 if (!effect) | 144 if (!effect) |
128 continue; | 145 continue; |
129 // Since all effects shares the same attribute value, all | 146 // Since all effects shares the same attribute value, all |
130 // or none of them will be changed. | 147 // or none of them will be changed. |
131 if (!primitve->setFilterEffectAttribute(effect, attribute)) | 148 if (!primitive->setFilterEffectAttribute(effect, attribute)) |
132 return; | 149 return; |
133 builder->clearResultsRecursive(effect); | 150 builder->clearResultsRecursive(effect); |
134 | 151 |
135 // Issue paint invalidations for the image on the screen. | 152 // Issue paint invalidations for the image on the screen. |
136 markClientForInvalidation(it->key, PaintInvalidation); | 153 markClientForInvalidation(it->key, PaintInvalidation); |
137 } | 154 } |
138 markAllClientLayersForInvalidation(); | 155 markAllClientLayersForInvalidation(); |
139 } | 156 } |
140 | 157 |
141 } | 158 } // namespace blink |
OLD | NEW |