| 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 13 matching lines...) Expand all Loading... |
| 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR | 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR |
| 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF | 25 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF |
| 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | 26 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| 27 * SUCH DAMAGE. | 27 * SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 | 31 |
| 32 #include "core/rendering/RenderLayerFilterInfo.h" | 32 #include "core/rendering/RenderLayerFilterInfo.h" |
| 33 | 33 |
| 34 #include "core/loader/cache/CachedSVGDocument.h" | 34 #include "core/loader/cache/CachedDocument.h" |
| 35 #include "core/loader/cache/CachedSVGDocumentReference.h" | 35 #include "core/loader/cache/CachedSVGDocumentReference.h" |
| 36 #include "core/platform/graphics/filters/custom/CustomFilterOperation.h" | 36 #include "core/platform/graphics/filters/custom/CustomFilterOperation.h" |
| 37 #include "core/platform/graphics/filters/custom/CustomFilterProgram.h" | 37 #include "core/platform/graphics/filters/custom/CustomFilterProgram.h" |
| 38 #include "core/rendering/FilterEffectRenderer.h" | 38 #include "core/rendering/FilterEffectRenderer.h" |
| 39 #include "core/rendering/RenderLayer.h" | 39 #include "core/rendering/RenderLayer.h" |
| 40 #include "core/svg/SVGElement.h" | 40 #include "core/svg/SVGElement.h" |
| 41 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h" | 41 #include "core/svg/SVGFilterPrimitiveStandardAttributes.h" |
| 42 #include "core/svg/graphics/filters/SVGFilter.h" | 42 #include "core/svg/graphics/filters/SVGFilter.h" |
| 43 | 43 |
| 44 namespace WebCore { | 44 namespace WebCore { |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 void RenderLayerFilterInfo::updateReferenceFilterClients(const FilterOperations&
operations) | 113 void RenderLayerFilterInfo::updateReferenceFilterClients(const FilterOperations&
operations) |
| 114 { | 114 { |
| 115 removeReferenceFilterClients(); | 115 removeReferenceFilterClients(); |
| 116 for (size_t i = 0; i < operations.size(); ++i) { | 116 for (size_t i = 0; i < operations.size(); ++i) { |
| 117 RefPtr<FilterOperation> filterOperation = operations.operations().at(i); | 117 RefPtr<FilterOperation> filterOperation = operations.operations().at(i); |
| 118 if (filterOperation->getOperationType() != FilterOperation::REFERENCE) | 118 if (filterOperation->getOperationType() != FilterOperation::REFERENCE) |
| 119 continue; | 119 continue; |
| 120 ReferenceFilterOperation* referenceFilterOperation = static_cast<Referen
ceFilterOperation*>(filterOperation.get()); | 120 ReferenceFilterOperation* referenceFilterOperation = static_cast<Referen
ceFilterOperation*>(filterOperation.get()); |
| 121 CachedSVGDocumentReference* documentReference = referenceFilterOperation
->cachedSVGDocumentReference(); | 121 CachedSVGDocumentReference* documentReference = referenceFilterOperation
->cachedSVGDocumentReference(); |
| 122 CachedSVGDocument* cachedSVGDocument = documentReference ? documentRefer
ence->document() : 0; | 122 CachedDocument* cachedSVGDocument = documentReference ? documentReferenc
e->document() : 0; |
| 123 | 123 |
| 124 if (cachedSVGDocument) { | 124 if (cachedSVGDocument) { |
| 125 // Reference is external; wait for notifyFinished(). | 125 // Reference is external; wait for notifyFinished(). |
| 126 cachedSVGDocument->addClient(this); | 126 cachedSVGDocument->addClient(this); |
| 127 m_externalSVGReferences.append(cachedSVGDocument); | 127 m_externalSVGReferences.append(cachedSVGDocument); |
| 128 } else { | 128 } else { |
| 129 // Reference is internal; add layer as a client so we can trigger | 129 // Reference is internal; add layer as a client so we can trigger |
| 130 // filter repaint on SVG attribute change. | 130 // filter repaint on SVG attribute change. |
| 131 Element* filter = m_layer->renderer()->node()->document()->getElemen
tById(referenceFilterOperation->fragment()); | 131 Element* filter = m_layer->renderer()->node()->document()->getElemen
tById(referenceFilterOperation->fragment()); |
| 132 if (!filter || !filter->renderer() || !filter->renderer()->isSVGReso
urceFilter()) | 132 if (!filter || !filter->renderer() || !filter->renderer()->isSVGReso
urceFilter()) |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 void RenderLayerFilterInfo::removeCustomFilterClients() | 182 void RenderLayerFilterInfo::removeCustomFilterClients() |
| 183 { | 183 { |
| 184 for (size_t i = 0; i < m_cachedCustomFilterPrograms.size(); ++i) | 184 for (size_t i = 0; i < m_cachedCustomFilterPrograms.size(); ++i) |
| 185 m_cachedCustomFilterPrograms.at(i)->removeClient(this); | 185 m_cachedCustomFilterPrograms.at(i)->removeClient(this); |
| 186 m_cachedCustomFilterPrograms.clear(); | 186 m_cachedCustomFilterPrograms.clear(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 } // namespace WebCore | 189 } // namespace WebCore |
| 190 | 190 |
| OLD | NEW |