Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(488)

Side by Side Diff: third_party/WebKit/Source/core/paint/PaintLayerFilterInfo.cpp

Issue 2490163002: Reland of "Tracking reference filter mutation via SVGElementProxy" (Closed)
Patch Set: Fix double observer unregistration; simplify scope selection; add tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
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/paint/PaintLayer.h" 32 #include "core/paint/PaintLayer.h"
33 #include "core/style/FilterOperations.h"
34 #include "platform/graphics/filters/FilterEffect.h" 33 #include "platform/graphics/filters/FilterEffect.h"
35 34
36 namespace blink { 35 namespace blink {
37 36
38 PaintLayerFilterInfo::PaintLayerFilterInfo(PaintLayer* layer) 37 PaintLayerFilterInfo::PaintLayerFilterInfo(PaintLayer* layer)
39 : m_layer(layer) {} 38 : m_layer(layer) {}
40 39
41 PaintLayerFilterInfo::~PaintLayerFilterInfo() { 40 PaintLayerFilterInfo::~PaintLayerFilterInfo() {
42 DCHECK(!m_layer); 41 DCHECK(!m_layer);
43 } 42 }
44 43
44 TreeScope* PaintLayerFilterInfo::treeScope() {
45 DCHECK(m_layer);
46 Node* node = m_layer->layoutObject()->node();
47 return node ? &node->treeScope() : nullptr;
48 }
49
50 void PaintLayerFilterInfo::resourceContentChanged() {
51 DCHECK(m_layer);
52 m_layer->layoutObject()->setShouldDoFullPaintInvalidation();
53 invalidateFilterChain();
54 }
55
56 void PaintLayerFilterInfo::resourceElementChanged() {
57 DCHECK(m_layer);
58 m_layer->layoutObject()->setShouldDoFullPaintInvalidation();
59 invalidateFilterChain();
60 }
61
45 void PaintLayerFilterInfo::setLastEffect(FilterEffect* lastEffect) { 62 void PaintLayerFilterInfo::setLastEffect(FilterEffect* lastEffect) {
46 m_lastEffect = lastEffect; 63 m_lastEffect = lastEffect;
47 } 64 }
48 65
49 void PaintLayerFilterInfo::updateReferenceFilterClients( 66 FilterEffect* PaintLayerFilterInfo::lastEffect() const {
50 const FilterOperations& operations) { 67 return m_lastEffect;
51 clearFilterReferences();
52 addFilterReferences(operations, m_layer->layoutObject()->document());
53 } 68 }
54 69
55 void PaintLayerFilterInfo::filterNeedsInvalidation() { 70 void PaintLayerFilterInfo::invalidateFilterChain() {
56 if (m_layer) 71 m_lastEffect = nullptr;
57 m_layer->filterNeedsPaintInvalidation();
58 } 72 }
59 73
60 DEFINE_TRACE(PaintLayerFilterInfo) { 74 DEFINE_TRACE(PaintLayerFilterInfo) {
61 visitor->trace(m_lastEffect); 75 visitor->trace(m_lastEffect);
62 SVGResourceClient::trace(visitor); 76 SVGResourceClient::trace(visitor);
63 } 77 }
64 78
65 } // namespace blink 79 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayerFilterInfo.h ('k') | third_party/WebKit/Source/core/style/FilterOperation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698