summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/RenderSVGResourcePattern.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/RenderSVGResourcePattern.cpp')
-rw-r--r--WebCore/rendering/RenderSVGResourcePattern.cpp43
1 files changed, 14 insertions, 29 deletions
diff --git a/WebCore/rendering/RenderSVGResourcePattern.cpp b/WebCore/rendering/RenderSVGResourcePattern.cpp
index a2234c8..902ff02 100644
--- a/WebCore/rendering/RenderSVGResourcePattern.cpp
+++ b/WebCore/rendering/RenderSVGResourcePattern.cpp
@@ -40,43 +40,32 @@ RenderSVGResourcePattern::RenderSVGResourcePattern(SVGPatternElement* node)
RenderSVGResourcePattern::~RenderSVGResourcePattern()
{
- deleteAllValues(m_pattern);
- m_pattern.clear();
-}
-
-void RenderSVGResourcePattern::invalidateClients()
-{
- const HashMap<RenderObject*, PatternData*>::const_iterator end = m_pattern.end();
- for (HashMap<RenderObject*, PatternData*>::const_iterator it = m_pattern.begin(); it != end; ++it)
- markForLayoutAndResourceInvalidation(it->first, false);
+ if (m_pattern.isEmpty())
+ return;
deleteAllValues(m_pattern);
m_pattern.clear();
}
-void RenderSVGResourcePattern::invalidateClient(RenderObject* object)
+void RenderSVGResourcePattern::invalidateClients()
{
- ASSERT(object);
- if (!m_pattern.contains(object))
- return;
+ if (!m_pattern.isEmpty()) {
+ deleteAllValues(m_pattern);
+ m_pattern.clear();
+ }
- delete m_pattern.take(object);
- markForLayoutAndResourceInvalidation(object, false);
+ markAllClientsForInvalidation(RepaintInvalidation);
}
-bool RenderSVGResourcePattern::childElementReferencesResource(const SVGRenderStyle* style, const String& referenceId) const
+void RenderSVGResourcePattern::invalidateClient(RenderObject* client)
{
- if (style->hasFill()) {
- if (style->fillPaint()->matchesTargetURI(referenceId))
- return true;
- }
+ ASSERT(client);
+ ASSERT(client->selfNeedsLayout());
- if (style->hasStroke()) {
- if (style->strokePaint()->matchesTargetURI(referenceId))
- return true;
- }
+ if (m_pattern.contains(client))
+ delete m_pattern.take(client);
- return false;
+ markClientForInvalidation(client, RepaintInvalidation);
}
bool RenderSVGResourcePattern::applyResource(RenderObject* object, RenderStyle* style, GraphicsContext*& context, unsigned short resourceMode)
@@ -244,10 +233,6 @@ PassOwnPtr<ImageBuffer> RenderSVGResourcePattern::createTileImage(PatternData* p
if (!attributes.patternContentElement())
return 0;
- // Early exit, if this resource contains a child which references ourselves.
- if (containsCyclicReference(attributes.patternContentElement()))
- return 0;
-
FloatRect objectBoundingBox = object->objectBoundingBox();
FloatRect patternBoundaries = calculatePatternBoundaries(attributes, objectBoundingBox, patternElement);
AffineTransform patternTransform = attributes.patternTransform();