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

Side by Side Diff: Source/core/layout/LayerFilterInfo.cpp

Issue 977113003: Rename renderer() to layoutObject(). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayerFilterInfo.h ('k') | Source/core/layout/LayerScrollableArea.cpp » ('j') | 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 removeReferenceFilterClients(); 96 removeReferenceFilterClients();
97 } 97 }
98 98
99 void LayerFilterInfo::setRenderer(PassRefPtrWillBeRawPtr<FilterEffectRenderer> r enderer) 99 void LayerFilterInfo::setRenderer(PassRefPtrWillBeRawPtr<FilterEffectRenderer> r enderer)
100 { 100 {
101 m_renderer = renderer; 101 m_renderer = renderer;
102 } 102 }
103 103
104 void LayerFilterInfo::notifyFinished(Resource*) 104 void LayerFilterInfo::notifyFinished(Resource*)
105 { 105 {
106 LayoutObject* renderer = m_layer->renderer(); 106 LayoutObject* renderer = m_layer->layoutObject();
107 // FIXME: This caller of scheduleSVGFilterLayerUpdateHack() is not correct. It's using the layer update 107 // FIXME: This caller of scheduleSVGFilterLayerUpdateHack() is not correct. It's using the layer update
108 // system to trigger a Layer to go through the filter updating logic, but th at might not 108 // system to trigger a Layer to go through the filter updating logic, but th at might not
109 // even happen if this element is style sharing and LayoutObject::setStyle() returns early. 109 // even happen if this element is style sharing and LayoutObject::setStyle() returns early.
110 // Filters need to find a better way to hook into the system. 110 // Filters need to find a better way to hook into the system.
111 toElement(renderer->node())->scheduleSVGFilterLayerUpdateHack(); 111 toElement(renderer->node())->scheduleSVGFilterLayerUpdateHack();
112 renderer->setShouldDoFullPaintInvalidation(); 112 renderer->setShouldDoFullPaintInvalidation();
113 } 113 }
114 114
115 void LayerFilterInfo::updateReferenceFilterClients(const FilterOperations& opera tions) 115 void LayerFilterInfo::updateReferenceFilterClients(const FilterOperations& opera tions)
116 { 116 {
117 removeReferenceFilterClients(); 117 removeReferenceFilterClients();
118 for (size_t i = 0; i < operations.size(); ++i) { 118 for (size_t i = 0; i < operations.size(); ++i) {
119 RefPtrWillBeRawPtr<FilterOperation> filterOperation = operations.operati ons().at(i); 119 RefPtrWillBeRawPtr<FilterOperation> filterOperation = operations.operati ons().at(i);
120 if (filterOperation->type() != FilterOperation::REFERENCE) 120 if (filterOperation->type() != FilterOperation::REFERENCE)
121 continue; 121 continue;
122 ReferenceFilterOperation* referenceFilterOperation = toReferenceFilterOp eration(filterOperation.get()); 122 ReferenceFilterOperation* referenceFilterOperation = toReferenceFilterOp eration(filterOperation.get());
123 DocumentResourceReference* documentReference = ReferenceFilterBuilder::d ocumentResourceReference(referenceFilterOperation); 123 DocumentResourceReference* documentReference = ReferenceFilterBuilder::d ocumentResourceReference(referenceFilterOperation);
124 DocumentResource* cachedSVGDocument = documentReference ? documentRefere nce->document() : 0; 124 DocumentResource* cachedSVGDocument = documentReference ? documentRefere nce->document() : 0;
125 125
126 if (cachedSVGDocument) { 126 if (cachedSVGDocument) {
127 // Reference is external; wait for notifyFinished(). 127 // Reference is external; wait for notifyFinished().
128 cachedSVGDocument->addClient(this); 128 cachedSVGDocument->addClient(this);
129 m_externalSVGReferences.append(cachedSVGDocument); 129 m_externalSVGReferences.append(cachedSVGDocument);
130 } else { 130 } else {
131 // Reference is internal; add layer as a client so we can trigger 131 // Reference is internal; add layer as a client so we can trigger
132 // filter paint invalidation on SVG attribute change. 132 // filter paint invalidation on SVG attribute change.
133 Element* filter = m_layer->renderer()->node()->document().getElement ById(referenceFilterOperation->fragment()); 133 Element* filter = m_layer->layoutObject()->node()->document().getEle mentById(referenceFilterOperation->fragment());
134 if (!isSVGFilterElement(filter)) 134 if (!isSVGFilterElement(filter))
135 continue; 135 continue;
136 if (filter->renderer()) 136 if (filter->layoutObject())
137 toLayoutSVGResourceContainer(filter->renderer())->addClientLayer (m_layer); 137 toLayoutSVGResourceContainer(filter->layoutObject())->addClientL ayer(m_layer);
138 else 138 else
139 toSVGFilterElement(filter)->addClient(m_layer->renderer()->node( )); 139 toSVGFilterElement(filter)->addClient(m_layer->layoutObject()->n ode());
140 m_internalSVGReferences.append(filter); 140 m_internalSVGReferences.append(filter);
141 } 141 }
142 } 142 }
143 } 143 }
144 144
145 void LayerFilterInfo::removeReferenceFilterClients() 145 void LayerFilterInfo::removeReferenceFilterClients()
146 { 146 {
147 for (size_t i = 0; i < m_externalSVGReferences.size(); ++i) 147 for (size_t i = 0; i < m_externalSVGReferences.size(); ++i)
148 m_externalSVGReferences.at(i)->removeClient(this); 148 m_externalSVGReferences.at(i)->removeClient(this);
149 m_externalSVGReferences.clear(); 149 m_externalSVGReferences.clear();
150 for (size_t i = 0; i < m_internalSVGReferences.size(); ++i) { 150 for (size_t i = 0; i < m_internalSVGReferences.size(); ++i) {
151 Element* filter = m_internalSVGReferences.at(i).get(); 151 Element* filter = m_internalSVGReferences.at(i).get();
152 if (filter->renderer()) 152 if (filter->layoutObject())
153 toLayoutSVGResourceContainer(filter->renderer())->removeClientLayer( m_layer); 153 toLayoutSVGResourceContainer(filter->layoutObject())->removeClientLa yer(m_layer);
154 else 154 else
155 toSVGFilterElement(filter)->removeClient(m_layer->renderer()->node() ); 155 toSVGFilterElement(filter)->removeClient(m_layer->layoutObject()->no de());
156 } 156 }
157 m_internalSVGReferences.clear(); 157 m_internalSVGReferences.clear();
158 } 158 }
159 159
160 } // namespace blink 160 } // namespace blink
161 161
OLDNEW
« no previous file with comments | « Source/core/layout/LayerFilterInfo.h ('k') | Source/core/layout/LayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698