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 11 matching lines...) Expand all Loading... |
22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 22 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 23 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
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 "core/paint/PaintLayerFilterInfo.h" | 30 #include "core/paint/PaintLayerFilterInfo.h" |
31 | 31 |
| 32 #include "core/dom/StyleChangeReason.h" |
32 #include "core/paint/PaintLayer.h" | 33 #include "core/paint/PaintLayer.h" |
33 #include "core/style/FilterOperations.h" | |
34 #include "platform/graphics/filters/FilterEffect.h" | 34 #include "platform/graphics/filters/FilterEffect.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 PaintLayerFilterInfo::PaintLayerFilterInfo(PaintLayer* layer) | 38 PaintLayerFilterInfo::PaintLayerFilterInfo(PaintLayer* layer) |
39 : m_layer(layer) {} | 39 : m_layer(layer) {} |
40 | 40 |
41 PaintLayerFilterInfo::~PaintLayerFilterInfo() { | 41 PaintLayerFilterInfo::~PaintLayerFilterInfo() { |
42 DCHECK(!m_layer); | 42 DCHECK(!m_layer); |
43 } | 43 } |
44 | 44 |
| 45 void PaintLayerFilterInfo::resourceContentChanged(SVGElementProxy*) { |
| 46 DCHECK(m_layer); |
| 47 m_layer->layoutObject()->setShouldDoFullPaintInvalidation(); |
| 48 invalidateFilterChain(); |
| 49 } |
| 50 |
| 51 void PaintLayerFilterInfo::resourceReferenceChanged(SVGElementProxy*) { |
| 52 DCHECK(m_layer); |
| 53 Node* node = m_layer->enclosingNode(); |
| 54 node->setNeedsStyleRecalc(LocalStyleChange, |
| 55 StyleChangeReasonForTracing::create( |
| 56 StyleChangeReason::SVGResourceChange)); |
| 57 } |
| 58 |
45 void PaintLayerFilterInfo::setLastEffect(FilterEffect* lastEffect) { | 59 void PaintLayerFilterInfo::setLastEffect(FilterEffect* lastEffect) { |
46 m_lastEffect = lastEffect; | 60 m_lastEffect = lastEffect; |
47 } | 61 } |
48 | 62 |
49 void PaintLayerFilterInfo::updateReferenceFilterClients( | 63 FilterEffect* PaintLayerFilterInfo::lastEffect() const { |
50 const FilterOperations& operations) { | 64 return m_lastEffect; |
51 clearFilterReferences(); | |
52 addFilterReferences(operations, m_layer->layoutObject()->document()); | |
53 } | 65 } |
54 | 66 |
55 void PaintLayerFilterInfo::filterNeedsInvalidation() { | 67 void PaintLayerFilterInfo::invalidateFilterChain() { |
56 if (m_layer) | 68 m_lastEffect = nullptr; |
57 m_layer->filterNeedsPaintInvalidation(); | |
58 } | 69 } |
59 | 70 |
60 DEFINE_TRACE(PaintLayerFilterInfo) { | 71 DEFINE_TRACE(PaintLayerFilterInfo) { |
61 visitor->trace(m_lastEffect); | 72 visitor->trace(m_lastEffect); |
62 SVGResourceClient::trace(visitor); | 73 SVGResourceClient::trace(visitor); |
63 } | 74 } |
64 | 75 |
65 } // namespace blink | 76 } // namespace blink |
OLD | NEW |