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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 RenderLayerFilterInfo::RenderLayerFilterInfo(RenderLayer* layer) | 89 RenderLayerFilterInfo::RenderLayerFilterInfo(RenderLayer* layer) |
90 : m_layer(layer) | 90 : m_layer(layer) |
91 { | 91 { |
92 } | 92 } |
93 | 93 |
94 RenderLayerFilterInfo::~RenderLayerFilterInfo() | 94 RenderLayerFilterInfo::~RenderLayerFilterInfo() |
95 { | 95 { |
96 removeReferenceFilterClients(); | 96 removeReferenceFilterClients(); |
97 } | 97 } |
98 | 98 |
99 void RenderLayerFilterInfo::setRenderer(PassRefPtr<FilterEffectRenderer> rendere
r) | 99 void RenderLayerFilterInfo::setRenderer(PassRefPtrWillBeRawPtr<FilterEffectRende
rer> renderer) |
100 { | 100 { |
101 m_renderer = renderer; | 101 m_renderer = renderer; |
102 } | 102 } |
103 | 103 |
104 void RenderLayerFilterInfo::notifyFinished(Resource*) | 104 void RenderLayerFilterInfo::notifyFinished(Resource*) |
105 { | 105 { |
106 RenderObject* renderer = m_layer->renderer(); | 106 RenderObject* renderer = m_layer->renderer(); |
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 RenderLayer to go through the filter updating logic,
but that might not | 108 // system to trigger a RenderLayer to go through the filter updating logic,
but that might not |
109 // even happen if this element is style sharing and RenderObject::setStyle()
returns early. | 109 // even happen if this element is style sharing and RenderObject::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 RenderLayerFilterInfo::updateReferenceFilterClients(const FilterOperations&
operations) | 115 void RenderLayerFilterInfo::updateReferenceFilterClients(const FilterOperations&
operations) |
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 RefPtr<FilterOperation> filterOperation = operations.operations().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); |
(...skipping 22 matching lines...) Expand all Loading... |
152 if (filter->renderer()) | 152 if (filter->renderer()) |
153 toRenderSVGResourceContainer(filter->renderer())->removeClientRender
Layer(m_layer); | 153 toRenderSVGResourceContainer(filter->renderer())->removeClientRender
Layer(m_layer); |
154 else | 154 else |
155 toSVGFilterElement(filter)->removeClient(m_layer->renderer()->node()
); | 155 toSVGFilterElement(filter)->removeClient(m_layer->renderer()->node()
); |
156 } | 156 } |
157 m_internalSVGReferences.clear(); | 157 m_internalSVGReferences.clear(); |
158 } | 158 } |
159 | 159 |
160 } // namespace blink | 160 } // namespace blink |
161 | 161 |
OLD | NEW |