OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 DocumentResource* cachedSVGDocument = documentReference ? documentRefere
nce->document() : 0; | 120 DocumentResource* cachedSVGDocument = documentReference ? documentRefere
nce->document() : 0; |
121 | 121 |
122 if (cachedSVGDocument) { | 122 if (cachedSVGDocument) { |
123 // Reference is external; wait for notifyFinished(). | 123 // Reference is external; wait for notifyFinished(). |
124 cachedSVGDocument->addClient(this); | 124 cachedSVGDocument->addClient(this); |
125 m_externalSVGReferences.append(cachedSVGDocument); | 125 m_externalSVGReferences.append(cachedSVGDocument); |
126 } else { | 126 } else { |
127 // Reference is internal; add layer as a client so we can trigger | 127 // Reference is internal; add layer as a client so we can trigger |
128 // filter repaint on SVG attribute change. | 128 // filter repaint on SVG attribute change. |
129 Element* filter = m_layer->renderer()->node()->document().getElement
ById(referenceFilterOperation->fragment()); | 129 Element* filter = m_layer->renderer()->node()->document().getElement
ById(referenceFilterOperation->fragment()); |
130 if (!filter || !filter->hasTagName(SVGNames::filterTag)) | 130 if (!isSVGFilterElement(filter)) |
131 continue; | 131 continue; |
132 if (filter->renderer()) | 132 if (filter->renderer()) |
133 toRenderSVGResourceContainer(filter->renderer())->addClientRende
rLayer(m_layer); | 133 toRenderSVGResourceContainer(filter->renderer())->addClientRende
rLayer(m_layer); |
134 else | 134 else |
135 toSVGFilterElement(filter)->addClient(m_layer->renderer()->node(
)); | 135 toSVGFilterElement(filter)->addClient(m_layer->renderer()->node(
)); |
136 m_internalSVGReferences.append(filter); | 136 m_internalSVGReferences.append(filter); |
137 } | 137 } |
138 } | 138 } |
139 } | 139 } |
140 | 140 |
141 void RenderLayerFilterInfo::removeReferenceFilterClients() | 141 void RenderLayerFilterInfo::removeReferenceFilterClients() |
142 { | 142 { |
143 for (size_t i = 0; i < m_externalSVGReferences.size(); ++i) | 143 for (size_t i = 0; i < m_externalSVGReferences.size(); ++i) |
144 m_externalSVGReferences.at(i)->removeClient(this); | 144 m_externalSVGReferences.at(i)->removeClient(this); |
145 m_externalSVGReferences.clear(); | 145 m_externalSVGReferences.clear(); |
146 for (size_t i = 0; i < m_internalSVGReferences.size(); ++i) { | 146 for (size_t i = 0; i < m_internalSVGReferences.size(); ++i) { |
147 Element* filter = m_internalSVGReferences.at(i).get(); | 147 Element* filter = m_internalSVGReferences.at(i).get(); |
148 if (filter->renderer()) | 148 if (filter->renderer()) |
149 toRenderSVGResourceContainer(filter->renderer())->removeClientRender
Layer(m_layer); | 149 toRenderSVGResourceContainer(filter->renderer())->removeClientRender
Layer(m_layer); |
150 else | 150 else |
151 toSVGFilterElement(filter)->removeClient(m_layer->renderer()->node()
); | 151 toSVGFilterElement(filter)->removeClient(m_layer->renderer()->node()
); |
152 } | 152 } |
153 m_internalSVGReferences.clear(); | 153 m_internalSVGReferences.clear(); |
154 } | 154 } |
155 | 155 |
156 } // namespace WebCore | 156 } // namespace WebCore |
157 | 157 |
OLD | NEW |