diff options
Diffstat (limited to 'WebCore/rendering/RenderSVGText.cpp')
| -rw-r--r-- | WebCore/rendering/RenderSVGText.cpp | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/WebCore/rendering/RenderSVGText.cpp b/WebCore/rendering/RenderSVGText.cpp index b8b9553..c0c4650 100644 --- a/WebCore/rendering/RenderSVGText.cpp +++ b/WebCore/rendering/RenderSVGText.cpp @@ -38,7 +38,6 @@ #include "RenderSVGRoot.h" #include "SVGLengthList.h" #include "SVGRenderSupport.h" -#include "SVGResourceFilter.h" #include "SVGRootInlineBox.h" #include "SVGTextElement.h" #include "SVGTransformList.h" @@ -49,6 +48,7 @@ namespace WebCore { RenderSVGText::RenderSVGText(SVGTextElement* node) : RenderSVGBlock(node) + , m_needsTransformUpdate(true) { } @@ -78,7 +78,10 @@ void RenderSVGText::layout() int yOffset = (int)(text->y()->getFirst().value(text)); setLocation(xOffset, yOffset); - m_localTransform = text->animatedLocalTransform(); + if (m_needsTransformUpdate) { + m_localTransform = text->animatedLocalTransform(); + m_needsTransformUpdate = false; + } RenderBlock::layout(); @@ -128,11 +131,8 @@ void RenderSVGText::absoluteRects(Vector<IntRect>& rects, int, int) // Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard // to spot errors, if there are any using WebInspector. Individually feed them into 'rects'. - for (InlineRunBox* runBox = firstLineBox(); runBox; runBox = runBox->nextLineBox()) { - ASSERT(runBox->isInlineFlowBox()); - - InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox); - for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) { + for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) { + for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) { FloatRect boxRect(box->x(), box->y(), box->width(), box->height()); // FIXME: crawling up the parent chain to map each rect is very inefficient // we should compute the absoluteTransform outside this loop first. @@ -149,11 +149,8 @@ void RenderSVGText::absoluteQuads(Vector<FloatQuad>& quads) // Don't use objectBoundingBox here, as it's unites the selection rects. Makes it hard // to spot errors, if there are any using WebInspector. Individually feed them into 'rects'. - for (InlineRunBox* runBox = firstLineBox(); runBox; runBox = runBox->nextLineBox()) { - ASSERT(runBox->isInlineFlowBox()); - - InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox); - for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) { + for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) { + for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) { FloatRect boxRect(box->x(), box->y(), box->width(), box->height()); // FIXME: crawling up the parent chain to map each quad is very inefficient // we should compute the absoluteTransform outside this loop first. @@ -175,11 +172,8 @@ FloatRect RenderSVGText::objectBoundingBox() const { FloatRect boundingBox; - for (InlineRunBox* runBox = firstLineBox(); runBox; runBox = runBox->nextLineBox()) { - ASSERT(runBox->isInlineFlowBox()); - - InlineFlowBox* flowBox = static_cast<InlineFlowBox*>(runBox); - for (InlineBox* box = flowBox->firstChild(); box; box = box->nextOnLine()) + for (InlineFlowBox* flow = firstLineBox(); flow; flow = flow->nextLineBox()) { + for (InlineBox* box = flow->firstChild(); box; box = box->nextOnLine()) boundingBox.unite(FloatRect(box->x(), box->y(), box->width(), box->height())); } |
