| Index: Source/core/rendering/svg/RenderSVGResource.cpp
|
| diff --git a/Source/core/rendering/svg/RenderSVGResource.cpp b/Source/core/rendering/svg/RenderSVGResource.cpp
|
| index fe48accaef85d15062265fbc3931047cb16961fa..450bb9ec8a88109f6358fa537f556637a36ef0d4 100644
|
| --- a/Source/core/rendering/svg/RenderSVGResource.cpp
|
| +++ b/Source/core/rendering/svg/RenderSVGResource.cpp
|
| @@ -23,9 +23,8 @@
|
| #include "config.h"
|
| #include "core/rendering/svg/RenderSVGResource.h"
|
|
|
| -#include "core/rendering/svg/RenderSVGResourceClipper.h"
|
| -#include "core/rendering/svg/RenderSVGResourceFilter.h"
|
| -#include "core/rendering/svg/RenderSVGResourceMasker.h"
|
| +#include "core/rendering/style/RenderStyle.h"
|
| +#include "core/rendering/svg/RenderSVGResourceContainer.h"
|
| #include "core/rendering/svg/SVGResources.h"
|
| #include "core/rendering/svg/SVGResourcesCache.h"
|
| #include "platform/graphics/GraphicsContext.h"
|
| @@ -190,70 +189,4 @@ SVGPaintDescription RenderSVGResource::requestPaintDescription(const RenderObjec
|
| return requestPaint(renderer, style, resourceMode);
|
| }
|
|
|
| -static inline void removeFromCacheAndInvalidateDependencies(RenderObject* object, bool needsLayout)
|
| -{
|
| - ASSERT(object);
|
| - if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object)) {
|
| - if (RenderSVGResourceFilter* filter = resources->filter())
|
| - filter->removeClientFromCache(object);
|
| -
|
| - if (RenderSVGResourceMasker* masker = resources->masker())
|
| - masker->removeClientFromCache(object);
|
| -
|
| - if (RenderSVGResourceClipper* clipper = resources->clipper())
|
| - clipper->removeClientFromCache(object);
|
| - }
|
| -
|
| - if (!object->node() || !object->node()->isSVGElement())
|
| - return;
|
| - SVGElementSet* dependencies = toSVGElement(object->node())->setOfIncomingReferences();
|
| - if (!dependencies)
|
| - return;
|
| -
|
| - // We allow cycles in SVGDocumentExtensions reference sets in order to avoid expensive
|
| - // reference graph adjustments on changes, so we need to break possible cycles here.
|
| - // This strong reference is safe, as it is guaranteed that this set will be emptied
|
| - // at the end of recursion.
|
| - typedef WillBeHeapHashSet<RawPtrWillBeMember<SVGElement> > SVGElementSet;
|
| - DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<SVGElementSet>, invalidatingDependencies, (adoptPtrWillBeNoop(new SVGElementSet)));
|
| -
|
| - SVGElementSet::iterator end = dependencies->end();
|
| - for (SVGElementSet::iterator it = dependencies->begin(); it != end; ++it) {
|
| - if (RenderObject* renderer = (*it)->renderer()) {
|
| - if (UNLIKELY(!invalidatingDependencies->add(*it).isNewEntry)) {
|
| - // Reference cycle: we are in process of invalidating this dependant.
|
| - continue;
|
| - }
|
| -
|
| - RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer, needsLayout);
|
| - invalidatingDependencies->remove(*it);
|
| - }
|
| - }
|
| -}
|
| -
|
| -void RenderSVGResource::markForLayoutAndParentResourceInvalidation(RenderObject* object, bool needsLayout)
|
| -{
|
| - ASSERT(object);
|
| - ASSERT(object->node());
|
| -
|
| - if (needsLayout && !object->documentBeingDestroyed())
|
| - object->setNeedsLayoutAndFullPaintInvalidation();
|
| -
|
| - removeFromCacheAndInvalidateDependencies(object, needsLayout);
|
| -
|
| - // Invalidate resources in ancestor chain, if needed.
|
| - RenderObject* current = object->parent();
|
| - while (current) {
|
| - removeFromCacheAndInvalidateDependencies(current, needsLayout);
|
| -
|
| - if (current->isSVGResourceContainer()) {
|
| - // This will process the rest of the ancestors.
|
| - toRenderSVGResourceContainer(current)->removeAllClientsFromCache();
|
| - break;
|
| - }
|
| -
|
| - current = current->parent();
|
| - }
|
| -}
|
| -
|
| }
|
|
|