Changeset 156952 in webkit


Ignore:
Timestamp:
Oct 5, 2013 4:58:30 AM (10 years ago)
Author:
Antti Koivisto
Message:

Move paint() to RenderElement
https://bugs.webkit.org/show_bug.cgi?id=122371

Reviewed by Darin Adler.

RenderText does not paint itself (text is painted by line boxes). We can move paint() down
to RenderElement.

This also requires some type tightening elsewhere in the code.

Location:
trunk/Source/WebCore
Files:
34 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r156950 r156952  
     12013-10-04  Antti Koivisto  <antti@apple.com>
     2
     3        Move paint() to RenderElement
     4        https://bugs.webkit.org/show_bug.cgi?id=122371
     5
     6        Reviewed by Darin Adler.
     7
     8        RenderText does not paint itself (text is painted by line boxes). We can move paint() down
     9        to RenderElement.
     10       
     11        This also requires some type tightening elsewhere in the code.
     12
    1132013-10-04  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebCore/rendering/InlineBox.cpp

    r156608 r156952  
    227227void InlineBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /* lineTop */, LayoutUnit /*lineBottom*/)
    228228{
    229     if (!paintInfo.shouldPaintWithinRoot(&renderer()) || (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection))
     229    RenderElement& renderer = toRenderElement(this->renderer());
     230    if (!paintInfo.shouldPaintWithinRoot(renderer) || (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseSelection))
    230231        return;
    231232
    232233    LayoutPoint childPoint = paintOffset;
    233     if (parent()->renderer().style()->isFlippedBlocksWritingMode() && renderer().isBox()) // Faster than calling containingBlock().
    234         childPoint = m_renderer.containingBlock()->flipForWritingModeForChild(&toRenderBox(renderer()), childPoint);
     234    if (parent()->renderer().style()->isFlippedBlocksWritingMode() && renderer.isBox()) // Faster than calling containingBlock().
     235        childPoint = m_renderer.containingBlock()->flipForWritingModeForChild(&toRenderBox(renderer), childPoint);
    235236   
    236237    // Paint all phases of replaced elements atomically, as though the replaced element established its
     
    240241    PaintInfo info(paintInfo);
    241242    info.phase = preservePhase ? paintInfo.phase : PaintPhaseBlockBackground;
    242     m_renderer.paint(info, childPoint);
     243    renderer.paint(info, childPoint);
    243244    if (!preservePhase) {
    244245        info.phase = PaintPhaseChildBlockBackgrounds;
    245         m_renderer.paint(info, childPoint);
     246        renderer.paint(info, childPoint);
    246247        info.phase = PaintPhaseFloat;
    247         m_renderer.paint(info, childPoint);
     248        renderer.paint(info, childPoint);
    248249        info.phase = PaintPhaseForeground;
    249         m_renderer.paint(info, childPoint);
     250        renderer.paint(info, childPoint);
    250251        info.phase = PaintPhaseOutline;
    251         m_renderer.paint(info, childPoint);
     252        renderer.paint(info, childPoint);
    252253    }
    253254}
  • trunk/Source/WebCore/rendering/InlineBox.h

    r156682 r156952  
    182182    InlineBox* prevLeafChildIgnoringLineBreak() const;
    183183
     184    // FIXME: There should be a subclass that returns RenderElement. Plain InlineBox shouldn't be instantiated.
    184185    RenderObject& renderer() const { return m_renderer; }
    185186
  • trunk/Source/WebCore/rendering/InlineFlowBox.cpp

    r156618 r156952  
    12991299void InlineFlowBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    13001300{
    1301     if (!paintInfo.shouldPaintWithinRoot(&renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
     1301    if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
    13021302        return;
    13031303
     
    13731373void InlineFlowBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    13741374{
    1375     if (!paintInfo.shouldPaintWithinRoot(&renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
     1375    if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask)
    13761376        return;
    13771377
  • trunk/Source/WebCore/rendering/InlineTextBox.cpp

    r156613 r156952  
    519519void InlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit /*lineTop*/, LayoutUnit /*lineBottom*/)
    520520{
    521     if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(&renderer()) || renderer().style()->visibility() != VISIBLE ||
    522         m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline || !m_len)
     521    if (isLineBreak() || !paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE
     522        || m_truncation == cFullTruncation || paintInfo.phase == PaintPhaseOutline || !m_len)
    523523        return;
    524524
  • trunk/Source/WebCore/rendering/PaintInfo.h

    r156622 r156952  
    8181    }
    8282
    83     bool shouldPaintWithinRoot(const RenderObject* renderer) const
     83    bool shouldPaintWithinRoot(const RenderObject& renderer) const
    8484    {
    85         return !subtreePaintRoot || subtreePaintRoot == renderer;
     85        return !subtreePaintRoot || subtreePaintRoot == &renderer;
    8686    }
    8787
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r156876 r156952  
    22362236    // z-index.  We paint after we painted the background/border, so that the scrollbars will
    22372237    // sit above the background/border.
    2238     if (hasOverflowClip() && style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(this) && !paintInfo.paintRootBackgroundOnly())
     2238    if (hasOverflowClip() && style()->visibility() == VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBlockBackground) && paintInfo.shouldPaintWithinRoot(*this) && !paintInfo.paintRootBackgroundOnly())
    22392239        layer()->paintOverflowControls(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
    22402240}
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r156905 r156952  
    10951095// --------------------- painting stuff -------------------------------
    10961096
    1097 void RenderBox::paint(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    1098 {
    1099     LayoutPoint adjustedPaintOffset = paintOffset + location();
    1100     // default implementation. Just pass paint through to the children
    1101     PaintInfo childInfo(paintInfo);
    1102     childInfo.updateSubtreePaintRootForChildren(this);
    1103     for (RenderObject* child = firstChild(); child; child = child->nextSibling())
    1104         child->paint(childInfo, adjustedPaintOffset);
    1105 }
    1106 
    11071097void RenderBox::paintRootBoxFillLayers(const PaintInfo& paintInfo)
    11081098{
     
    11551145void RenderBox::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    11561146{
    1157     if (!paintInfo.shouldPaintWithinRoot(this))
     1147    if (!paintInfo.shouldPaintWithinRoot(*this))
    11581148        return;
    11591149
     
    13761366void RenderBox::paintMask(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    13771367{
    1378     if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled())
     1368    if (!paintInfo.shouldPaintWithinRoot(*this) || style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseMask || paintInfo.context->paintingDisabled())
    13791369        return;
    13801370
  • trunk/Source/WebCore/rendering/RenderBox.h

    r156905 r156952  
    298298
    299299    virtual void layout();
    300     virtual void paint(PaintInfo&, const LayoutPoint&);
    301300    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) OVERRIDE;
    302301
  • trunk/Source/WebCore/rendering/RenderElement.h

    r156876 r156952  
    8888    void setNeedsSimplifiedNormalFlowLayout();
    8989
     90    virtual void paint(PaintInfo&, const LayoutPoint&) = 0;
     91
    9092    // Return the renderer whose background style is used to paint the root background. Should only be called on the renderer for which isRoot() is true.
    9193    RenderElement* rendererForRootBackground();
  • trunk/Source/WebCore/rendering/RenderFieldset.cpp

    r156876 r156952  
    139139void RenderFieldset::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    140140{
    141     if (!paintInfo.shouldPaintWithinRoot(this))
     141    if (!paintInfo.shouldPaintWithinRoot(*this))
    142142        return;
    143143
  • trunk/Source/WebCore/rendering/RenderFrameSet.cpp

    r156876 r156952  
    141141        LayoutUnit xPos = 0;
    142142        for (size_t c = 0; c < cols; c++) {
    143             child->paint(paintInfo, adjustedPaintOffset);
     143            toRenderElement(child)->paint(paintInfo, adjustedPaintOffset);
    144144            xPos += m_cols.m_sizes[c];
    145145            if (borderThickness && m_cols.m_allowBorder[c + 1]) {
  • trunk/Source/WebCore/rendering/RenderLineBreak.h

    r156278 r156952  
    5656
    5757    virtual bool canHaveChildren() const OVERRIDE { return false; }
     58    virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { }
    5859
    5960    virtual VisiblePosition positionForPoint(const LayoutPoint&) OVERRIDE;
  • trunk/Source/WebCore/rendering/RenderObject.cpp

    r156904 r156952  
    12391239}
    12401240
    1241 void RenderObject::paint(PaintInfo&, const LayoutPoint&)
    1242 {
    1243 }
    1244 
    12451241RenderLayerModelObject* RenderObject::containerForRepaint() const
    12461242{
  • trunk/Source/WebCore/rendering/RenderObject.h

    r156904 r156952  
    653653    void setHasTransform(bool b = true) { m_bitfields.setHasTransform(b); }
    654654    void setHasReflection(bool b = true) { m_bitfields.setHasReflection(b); }
    655 
    656     virtual void paint(PaintInfo&, const LayoutPoint&);
    657655
    658656    // Recursive function that computes the size and position of this object and all its descendants.
  • trunk/Source/WebCore/rendering/RenderReplaced.cpp

    r156876 r156952  
    130130        return;
    131131   
    132     if (!paintInfo.shouldPaintWithinRoot(this))
     132    if (!paintInfo.shouldPaintWithinRoot(*this))
    133133        return;
    134134   
     
    177177        return false;
    178178
    179     if (!paintInfo.shouldPaintWithinRoot(this))
     179    if (!paintInfo.shouldPaintWithinRoot(*this))
    180180        return false;
    181181       
  • trunk/Source/WebCore/rendering/RenderTable.cpp

    r156876 r156952  
    652652
    653653    for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
    654         if (child->isBox() && !toRenderBox(child)->hasSelfPaintingLayer() && (child->isTableSection() || child->isTableCaption())) {
    655             LayoutPoint childPoint = flipForWritingModeForChild(toRenderBox(child), paintOffset);
    656             child->paint(info, childPoint);
     654        if (!child->isBox())
     655            continue;
     656        RenderBox& box = toRenderBox(*child);
     657        if (!box.hasSelfPaintingLayer() && (box.isTableSection() || box.isTableCaption())) {
     658            LayoutPoint childPoint = flipForWritingModeForChild(&box, paintOffset);
     659            box.paint(info, childPoint);
    657660        }
    658661    }
     
    698701void RenderTable::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    699702{
    700     if (!paintInfo.shouldPaintWithinRoot(this))
     703    if (!paintInfo.shouldPaintWithinRoot(*this))
    701704        return;
    702705
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r156876 r156952  
    11571157    ASSERT(paintInfo.phase == PaintPhaseCollapsedTableBorders);
    11581158
    1159     if (!paintInfo.shouldPaintWithinRoot(this) || style()->visibility() != VISIBLE)
     1159    if (!paintInfo.shouldPaintWithinRoot(*this) || style()->visibility() != VISIBLE)
    11601160        return;
    11611161
     
    12671267void RenderTableCell::paintBackgroundsBehindCell(PaintInfo& paintInfo, const LayoutPoint& paintOffset, RenderElement* backgroundObject)
    12681268{
    1269     if (!paintInfo.shouldPaintWithinRoot(this))
     1269    if (!paintInfo.shouldPaintWithinRoot(*this))
    12701270        return;
    12711271
     
    13031303void RenderTableCell::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
    13041304{
    1305     if (!paintInfo.shouldPaintWithinRoot(this))
     1305    if (!paintInfo.shouldPaintWithinRoot(*this))
    13061306        return;
    13071307
  • trunk/Source/WebCore/rendering/RenderTableCol.h

    r156278 r156952  
    8989
    9090    virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
     91    virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE { }
    9192
    9293    RenderTable* table() const;
  • trunk/Source/WebCore/rendering/RenderText.h

    r156657 r156952  
    172172    virtual unsigned length() const OVERRIDE FINAL { return textLength(); }
    173173
    174     virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { ASSERT_NOT_REACHED(); }
    175174    virtual void layout() OVERRIDE FINAL { ASSERT_NOT_REACHED(); }
    176175    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation&, const LayoutPoint&, HitTestAction) OVERRIDE FINAL { ASSERT_NOT_REACHED(); return false; }
  • trunk/Source/WebCore/rendering/RenderView.cpp

    r156876 r156952  
    439439
    440440    // This avoids painting garbage between columns if there is a column gap.
    441     if (frameView().pagination().mode != Pagination::Unpaginated && paintInfo.shouldPaintWithinRoot(this))
     441    if (frameView().pagination().mode != Pagination::Unpaginated && paintInfo.shouldPaintWithinRoot(*this))
    442442        paintInfo.context->fillRect(paintInfo.rect, frameView().baseBackgroundColor(), ColorSpaceDeviceRGB);
    443443
     
    473473void RenderView::paintBoxDecorations(PaintInfo& paintInfo, const LayoutPoint&)
    474474{
    475     if (!paintInfo.shouldPaintWithinRoot(this))
     475    if (!paintInfo.shouldPaintWithinRoot(*this))
    476476        return;
    477477
  • trunk/Source/WebCore/rendering/RootInlineBox.cpp

    r156608 r156952  
    170170void RootInlineBox::paintEllipsisBox(PaintInfo& paintInfo, const LayoutPoint& paintOffset, LayoutUnit lineTop, LayoutUnit lineBottom) const
    171171{
    172     if (hasEllipsisBox() && paintInfo.shouldPaintWithinRoot(&renderer()) && renderer().style()->visibility() == VISIBLE
     172    if (hasEllipsisBox() && paintInfo.shouldPaintWithinRoot(renderer()) && renderer().style()->visibility() == VISIBLE
    173173            && paintInfo.phase == PaintPhaseForeground)
    174174        ellipsisBox()->paint(paintInfo, paintOffset, lineTop, lineBottom);
     
    191191void RootInlineBox::paintCustomHighlight(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const AtomicString& highlightType)
    192192{
    193     if (!paintInfo.shouldPaintWithinRoot(&renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
     193    if (!paintInfo.shouldPaintWithinRoot(renderer()) || renderer().style()->visibility() != VISIBLE || paintInfo.phase != PaintPhaseForeground)
    194194        return;
    195195
  • trunk/Source/WebCore/rendering/svg/RenderSVGContainer.cpp

    r156876 r156952  
    140140        if (continueRendering) {
    141141            childPaintInfo.updateSubtreePaintRootForChildren(this);
    142             for (RenderObject* child = firstChild(); child; child = child->nextSibling())
    143                 child->paint(childPaintInfo, IntPoint());
     142            for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
     143                if (!child->isRenderElement())
     144                    continue;
     145                toRenderElement(child)->paint(childPaintInfo, IntPoint());
     146            }
    144147        }
    145148    }
  • trunk/Source/WebCore/rendering/svg/RenderSVGGradientStop.h

    r156278 r156952  
    5555private:
    5656    virtual bool canHaveChildren() const OVERRIDE { return false; }
     57    virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE FINAL { }
    5758
    5859    SVGGradientElement* gradientElement() const;
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp

    r155755 r156952  
    2727
    2828#include "AffineTransform.h"
     29#include "ElementIterator.h"
    2930#include "FloatRect.h"
    3031#include "Frame.h"
     
    221222
    222223    // Draw all clipPath children into a global mask.
    223     for (Node* childNode = clipPathElement().firstChild(); childNode; childNode = childNode->nextSibling()) {
    224         RenderObject* renderer = childNode->renderer();
    225         if (!childNode->isSVGElement() || !renderer)
     224    auto children = childrenOfType<SVGElement>(&clipPathElement());
     225    for (auto it = children.begin(), end = children.end(); it != end; ++it) {
     226        SVGElement& child = *it;
     227        auto renderer = child.renderer();
     228        if (!renderer)
    226229            continue;
    227230        if (renderer->needsLayout()) {
     
    234237
    235238        WindRule newClipRule = style->svgStyle()->clipRule();
    236         bool isUseElement = childNode->hasTagName(SVGNames::useTag);
     239        bool isUseElement = child.hasTagName(SVGNames::useTag);
    237240        if (isUseElement) {
    238             SVGUseElement* useElement = toSVGUseElement(childNode);
    239             renderer = useElement->rendererClipChild();
     241            SVGUseElement& useElement = toSVGUseElement(child);
     242            renderer = useElement.rendererClipChild();
    240243            if (!renderer)
    241244                continue;
    242             if (!useElement->hasAttribute(SVGNames::clip_ruleAttr))
     245            if (!useElement.hasAttribute(SVGNames::clip_ruleAttr))
    243246                newClipRule = renderer->style()->svgStyle()->clipRule();
    244247        }
     
    253256        // We have to pass the <use> renderer itself to renderSubtreeToImageBuffer() to apply it's x/y/transform/etc. values when rendering.
    254257        // So if isUseElement is true, refetch the childNode->renderer(), as renderer got overriden above.
    255         SVGRenderingContext::renderSubtreeToImageBuffer(clipperData->clipMaskImage.get(), isUseElement ? childNode->renderer() : renderer, maskContentTransformation);
     258        SVGRenderingContext::renderSubtreeToImageBuffer(clipperData->clipMaskImage.get(), isUseElement ? *child.renderer() : *renderer, maskContentTransformation);
    256259    }
    257260
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourceMasker.cpp

    r155755 r156952  
    2525#include "AffineTransform.h"
    2626#include "Element.h"
     27#include "ElementIterator.h"
    2728#include "FloatPoint.h"
    2829#include "FloatRect.h"
     
    119120
    120121    // Draw the content into the ImageBuffer.
    121     for (Node* node = maskElement().firstChild(); node; node = node->nextSibling()) {
    122         RenderObject* renderer = node->renderer();
    123         if (!node->isSVGElement() || !renderer)
     122    auto children = childrenOfType<SVGElement>(&maskElement());
     123    for (auto it = children.begin(), end = children.end(); it != end; ++it) {
     124        SVGElement& child = *it;
     125        auto renderer = child.renderer();
     126        if (!renderer)
    124127            continue;
    125128        if (renderer->needsLayout())
     
    128131        if (!style || style->display() == NONE || style->visibility() != VISIBLE)
    129132            continue;
    130         SVGRenderingContext::renderSubtreeToImageBuffer(maskerData->maskImage.get(), renderer, maskContentTransformation);
     133        SVGRenderingContext::renderSubtreeToImageBuffer(maskerData->maskImage.get(), *renderer, maskContentTransformation);
    131134    }
    132135
  • trunk/Source/WebCore/rendering/svg/RenderSVGResourcePattern.cpp

    r155755 r156952  
    2424#include "RenderSVGResourcePattern.h"
    2525
     26#include "ElementIterator.h"
    2627#include "FrameView.h"
    2728#include "GraphicsContext.h"
     
    272273
    273274    // Draw the content into the ImageBuffer.
    274     for (Node* node = attributes.patternContentElement()->firstChild(); node; node = node->nextSibling()) {
    275         if (!node->isSVGElement() || !node->renderer())
     275    auto children = childrenOfType<SVGElement>(attributes.patternContentElement());
     276    for (auto it = children.begin(), end = children.end(); it != end; ++it) {
     277        const SVGElement& child = *it;
     278        auto renderer = child.renderer();
     279        if (!renderer)
    276280            continue;
    277         if (node->renderer()->needsLayout())
     281        if (renderer->needsLayout())
    278282            return nullptr;
    279         SVGRenderingContext::renderSubtreeToImageBuffer(tileImage.get(), node->renderer(), contentTransformation);
     283        SVGRenderingContext::renderSubtreeToImageBuffer(tileImage.get(), *renderer, contentTransformation);
    280284    }
    281285
  • trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp

    r156876 r156952  
    292292        }
    293293
    294         if (continueRendering)
    295             RenderBox::paint(childPaintInfo, LayoutPoint());
     294        if (continueRendering) {
     295            childPaintInfo.updateSubtreePaintRootForChildren(this);
     296            for (RenderObject* child = firstChild(); child; child = child->nextSibling()) {
     297                // FIXME: Can this ever have RenderText children?
     298                if (!child->isRenderElement())
     299                    continue;
     300                toRenderElement(child)->paint(childPaintInfo, location());
     301            }
     302        }
    296303    }
    297304
  • trunk/Source/WebCore/rendering/svg/SVGInlineTextBox.cpp

    r156094 r156952  
    178178void SVGInlineTextBox::paintSelectionBackground(PaintInfo& paintInfo)
    179179{
    180     ASSERT(paintInfo.shouldPaintWithinRoot(&renderer()));
     180    ASSERT(paintInfo.shouldPaintWithinRoot(renderer()));
    181181    ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
    182182    ASSERT(truncation() == cNoTruncation);
     
    243243void SVGInlineTextBox::paint(PaintInfo& paintInfo, const LayoutPoint&, LayoutUnit, LayoutUnit)
    244244{
    245     ASSERT(paintInfo.shouldPaintWithinRoot(&renderer()));
     245    ASSERT(paintInfo.shouldPaintWithinRoot(renderer()));
    246246    ASSERT(paintInfo.phase == PaintPhaseForeground || paintInfo.phase == PaintPhaseSelection);
    247247    ASSERT(truncation() == cNoTruncation);
  • trunk/Source/WebCore/rendering/svg/SVGRenderingContext.cpp

    r154856 r156952  
    275275}
    276276
    277 void SVGRenderingContext::renderSubtreeToImageBuffer(ImageBuffer* image, RenderObject* item, const AffineTransform& subtreeContentTransformation)
    278 {
    279     ASSERT(item);
     277void SVGRenderingContext::renderSubtreeToImageBuffer(ImageBuffer* image, RenderElement& item, const AffineTransform& subtreeContentTransformation)
     278{
    280279    ASSERT(image);
    281280    ASSERT(image->context());
     
    287286    contentTransformation = subtreeContentTransformation * contentTransformation;
    288287
    289     ASSERT(!item->needsLayout());
    290     item->paint(info, IntPoint());
     288    ASSERT(!item.needsLayout());
     289    item.paint(info, IntPoint());
    291290
    292291    contentTransformation = savedContentTransformation;
  • trunk/Source/WebCore/rendering/svg/SVGRenderingContext.h

    r147348 r156952  
    3333
    3434class AffineTransform;
     35class RenderElement;
    3536class RenderObject;
    3637class FloatRect;
     
    8081    static bool createImageBufferForPattern(const FloatRect& absoluteTargetRect, const FloatRect& clampedAbsoluteTargetRect, OwnPtr<ImageBuffer>&, ColorSpace, RenderingMode);
    8182
    82     static void renderSubtreeToImageBuffer(ImageBuffer*, RenderObject*, const AffineTransform&);
     83    static void renderSubtreeToImageBuffer(ImageBuffer*, RenderElement&, const AffineTransform&);
    8384    static void clipToImageBuffer(GraphicsContext*, const AffineTransform& absoluteTransform, const FloatRect& targetRect, OwnPtr<ImageBuffer>&, bool safeToClear);
    8485
  • trunk/Source/WebCore/svg/SVGUseElement.cpp

    r156903 r156952  
    571571}
    572572
    573 RenderObject* SVGUseElement::rendererClipChild() const
     573RenderElement* SVGUseElement::rendererClipChild() const
    574574{
    575575    Node* n = m_targetElementInstance ? m_targetElementInstance->shadowTreeElement() : 0;
  • trunk/Source/WebCore/svg/SVGUseElement.h

    r156903 r156952  
    5252    void invalidateDependentShadowTrees();
    5353
    54     RenderObject* rendererClipChild() const;
     54    RenderElement* rendererClipChild() const;
    5555
    5656private:
  • trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp

    r156408 r156952  
    9797void FEImage::platformApplySoftware()
    9898{
    99     RenderObject* renderer = referencedRenderer();
     99    RenderElement* renderer = referencedRenderer();
    100100    if (!m_image && !renderer)
    101101        return;
     
    126126        resultImage->context()->concatCTM(absoluteTransform);
    127127
    128         SVGElement* contextNode = toSVGElement(renderer->node());
     128        SVGElement* contextNode = toSVGElement(renderer->element());
    129129        if (contextNode->hasRelativeLengths()) {
    130130            SVGLengthContext lengthContext(contextNode);
     
    139139
    140140        AffineTransform contentTransformation;
    141         SVGRenderingContext::renderSubtreeToImageBuffer(resultImage, renderer, contentTransformation);
     141        SVGRenderingContext::renderSubtreeToImageBuffer(resultImage, *renderer, contentTransformation);
    142142        return;
    143143    }
Note: See TracChangeset for help on using the changeset viewer.