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

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

Issue 2581243003: [SPInvalidation] Update paint properties when SVG resource change (Closed)
Patch Set: Rebase Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 TreeScope* PaintLayerResourceInfo::treeScope() { 44 TreeScope* PaintLayerResourceInfo::treeScope() {
45 DCHECK(m_layer); 45 DCHECK(m_layer);
46 Node* node = m_layer->layoutObject()->node(); 46 Node* node = m_layer->layoutObject()->node();
47 return node ? &node->treeScope() : nullptr; 47 return node ? &node->treeScope() : nullptr;
48 } 48 }
49 49
50 void PaintLayerResourceInfo::resourceContentChanged() { 50 void PaintLayerResourceInfo::resourceContentChanged() {
51 DCHECK(m_layer); 51 DCHECK(m_layer);
52 LayoutObject* layoutObject = m_layer->layoutObject(); 52 LayoutObject* layoutObject = m_layer->layoutObject();
53 layoutObject->setShouldDoFullPaintInvalidation(); 53 layoutObject->setShouldDoFullPaintInvalidation();
54 // The effect paint property nodes depend on SVG filters so we need
55 // to update these properties when filter resources change.
56 layoutObject->setNeedsPaintPropertyUpdate();
54 const ComputedStyle& style = layoutObject->styleRef(); 57 const ComputedStyle& style = layoutObject->styleRef();
55 if (style.hasFilter() && style.filter().hasReferenceFilter()) 58 if (style.hasFilter() && style.filter().hasReferenceFilter())
56 invalidateFilterChain(); 59 invalidateFilterChain();
57 } 60 }
58 61
59 void PaintLayerResourceInfo::resourceElementChanged() { 62 void PaintLayerResourceInfo::resourceElementChanged() {
60 DCHECK(m_layer); 63 DCHECK(m_layer);
61 LayoutObject* layoutObject = m_layer->layoutObject(); 64 LayoutObject* layoutObject = m_layer->layoutObject();
62 layoutObject->setShouldDoFullPaintInvalidation(); 65 layoutObject->setShouldDoFullPaintInvalidation();
66 // The effect paint property nodes depend on SVG filters so we need
67 // to update these properties when filter resources change.
68 layoutObject->setNeedsPaintPropertyUpdate();
63 const ComputedStyle& style = layoutObject->styleRef(); 69 const ComputedStyle& style = layoutObject->styleRef();
64 if (style.hasFilter() && style.filter().hasReferenceFilter()) 70 if (style.hasFilter() && style.filter().hasReferenceFilter())
65 invalidateFilterChain(); 71 invalidateFilterChain();
66 } 72 }
67 73
68 void PaintLayerResourceInfo::setLastEffect(FilterEffect* lastEffect) { 74 void PaintLayerResourceInfo::setLastEffect(FilterEffect* lastEffect) {
69 m_lastEffect = lastEffect; 75 m_lastEffect = lastEffect;
70 } 76 }
71 77
72 FilterEffect* PaintLayerResourceInfo::lastEffect() const { 78 FilterEffect* PaintLayerResourceInfo::lastEffect() const {
73 return m_lastEffect; 79 return m_lastEffect;
74 } 80 }
75 81
76 void PaintLayerResourceInfo::invalidateFilterChain() { 82 void PaintLayerResourceInfo::invalidateFilterChain() {
77 m_lastEffect = nullptr; 83 m_lastEffect = nullptr;
78 } 84 }
79 85
80 DEFINE_TRACE(PaintLayerResourceInfo) { 86 DEFINE_TRACE(PaintLayerResourceInfo) {
81 visitor->trace(m_lastEffect); 87 visitor->trace(m_lastEffect);
82 SVGResourceClient::trace(visitor); 88 SVGResourceClient::trace(visitor);
83 } 89 }
84 90
85 } // namespace blink 91 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/svg/LayoutSVGResourceContainer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698