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

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

Issue 2692853016: Change PaintLayer::m_layoutObject to a reference. (Closed)
Patch Set: Added TODO Created 3 years, 10 months 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 25 matching lines...) Expand all
36 36
37 PaintLayerResourceInfo::PaintLayerResourceInfo(PaintLayer* layer) 37 PaintLayerResourceInfo::PaintLayerResourceInfo(PaintLayer* layer)
38 : m_layer(layer) {} 38 : m_layer(layer) {}
39 39
40 PaintLayerResourceInfo::~PaintLayerResourceInfo() { 40 PaintLayerResourceInfo::~PaintLayerResourceInfo() {
41 DCHECK(!m_layer); 41 DCHECK(!m_layer);
42 } 42 }
43 43
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 54 // The effect paint property nodes depend on SVG filters so we need
55 // to update these properties when filter resources change. 55 // to update these properties when filter resources change.
56 layoutObject->setNeedsPaintPropertyUpdate(); 56 layoutObject.setNeedsPaintPropertyUpdate();
57 const ComputedStyle& style = layoutObject->styleRef(); 57 const ComputedStyle& style = layoutObject.styleRef();
58 if (style.hasFilter() && style.filter().hasReferenceFilter()) 58 if (style.hasFilter() && style.filter().hasReferenceFilter())
59 invalidateFilterChain(); 59 invalidateFilterChain();
60 } 60 }
61 61
62 void PaintLayerResourceInfo::resourceElementChanged() { 62 void PaintLayerResourceInfo::resourceElementChanged() {
63 DCHECK(m_layer); 63 DCHECK(m_layer);
64 LayoutObject* layoutObject = m_layer->layoutObject(); 64 LayoutObject& layoutObject = m_layer->layoutObject();
65 layoutObject->setShouldDoFullPaintInvalidation(); 65 layoutObject.setShouldDoFullPaintInvalidation();
66 // The effect paint property nodes depend on SVG filters so we need 66 // The effect paint property nodes depend on SVG filters so we need
67 // to update these properties when filter resources change. 67 // to update these properties when filter resources change.
68 layoutObject->setNeedsPaintPropertyUpdate(); 68 layoutObject.setNeedsPaintPropertyUpdate();
69 const ComputedStyle& style = layoutObject->styleRef(); 69 const ComputedStyle& style = layoutObject.styleRef();
70 if (style.hasFilter() && style.filter().hasReferenceFilter()) 70 if (style.hasFilter() && style.filter().hasReferenceFilter())
71 invalidateFilterChain(); 71 invalidateFilterChain();
72 } 72 }
73 73
74 void PaintLayerResourceInfo::setLastEffect(FilterEffect* lastEffect) { 74 void PaintLayerResourceInfo::setLastEffect(FilterEffect* lastEffect) {
75 m_lastEffect = lastEffect; 75 m_lastEffect = lastEffect;
76 } 76 }
77 77
78 FilterEffect* PaintLayerResourceInfo::lastEffect() const { 78 FilterEffect* PaintLayerResourceInfo::lastEffect() const {
79 return m_lastEffect; 79 return m_lastEffect;
80 } 80 }
81 81
82 void PaintLayerResourceInfo::invalidateFilterChain() { 82 void PaintLayerResourceInfo::invalidateFilterChain() {
83 m_lastEffect = nullptr; 83 m_lastEffect = nullptr;
84 } 84 }
85 85
86 DEFINE_TRACE(PaintLayerResourceInfo) { 86 DEFINE_TRACE(PaintLayerResourceInfo) {
87 visitor->trace(m_lastEffect); 87 visitor->trace(m_lastEffect);
88 SVGResourceClient::trace(visitor); 88 SVGResourceClient::trace(visitor);
89 } 89 }
90 90
91 } // namespace blink 91 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698