| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 3 * | 3 * |
| 4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
| 8 * | 8 * |
| 9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 13 * | 13 * |
| 14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
| 15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 18 */ | 18 */ |
| 19 | 19 |
| 20 #include "config.h" | 20 #include "config.h" |
| 21 #include "core/rendering/svg/RenderSVGResourceContainer.h" | 21 #include "core/rendering/svg/RenderSVGResourceContainer.h" |
| 22 | 22 |
| 23 #include "core/rendering/RenderLayer.h" | 23 #include "core/layout/Layer.h" |
| 24 #include "core/rendering/svg/RenderSVGResourceClipper.h" | 24 #include "core/rendering/svg/RenderSVGResourceClipper.h" |
| 25 #include "core/rendering/svg/RenderSVGResourceFilter.h" | 25 #include "core/rendering/svg/RenderSVGResourceFilter.h" |
| 26 #include "core/rendering/svg/RenderSVGResourceMasker.h" | 26 #include "core/rendering/svg/RenderSVGResourceMasker.h" |
| 27 #include "core/rendering/svg/SVGResources.h" | 27 #include "core/rendering/svg/SVGResources.h" |
| 28 #include "core/rendering/svg/SVGResourcesCache.h" | 28 #include "core/rendering/svg/SVGResourcesCache.h" |
| 29 | 29 |
| 30 #include "wtf/TemporaryChange.h" | 30 #include "wtf/TemporaryChange.h" |
| 31 | 31 |
| 32 namespace blink { | 32 namespace blink { |
| 33 | 33 |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 RenderSVGResourceContainer::markForLayoutAndParentResourceInvalidation(c
lient, needsLayout); | 124 RenderSVGResourceContainer::markForLayoutAndParentResourceInvalidation(c
lient, needsLayout); |
| 125 } | 125 } |
| 126 | 126 |
| 127 markAllClientLayersForInvalidation(); | 127 markAllClientLayersForInvalidation(); |
| 128 | 128 |
| 129 m_isInvalidating = false; | 129 m_isInvalidating = false; |
| 130 } | 130 } |
| 131 | 131 |
| 132 void RenderSVGResourceContainer::markAllClientLayersForInvalidation() | 132 void RenderSVGResourceContainer::markAllClientLayersForInvalidation() |
| 133 { | 133 { |
| 134 HashSet<RenderLayer*>::iterator layerEnd = m_clientLayers.end(); | 134 HashSet<Layer*>::iterator layerEnd = m_clientLayers.end(); |
| 135 for (HashSet<RenderLayer*>::iterator it = m_clientLayers.begin(); it != laye
rEnd; ++it) | 135 for (HashSet<Layer*>::iterator it = m_clientLayers.begin(); it != layerEnd;
++it) |
| 136 (*it)->filterNeedsPaintInvalidation(); | 136 (*it)->filterNeedsPaintInvalidation(); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void RenderSVGResourceContainer::markClientForInvalidation(RenderObject* client,
InvalidationMode mode) | 139 void RenderSVGResourceContainer::markClientForInvalidation(RenderObject* client,
InvalidationMode mode) |
| 140 { | 140 { |
| 141 ASSERT(client); | 141 ASSERT(client); |
| 142 ASSERT(!m_clients.isEmpty()); | 142 ASSERT(!m_clients.isEmpty()); |
| 143 | 143 |
| 144 switch (mode) { | 144 switch (mode) { |
| 145 case LayoutAndBoundariesInvalidation: | 145 case LayoutAndBoundariesInvalidation: |
| (...skipping 15 matching lines...) Expand all Loading... |
| 161 clearInvalidationMask(); | 161 clearInvalidationMask(); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void RenderSVGResourceContainer::removeClient(RenderObject* client) | 164 void RenderSVGResourceContainer::removeClient(RenderObject* client) |
| 165 { | 165 { |
| 166 ASSERT(client); | 166 ASSERT(client); |
| 167 removeClientFromCache(client, false); | 167 removeClientFromCache(client, false); |
| 168 m_clients.remove(client); | 168 m_clients.remove(client); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void RenderSVGResourceContainer::addClientRenderLayer(Node* node) | 171 void RenderSVGResourceContainer::addClientLayer(Node* node) |
| 172 { | 172 { |
| 173 ASSERT(node); | 173 ASSERT(node); |
| 174 if (!node->renderer() || !node->renderer()->hasLayer()) | 174 if (!node->renderer() || !node->renderer()->hasLayer()) |
| 175 return; | 175 return; |
| 176 m_clientLayers.add(toRenderLayerModelObject(node->renderer())->layer()); | 176 m_clientLayers.add(toLayoutLayerModelObject(node->renderer())->layer()); |
| 177 clearInvalidationMask(); | 177 clearInvalidationMask(); |
| 178 } | 178 } |
| 179 | 179 |
| 180 void RenderSVGResourceContainer::addClientRenderLayer(RenderLayer* client) | 180 void RenderSVGResourceContainer::addClientLayer(Layer* client) |
| 181 { | 181 { |
| 182 ASSERT(client); | 182 ASSERT(client); |
| 183 m_clientLayers.add(client); | 183 m_clientLayers.add(client); |
| 184 clearInvalidationMask(); | 184 clearInvalidationMask(); |
| 185 } | 185 } |
| 186 | 186 |
| 187 void RenderSVGResourceContainer::removeClientRenderLayer(RenderLayer* client) | 187 void RenderSVGResourceContainer::removeClientLayer(Layer* client) |
| 188 { | 188 { |
| 189 ASSERT(client); | 189 ASSERT(client); |
| 190 m_clientLayers.remove(client); | 190 m_clientLayers.remove(client); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void RenderSVGResourceContainer::invalidateCacheAndMarkForLayout(SubtreeLayoutSc
ope* layoutScope) | 193 void RenderSVGResourceContainer::invalidateCacheAndMarkForLayout(SubtreeLayoutSc
ope* layoutScope) |
| 194 { | 194 { |
| 195 if (selfNeedsLayout()) | 195 if (selfNeedsLayout()) |
| 196 return; | 196 return; |
| 197 | 197 |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // This will process the rest of the ancestors. | 290 // This will process the rest of the ancestors. |
| 291 toRenderSVGResourceContainer(current)->removeAllClientsFromCache(); | 291 toRenderSVGResourceContainer(current)->removeAllClientsFromCache(); |
| 292 break; | 292 break; |
| 293 } | 293 } |
| 294 | 294 |
| 295 current = current->parent(); | 295 current = current->parent(); |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 | 298 |
| 299 } | 299 } |
| OLD | NEW |