Commit 491b1ff4 authored by eric@webkit.org's avatar eric@webkit.org

Reviewed by Simon Fraser.

        Remove the vestigial calculateLocalTransform()
        https://bugs.webkit.org/show_bug.cgi?id=25532

        RenderSVGContainer is now the only render which needs this
        function, but it no longer returns the unused bool.

        calculateLocalTransform() previously was called by the DOM before
        transform updates were part of layout().

        * rendering/RenderForeignObject.cpp:
        (WebCore::RenderForeignObject::layout):
        * rendering/RenderForeignObject.h:
        (WebCore::RenderForeignObject::localTransform):
        * rendering/RenderPath.cpp:
        (WebCore::RenderPath::layout):
        * rendering/RenderPath.h:
        * rendering/RenderSVGContainer.cpp:
        * rendering/RenderSVGContainer.h:
        (WebCore::RenderSVGContainer::calculateLocalTransform):
        * rendering/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::layout):
        * rendering/RenderSVGImage.h:
        * rendering/RenderSVGText.cpp:
        (WebCore::RenderSVGText::layout):
        * rendering/RenderSVGText.h:
        * rendering/RenderSVGTransformableContainer.cpp:
        (WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
        * rendering/RenderSVGTransformableContainer.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent abec5eed
74f2170e3f8aef295cbaf236fd947f41
\ No newline at end of file
d0a84f06b85b6bef6c204269ea8fa63e
\ No newline at end of file
2009-05-03 Eric Seidel <eric@webkit.org>
Reviewed by Simon Fraser.
Remove the vestigial calculateLocalTransform()
https://bugs.webkit.org/show_bug.cgi?id=25532
RenderSVGContainer is now the only render which needs this
function, but it no longer returns the unused bool.
calculateLocalTransform() previously was called by the DOM before
transform updates were part of layout().
* rendering/RenderForeignObject.cpp:
(WebCore::RenderForeignObject::layout):
* rendering/RenderForeignObject.h:
(WebCore::RenderForeignObject::localTransform):
* rendering/RenderPath.cpp:
(WebCore::RenderPath::layout):
* rendering/RenderPath.h:
* rendering/RenderSVGContainer.cpp:
* rendering/RenderSVGContainer.h:
(WebCore::RenderSVGContainer::calculateLocalTransform):
* rendering/RenderSVGImage.cpp:
(WebCore::RenderSVGImage::layout):
* rendering/RenderSVGImage.h:
* rendering/RenderSVGText.cpp:
(WebCore::RenderSVGText::layout):
* rendering/RenderSVGText.h:
* rendering/RenderSVGTransformableContainer.cpp:
(WebCore::RenderSVGTransformableContainer::calculateLocalTransform):
* rendering/RenderSVGTransformableContainer.h:
2009-05-03 Eric Seidel <eric@webkit.org>
Reviewed by Simon Fraser.
......@@ -87,13 +87,6 @@ void RenderForeignObject::computeRectForRepaint(RenderBoxModelObject* repaintCon
RenderBlock::computeRectForRepaint(repaintContainer, rect, fixed);
}
bool RenderForeignObject::calculateLocalTransform()
{
TransformationMatrix oldTransform = m_localTransform;
m_localTransform = static_cast<SVGForeignObjectElement*>(node())->animatedLocalTransform();
return (oldTransform != m_localTransform);
}
TransformationMatrix RenderForeignObject::localToParentTransform() const
{
return localTransform() * translationForAttributes();
......@@ -105,7 +98,7 @@ void RenderForeignObject::layout()
ASSERT(!view()->layoutStateEnabled()); // RenderSVGRoot disables layoutState for the SVG rendering tree.
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
calculateLocalTransform();
m_localTransform = static_cast<SVGForeignObjectElement*>(node())->animatedLocalTransform();
RenderBlock::layout();
repainter.repaintAfterLayout();
......
......@@ -39,8 +39,6 @@ public:
virtual void paint(PaintInfo&, int parentX, int parentY);
virtual TransformationMatrix localToParentTransform() const;
virtual TransformationMatrix localTransform() const { return m_localTransform; }
bool calculateLocalTransform();
virtual void computeRectForRepaint(RenderBoxModelObject* repaintContainer, IntRect&, bool fixed = false);
virtual bool requiresLayer() const { return false; }
......@@ -55,6 +53,8 @@ public:
private:
TransformationMatrix translationForAttributes() const;
virtual TransformationMatrix localTransform() const { return m_localTransform; }
TransformationMatrix m_localTransform;
};
......
......@@ -147,23 +147,15 @@ const Path& RenderPath::path() const
return m_path;
}
bool RenderPath::calculateLocalTransform()
{
TransformationMatrix oldTransform = m_localTransform;
m_localTransform = static_cast<SVGStyledTransformableElement*>(node())->animatedLocalTransform();
return (m_localTransform != oldTransform);
}
void RenderPath::layout()
{
LayoutRepainter repainter(*this, checkForRepaintDuringLayout() && selfNeedsLayout());
calculateLocalTransform();
setPath(static_cast<SVGStyledTransformableElement*>(node())->toPathData());
SVGStyledTransformableElement* element = static_cast<SVGStyledTransformableElement*>(node());
m_localTransform = element->animatedLocalTransform();
setPath(element->toPathData());
repainter.repaintAfterLayout();
setNeedsLayout(false);
}
......
......@@ -64,7 +64,6 @@ public:
FloatRect drawMarkersIfNeeded(GraphicsContext*, const FloatRect&, const Path&) const;
private:
bool calculateLocalTransform();
virtual TransformationMatrix localTransform() const;
mutable Path m_path;
......
......@@ -56,12 +56,6 @@ void RenderSVGContainer::setDrawsContents(bool drawsContents)
m_drawsContents = drawsContents;
}
bool RenderSVGContainer::calculateLocalTransform()
{
// subclasses can override this to add transform support
return false;
}
void RenderSVGContainer::layout()
{
ASSERT(needsLayout());
......
......@@ -57,7 +57,8 @@ public:
virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction);
protected:
virtual bool calculateLocalTransform();
// Allow RenderSVGTransformableContainer to hook in at the right time in layout()
virtual void calculateLocalTransform() { }
// Allow RenderSVGViewportContainer to hook in at the right times in layout(), paint() and nodeAtFloatPoint()
virtual void calcViewport() { }
......
......@@ -126,20 +126,14 @@ void RenderSVGImage::adjustRectsForAspectRatio(FloatRect& destRect, FloatRect& s
}
}
bool RenderSVGImage::calculateLocalTransform()
{
TransformationMatrix oldTransform = m_localTransform;
m_localTransform = static_cast<SVGStyledTransformableElement*>(node())->animatedLocalTransform();
return (m_localTransform != oldTransform);
}
void RenderSVGImage::layout()
{
ASSERT(needsLayout());
LayoutRepainter repainter(*this, checkForRepaintDuringLayout());
calculateLocalTransform();
SVGImageElement* image = static_cast<SVGImageElement*>(node());
m_localTransform = image->animatedLocalTransform();
// minimum height
setHeight(errorOccurred() ? intrinsicSize().height() : 0);
......@@ -147,7 +141,6 @@ void RenderSVGImage::layout()
calcWidth();
calcHeight();
SVGImageElement* image = static_cast<SVGImageElement*>(node());
m_localBounds = FloatRect(image->x().value(image), image->y().value(image), image->width().value(image), image->height().value(image));
repainter.repaintAfterLayout();
......@@ -181,7 +174,10 @@ void RenderSVGImage::paint(PaintInfo& paintInfo, int, int)
finishRenderSVGContent(this, paintInfo, m_localBounds, filter, savedInfo.context);
}
if ((paintInfo.phase == PaintPhaseOutline || paintInfo.phase == PaintPhaseSelfOutline) && style()->outlineWidth())
paintOutline(paintInfo.context, 0, 0, width(), height(), style());
paintInfo.context->restore();
}
......
......@@ -69,7 +69,6 @@ namespace WebCore {
virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
private:
bool calculateLocalTransform();
virtual TransformationMatrix localTransform() const { return m_localTransform; }
TransformationMatrix m_localTransform;
......
......@@ -66,17 +66,10 @@ void RenderSVGText::mapLocalToContainer(RenderBoxModelObject* repaintContainer,
SVGRenderBase::mapLocalToContainer(this, repaintContainer, fixed, useTransforms, transformState);
}
bool RenderSVGText::calculateLocalTransform()
{
TransformationMatrix oldTransform = m_localTransform;
m_localTransform = static_cast<SVGTextElement*>(node())->animatedLocalTransform();
return (oldTransform != m_localTransform);
}
void RenderSVGText::layout()
{
ASSERT(needsLayout());
// FIXME: This is a hack to avoid the RenderBlock::layout() partial repainting code which is not (yet) SVG aware
setNeedsLayout(true);
......@@ -88,8 +81,8 @@ void RenderSVGText::layout()
int xOffset = (int)(text->x()->getFirst().value(text));
int yOffset = (int)(text->y()->getFirst().value(text));
setLocation(xOffset, yOffset);
calculateLocalTransform();
m_localTransform = text->animatedLocalTransform();
RenderBlock::layout();
......
......@@ -62,8 +62,6 @@ public:
virtual FloatRect repaintRectInLocalCoordinates() const;
private:
bool calculateLocalTransform();
// FIXME: This can be removed when localTransform() is removed from RenderObject
virtual TransformationMatrix localTransform() const { return m_localTransform; }
......
......@@ -44,11 +44,9 @@ TransformationMatrix RenderSVGTransformableContainer::localTransform() const
return m_localTransform;
}
bool RenderSVGTransformableContainer::calculateLocalTransform()
void RenderSVGTransformableContainer::calculateLocalTransform()
{
TransformationMatrix oldTransform = m_localTransform;
m_localTransform = static_cast<SVGStyledTransformableElement*>(node())->animatedLocalTransform();
return (m_localTransform != oldTransform);
}
}
......
......@@ -33,11 +33,11 @@ namespace WebCore {
virtual TransformationMatrix localToParentTransform() const;
virtual bool calculateLocalTransform();
private:
virtual void calculateLocalTransform();
// FIXME: This can be made non-virtual once SVGRenderTreeAsText stops using localTransform()
virtual TransformationMatrix localTransform() const;
private:
TransformationMatrix m_localTransform;
};
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment