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 19 matching lines...) Expand all Loading... |
30 #include "config.h" | 30 #include "config.h" |
31 | 31 |
32 #if ENABLE(CSS_FILTERS) | 32 #if ENABLE(CSS_FILTERS) |
33 #include "RenderLayerFilterInfo.h" | 33 #include "RenderLayerFilterInfo.h" |
34 | 34 |
35 #include "FilterEffectRenderer.h" | 35 #include "FilterEffectRenderer.h" |
36 #include "RenderLayer.h" | 36 #include "RenderLayer.h" |
37 | 37 |
38 #if ENABLE(SVG) | 38 #if ENABLE(SVG) |
39 #include "CachedSVGDocument.h" | 39 #include "CachedSVGDocument.h" |
| 40 #include "CachedSVGDocumentReference.h" |
40 #include "SVGElement.h" | 41 #include "SVGElement.h" |
41 #include "SVGFilter.h" | 42 #include "SVGFilter.h" |
42 #include "SVGFilterPrimitiveStandardAttributes.h" | 43 #include "SVGFilterPrimitiveStandardAttributes.h" |
43 #endif | 44 #endif |
44 | 45 |
45 #if ENABLE(CSS_SHADERS) | 46 #if ENABLE(CSS_SHADERS) |
46 #include "CustomFilterOperation.h" | 47 #include "CustomFilterOperation.h" |
47 #include "CustomFilterProgram.h" | 48 #include "CustomFilterProgram.h" |
48 #endif | 49 #endif |
49 | 50 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 123 } |
123 | 124 |
124 void RenderLayerFilterInfo::updateReferenceFilterClients(const FilterOperations&
operations) | 125 void RenderLayerFilterInfo::updateReferenceFilterClients(const FilterOperations&
operations) |
125 { | 126 { |
126 removeReferenceFilterClients(); | 127 removeReferenceFilterClients(); |
127 for (size_t i = 0; i < operations.size(); ++i) { | 128 for (size_t i = 0; i < operations.size(); ++i) { |
128 RefPtr<FilterOperation> filterOperation = operations.operations().at(i); | 129 RefPtr<FilterOperation> filterOperation = operations.operations().at(i); |
129 if (filterOperation->getOperationType() != FilterOperation::REFERENCE) | 130 if (filterOperation->getOperationType() != FilterOperation::REFERENCE) |
130 continue; | 131 continue; |
131 ReferenceFilterOperation* referenceFilterOperation = static_cast<Referen
ceFilterOperation*>(filterOperation.get()); | 132 ReferenceFilterOperation* referenceFilterOperation = static_cast<Referen
ceFilterOperation*>(filterOperation.get()); |
132 CachedSVGDocument* cachedSVGDocument = static_cast<CachedSVGDocument*>(r
eferenceFilterOperation->data()); | 133 CachedSVGDocumentReference* documentReference = static_cast<CachedSVGDoc
umentReference*>(referenceFilterOperation->data()); |
| 134 CachedSVGDocument* cachedSVGDocument = documentReference ? documentRefer
ence->document() : 0; |
133 | 135 |
134 if (cachedSVGDocument) { | 136 if (cachedSVGDocument) { |
135 // Reference is external; wait for notifyFinished(). | 137 // Reference is external; wait for notifyFinished(). |
136 cachedSVGDocument->addClient(this); | 138 cachedSVGDocument->addClient(this); |
137 m_externalSVGReferences.append(cachedSVGDocument); | 139 m_externalSVGReferences.append(cachedSVGDocument); |
138 } else { | 140 } else { |
139 // Reference is internal; add layer as a client so we can trigger | 141 // Reference is internal; add layer as a client so we can trigger |
140 // filter repaint on SVG attribute change. | 142 // filter repaint on SVG attribute change. |
141 Element* filter = m_layer->renderer()->node()->document()->getElemen
tById(referenceFilterOperation->fragment()); | 143 Element* filter = m_layer->renderer()->node()->document()->getElemen
tById(referenceFilterOperation->fragment()); |
142 if (!filter || !filter->renderer()) | 144 if (!filter || !filter->renderer()) |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 { | 198 { |
197 for (size_t i = 0; i < m_cachedCustomFilterPrograms.size(); ++i) | 199 for (size_t i = 0; i < m_cachedCustomFilterPrograms.size(); ++i) |
198 m_cachedCustomFilterPrograms.at(i)->removeClient(this); | 200 m_cachedCustomFilterPrograms.at(i)->removeClient(this); |
199 m_cachedCustomFilterPrograms.clear(); | 201 m_cachedCustomFilterPrograms.clear(); |
200 } | 202 } |
201 #endif | 203 #endif |
202 | 204 |
203 } // namespace WebCore | 205 } // namespace WebCore |
204 | 206 |
205 #endif // ENABLE(CSS_FILTERS) | 207 #endif // ENABLE(CSS_FILTERS) |
OLD | NEW |