Changeset 286589 in webkit


Ignore:
Timestamp:
Dec 6, 2021, 11:19:06 PM (4 years ago)
Author:
Said Abou-Hallawa
Message:

[GPU Process] [Filters] Make FilterEffect::externalRepresentation() and its overridable functions work iteratively
https://bugs.webkit.org/show_bug.cgi?id=233893

Reviewed by Cameron McCormack.

Source/WebCore:

This is a step towards removing the inputEffect() from FilterEffect.

-- The enum FliterEffect::RepresentationType is replaced by

FilterRepresentation.

-- CSSFilter calls its functions from left to right to dump their

externalRepresentation.

-- SVGFilter uses its expression to dump its graph of FilterEffects.

-- Since SourceAlpha is a built-in effect it does not need to dump

SourceGraphic as its input.

  • platform/graphics/filters/FEBlend.cpp:

(WebCore::FEBlend::externalRepresentation const):

  • platform/graphics/filters/FEBlend.h:
  • platform/graphics/filters/FEColorMatrix.cpp:

(WebCore::FEColorMatrix::externalRepresentation const):

  • platform/graphics/filters/FEColorMatrix.h:
  • platform/graphics/filters/FEComponentTransfer.cpp:

(WebCore::FEComponentTransfer::externalRepresentation const):

  • platform/graphics/filters/FEComponentTransfer.h:
  • platform/graphics/filters/FEComposite.cpp:

(WebCore::FEComposite::externalRepresentation const):

  • platform/graphics/filters/FEComposite.h:
  • platform/graphics/filters/FEConvolveMatrix.cpp:

(WebCore::FEConvolveMatrix::externalRepresentation const):

  • platform/graphics/filters/FEConvolveMatrix.h:
  • platform/graphics/filters/FEDiffuseLighting.cpp:

(WebCore::FEDiffuseLighting::externalRepresentation const):

  • platform/graphics/filters/FEDiffuseLighting.h:
  • platform/graphics/filters/FEDisplacementMap.cpp:

(WebCore::FEDisplacementMap::externalRepresentation const):

  • platform/graphics/filters/FEDisplacementMap.h:
  • platform/graphics/filters/FEDropShadow.cpp:

(WebCore::FEDropShadow::externalRepresentation const):

  • platform/graphics/filters/FEDropShadow.h:
  • platform/graphics/filters/FEFlood.cpp:

(WebCore::FEFlood::externalRepresentation const):

  • platform/graphics/filters/FEFlood.h:
  • platform/graphics/filters/FEGaussianBlur.cpp:

(WebCore::FEGaussianBlur::externalRepresentation const):

  • platform/graphics/filters/FEGaussianBlur.h:
  • platform/graphics/filters/FEMerge.cpp:

(WebCore::FEMerge::externalRepresentation const):

  • platform/graphics/filters/FEMerge.h:
  • platform/graphics/filters/FEMorphology.cpp:

(WebCore::FEMorphology::externalRepresentation const):

  • platform/graphics/filters/FEMorphology.h:
  • platform/graphics/filters/FEOffset.cpp:

(WebCore::FEOffset::externalRepresentation const):

  • platform/graphics/filters/FEOffset.h:
  • platform/graphics/filters/FESpecularLighting.cpp:

(WebCore::FESpecularLighting::externalRepresentation const):

  • platform/graphics/filters/FESpecularLighting.h:
  • platform/graphics/filters/FETile.cpp:

(WebCore::FETile::externalRepresentation const):

  • platform/graphics/filters/FETile.h:
  • platform/graphics/filters/FETurbulence.cpp:

(WebCore::FETurbulence::externalRepresentation const):

  • platform/graphics/filters/FETurbulence.h:
  • platform/graphics/filters/Filter.h:
  • platform/graphics/filters/FilterEffect.cpp:

(WebCore::FilterEffect::externalRepresentation const):
(WebCore::operator<<):

  • platform/graphics/filters/FilterEffect.h:
  • platform/graphics/filters/FilterFunction.h:
  • platform/graphics/filters/SourceAlpha.cpp:

(WebCore::SourceAlpha::externalRepresentation const):

  • platform/graphics/filters/SourceAlpha.h:
  • platform/graphics/filters/SourceGraphic.cpp:

(WebCore::SourceGraphic::externalRepresentation const):

  • platform/graphics/filters/SourceGraphic.h:
  • rendering/CSSFilter.cpp:

(WebCore::CSSFilter::externalRepresentation const):

  • rendering/CSSFilter.h:
  • rendering/svg/SVGRenderTreeAsText.cpp:

(WebCore::writeSVGResourceContainer):

  • svg/graphics/filters/SVGFEImage.cpp:

(WebCore::FEImage::externalRepresentation const):

  • svg/graphics/filters/SVGFEImage.h:
  • svg/graphics/filters/SVGFilter.cpp:

(WebCore::SVGFilter::externalRepresentation const):

  • svg/graphics/filters/SVGFilter.h:
  • svg/graphics/filters/SVGFilterBuilder.cpp:

(WebCore::effectGeometryFlagsForElement):
(WebCore::SVGFilterBuilder::buildFilterEffects):
(WebCore::SVGFilterBuilder::buildEffectExpression const):
(WebCore::SVGFilterBuilder::buildExpression const):
(WebCore::boundarySetFlagsForElement): Deleted.

  • svg/graphics/filters/SVGFilterBuilder.h:
  • svg/graphics/filters/SVGFilterExpression.h:

LayoutTests:

Add missing closing quotations in the expected results of some of the
filter layout tests.

  • svg/filters/feDropShadow-expected.txt:
  • svg/filters/feDropShadow-subregion-expected.txt:
  • svg/filters/feDropShadow-zero-deviation-expected.txt:
  • svg/repaint/filter-child-repaint-expected.txt:
Location:
trunk
Files:
56 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r286586 r286589  
     12021-12-06  Said Abou-Hallawa  <said@apple.com>
     2
     3        [GPU Process]  [Filters] Make FilterEffect::externalRepresentation() and its overridable functions work iteratively
     4        https://bugs.webkit.org/show_bug.cgi?id=233893
     5
     6        Reviewed by Cameron McCormack.
     7
     8        Add missing closing quotations in the expected results of some of the
     9        filter layout tests.
     10
     11        * svg/filters/feDropShadow-expected.txt:
     12        * svg/filters/feDropShadow-subregion-expected.txt:
     13        * svg/filters/feDropShadow-zero-deviation-expected.txt:
     14        * svg/repaint/filter-child-repaint-expected.txt:
     15
    1162021-12-06  Lauro Moura  <lmoura@igalia.com>
    217
  • trunk/LayoutTests/svg/filters/feDropShadow-expected.txt

    r119860 r286589  
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    66      RenderSVGResourceFilter {filter} [id="drop-shadow-1"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    7         [feDropShadow stdDeviation="2.00, 2.00" dx="2.00" dy="2.00" flood-color="#008000" flood-opacity="1.00]
     7        [feDropShadow stdDeviation="2.00, 2.00" dx="2.00" dy="2.00" flood-color="#008000" flood-opacity="1.00"]
    88          [SourceGraphic]
    99      RenderSVGResourceFilter {filter} [id="drop-shadow-2"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    10         [feDropShadow stdDeviation="0.00, 0.00" dx="0.00" dy="0.00" flood-color="#008000" flood-opacity="1.00]
     10        [feDropShadow stdDeviation="0.00, 0.00" dx="0.00" dy="0.00" flood-color="#008000" flood-opacity="1.00"]
    1111          [SourceGraphic]
    1212      RenderSVGResourceFilter {filter} [id="drop-shadow-3"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    13         [feDropShadow stdDeviation="0.00, 10.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="1.00]
     13        [feDropShadow stdDeviation="0.00, 10.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="1.00"]
    1414          [SourceGraphic]
    1515      RenderSVGResourceFilter {filter} [id="drop-shadow-4"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    16         [feDropShadow stdDeviation="10.00, 0.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="1.00]
     16        [feDropShadow stdDeviation="10.00, 0.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="1.00"]
    1717          [SourceGraphic]
    1818      RenderSVGResourceFilter {filter} [id="drop-shadow-5"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    19         [feDropShadow stdDeviation="10.00, 10.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="1.00]
     19        [feDropShadow stdDeviation="10.00, 10.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="1.00"]
    2020          [SourceGraphic]
    2121      RenderSVGResourceFilter {filter} [id="drop-shadow-6"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    22         [feDropShadow stdDeviation="10.00, 10.00" dx="-5.00" dy="-5.00" flood-color="#008000" flood-opacity="1.00]
     22        [feDropShadow stdDeviation="10.00, 10.00" dx="-5.00" dy="-5.00" flood-color="#008000" flood-opacity="1.00"]
    2323          [SourceGraphic]
    2424      RenderSVGResourceFilter {filter} [id="drop-shadow-7"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    25         [feDropShadow stdDeviation="128.00, 128.00" dx="0.00" dy="0.00" flood-color="#008000" flood-opacity="1.00]
     25        [feDropShadow stdDeviation="128.00, 128.00" dx="0.00" dy="0.00" flood-color="#008000" flood-opacity="1.00"]
    2626          [SourceGraphic]
    2727      RenderSVGResourceFilter {filter} [id="drop-shadow-8"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    28         [feDropShadow stdDeviation="10.00, 10.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="0.50]
     28        [feDropShadow stdDeviation="10.00, 10.00" dx="5.00" dy="5.00" flood-color="#008000" flood-opacity="0.50"]
    2929          [SourceGraphic]
    3030    RenderSVGEllipse {circle} at (0,0) size 159x159 [stroke={[type=SOLID] [color=#0000FF] [stroke width=5.00]}] [fill={[type=SOLID] [color=#FFFF00]}] [cx=75.00] [cy=75.00] [r=70.00]
  • trunk/LayoutTests/svg/filters/feDropShadow-subregion-expected.txt

    r123210 r286589  
    66      RenderSVGResourceFilter {filter} [id="DropShadow"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    77        [feComposite operation="OVER"]
    8           [feDropShadow stdDeviation="10.00, 10.00" dx="10.00" dy="10.00" flood-color="#FF0000" flood-opacity="1.00]
     8          [feDropShadow stdDeviation="10.00, 10.00" dx="10.00" dy="10.00" flood-color="#FF0000" flood-opacity="1.00"]
    99            [SourceGraphic]
    1010          [feOffset dx="10.00" dy="10.00"]
  • trunk/LayoutTests/svg/filters/feDropShadow-zero-deviation-expected.txt

    r158896 r286589  
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    66      RenderSVGResourceFilter {filter} [id="f1"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    7         [feDropShadow stdDeviation="0.00, 1.00" dx="2.00" dy="2.00" flood-color="#000000" flood-opacity="1.00]
     7        [feDropShadow stdDeviation="0.00, 1.00" dx="2.00" dy="2.00" flood-color="#000000" flood-opacity="1.00"]
    88          [SourceGraphic]
    99      RenderSVGResourceFilter {filter} [id="f2"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    10         [feDropShadow stdDeviation="1.00, 0.00" dx="2.00" dy="2.00" flood-color="#000000" flood-opacity="1.00]
     10        [feDropShadow stdDeviation="1.00, 0.00" dx="2.00" dy="2.00" flood-color="#000000" flood-opacity="1.00"]
    1111          [SourceGraphic]
    1212    RenderSVGRect {rect} at (49,19) size 12x12 [fill={[type=SOLID] [color=#008000]}] [x=50.00] [y=20.00] [width=10.00] [height=10.00]
  • trunk/LayoutTests/svg/repaint/filter-child-repaint-expected.txt

    r107417 r286589  
    55    RenderSVGHiddenContainer {defs} at (0,0) size 0x0
    66      RenderSVGResourceFilter {filter} [id="dropShadow"] [filterUnits=objectBoundingBox] [primitiveUnits=userSpaceOnUse]
    7         [feDropShadow stdDeviation="2.00, 2.00" dx="3.00" dy="3.00" flood-color="#000000" flood-opacity="1.00]
     7        [feDropShadow stdDeviation="2.00, 2.00" dx="3.00" dy="3.00" flood-color="#000000" flood-opacity="1.00"]
    88          [SourceGraphic]
    99    RenderSVGContainer {g} at (0,0) size 106x106
  • trunk/Source/WebCore/ChangeLog

    r286588 r286589  
     12021-12-06  Said Abou-Hallawa  <said@apple.com>
     2
     3        [GPU Process]  [Filters] Make FilterEffect::externalRepresentation() and its overridable functions work iteratively
     4        https://bugs.webkit.org/show_bug.cgi?id=233893
     5
     6        Reviewed by Cameron McCormack.
     7
     8        This is a step towards removing the inputEffect() from FilterEffect.
     9
     10        -- The enum FliterEffect::RepresentationType is replaced by
     11           FilterRepresentation.
     12
     13        -- CSSFilter calls its functions from left to right to dump their
     14           externalRepresentation.
     15
     16        -- SVGFilter uses its expression to dump its graph of FilterEffects.
     17
     18        -- Since SourceAlpha is a built-in effect it does not need to dump
     19           SourceGraphic as its input.
     20
     21        * platform/graphics/filters/FEBlend.cpp:
     22        (WebCore::FEBlend::externalRepresentation const):
     23        * platform/graphics/filters/FEBlend.h:
     24        * platform/graphics/filters/FEColorMatrix.cpp:
     25        (WebCore::FEColorMatrix::externalRepresentation const):
     26        * platform/graphics/filters/FEColorMatrix.h:
     27        * platform/graphics/filters/FEComponentTransfer.cpp:
     28        (WebCore::FEComponentTransfer::externalRepresentation const):
     29        * platform/graphics/filters/FEComponentTransfer.h:
     30        * platform/graphics/filters/FEComposite.cpp:
     31        (WebCore::FEComposite::externalRepresentation const):
     32        * platform/graphics/filters/FEComposite.h:
     33        * platform/graphics/filters/FEConvolveMatrix.cpp:
     34        (WebCore::FEConvolveMatrix::externalRepresentation const):
     35        * platform/graphics/filters/FEConvolveMatrix.h:
     36        * platform/graphics/filters/FEDiffuseLighting.cpp:
     37        (WebCore::FEDiffuseLighting::externalRepresentation const):
     38        * platform/graphics/filters/FEDiffuseLighting.h:
     39        * platform/graphics/filters/FEDisplacementMap.cpp:
     40        (WebCore::FEDisplacementMap::externalRepresentation const):
     41        * platform/graphics/filters/FEDisplacementMap.h:
     42        * platform/graphics/filters/FEDropShadow.cpp:
     43        (WebCore::FEDropShadow::externalRepresentation const):
     44        * platform/graphics/filters/FEDropShadow.h:
     45        * platform/graphics/filters/FEFlood.cpp:
     46        (WebCore::FEFlood::externalRepresentation const):
     47        * platform/graphics/filters/FEFlood.h:
     48        * platform/graphics/filters/FEGaussianBlur.cpp:
     49        (WebCore::FEGaussianBlur::externalRepresentation const):
     50        * platform/graphics/filters/FEGaussianBlur.h:
     51        * platform/graphics/filters/FEMerge.cpp:
     52        (WebCore::FEMerge::externalRepresentation const):
     53        * platform/graphics/filters/FEMerge.h:
     54        * platform/graphics/filters/FEMorphology.cpp:
     55        (WebCore::FEMorphology::externalRepresentation const):
     56        * platform/graphics/filters/FEMorphology.h:
     57        * platform/graphics/filters/FEOffset.cpp:
     58        (WebCore::FEOffset::externalRepresentation const):
     59        * platform/graphics/filters/FEOffset.h:
     60        * platform/graphics/filters/FESpecularLighting.cpp:
     61        (WebCore::FESpecularLighting::externalRepresentation const):
     62        * platform/graphics/filters/FESpecularLighting.h:
     63        * platform/graphics/filters/FETile.cpp:
     64        (WebCore::FETile::externalRepresentation const):
     65        * platform/graphics/filters/FETile.h:
     66        * platform/graphics/filters/FETurbulence.cpp:
     67        (WebCore::FETurbulence::externalRepresentation const):
     68        * platform/graphics/filters/FETurbulence.h:
     69        * platform/graphics/filters/Filter.h:
     70        * platform/graphics/filters/FilterEffect.cpp:
     71        (WebCore::FilterEffect::externalRepresentation const):
     72        (WebCore::operator<<):
     73        * platform/graphics/filters/FilterEffect.h:
     74        * platform/graphics/filters/FilterFunction.h:
     75        * platform/graphics/filters/SourceAlpha.cpp:
     76        (WebCore::SourceAlpha::externalRepresentation const):
     77        * platform/graphics/filters/SourceAlpha.h:
     78        * platform/graphics/filters/SourceGraphic.cpp:
     79        (WebCore::SourceGraphic::externalRepresentation const):
     80        * platform/graphics/filters/SourceGraphic.h:
     81        * rendering/CSSFilter.cpp:
     82        (WebCore::CSSFilter::externalRepresentation const):
     83        * rendering/CSSFilter.h:
     84        * rendering/svg/SVGRenderTreeAsText.cpp:
     85        (WebCore::writeSVGResourceContainer):
     86        * svg/graphics/filters/SVGFEImage.cpp:
     87        (WebCore::FEImage::externalRepresentation const):
     88        * svg/graphics/filters/SVGFEImage.h:
     89        * svg/graphics/filters/SVGFilter.cpp:
     90        (WebCore::SVGFilter::externalRepresentation const):
     91        * svg/graphics/filters/SVGFilter.h:
     92        * svg/graphics/filters/SVGFilterBuilder.cpp:
     93        (WebCore::effectGeometryFlagsForElement):
     94        (WebCore::SVGFilterBuilder::buildFilterEffects):
     95        (WebCore::SVGFilterBuilder::buildEffectExpression const):
     96        (WebCore::SVGFilterBuilder::buildExpression const):
     97        (WebCore::boundarySetFlagsForElement): Deleted.
     98        * svg/graphics/filters/SVGFilterBuilder.h:
     99        * svg/graphics/filters/SVGFilterExpression.h:
     100
    11012021-12-06  Patrick Angle  <pangle@apple.com>
    2102
  • trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp

    r286391 r286589  
    5858}
    5959
    60 TextStream& FEBlend::externalRepresentation(TextStream& ts, RepresentationType representation) const
     60TextStream& FEBlend::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    6161{
    6262    ts << indent << "[feBlend";
    6363    FilterEffect::externalRepresentation(ts, representation);
    64     ts << " mode=\"" << (m_mode == BlendMode::Normal ? "normal" : compositeOperatorName(CompositeOperator::SourceOver, m_mode)) << "\"]\n";
    6564
    66     TextStream::IndentScope indentScope(ts);
    67     inputEffect(0)->externalRepresentation(ts, representation);
    68     inputEffect(1)->externalRepresentation(ts, representation);
     65    ts << " mode=\"" << (m_mode == BlendMode::Normal ? "normal" : compositeOperatorName(CompositeOperator::SourceOver, m_mode));
     66
     67    ts << "\"]\n";
    6968    return ts;
    7069}
  • trunk/Source/WebCore/platform/graphics/filters/FEBlend.h

    r286538 r286589  
    4747                           unsigned colorArrayLength);
    4848
    49     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     49    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    5050
    5151    BlendMode m_mode;
  • trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp

    r286287 r286589  
    142142}
    143143
    144 TextStream& FEColorMatrix::externalRepresentation(TextStream& ts, RepresentationType representation) const
     144TextStream& FEColorMatrix::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    145145{
    146146    ts << indent << "[feColorMatrix";
    147147    FilterEffect::externalRepresentation(ts, representation);
     148
    148149    ts << " type=\"" << m_type << "\"";
    149150    if (!m_values.isEmpty()) {
     
    154155            ts << *ptr;
    155156            ++ptr;
    156             if (ptr < end) 
     157            if (ptr < end)
    157158                ts << " ";
    158159        }
    159160        ts << "\"";
    160161    }
     162
    161163    ts << "]\n";
    162    
    163     TextStream::IndentScope indentScope(ts);
    164     inputEffect(0)->externalRepresentation(ts, representation);
    165164    return ts;
    166165}
  • trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h

    r286538 r286589  
    6464    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    6565
    66     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     66    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    6767
    6868    ColorMatrixType m_type;
  • trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp

    r286193 r286589  
    117117}
    118118
    119 TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts, RepresentationType representation) const
     119TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    120120{
    121121    ts << indent << "[feComponentTransfer";
    122122    FilterEffect::externalRepresentation(ts, representation);
    123123    ts << "\n";
     124
    124125    {
    125126        TextStream::IndentScope indentScope(ts, 2);
     
    127128        ts << indent << "{green: " << m_greenFunction << "}\n";
    128129        ts << indent << "{blue: " << m_blueFunction << "}\n";
    129         ts << indent << "{alpha: " << m_alphaFunction << "}]\n";
     130        ts << indent << "{alpha: " << m_alphaFunction << "}";
    130131    }
    131132
    132     TextStream::IndentScope indentScope(ts);
    133     inputEffect(0)->externalRepresentation(ts, representation);
     133    ts << "]\n";
    134134    return ts;
    135135}
  • trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h

    r286538 r286589  
    7575    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    7676
    77     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     77    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    7878
    7979    ComponentTransferFunction m_redFunction;
  • trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp

    r286287 r286589  
    143143}
    144144
    145 TextStream& FEComposite::externalRepresentation(TextStream& ts, RepresentationType representation) const
     145TextStream& FEComposite::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    146146{
    147147    ts << indent << "[feComposite";
    148148    FilterEffect::externalRepresentation(ts, representation);
     149
    149150    ts << " operation=\"" << m_type << "\"";
    150151    if (m_type == FECOMPOSITE_OPERATOR_ARITHMETIC)
    151152        ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\" k4=\"" << m_k4 << "\"";
     153
    152154    ts << "]\n";
    153 
    154     TextStream::IndentScope indentScope(ts);
    155     inputEffect(0)->externalRepresentation(ts, representation);
    156     inputEffect(1)->externalRepresentation(ts, representation);
    157155    return ts;
    158156}
  • trunk/Source/WebCore/platform/graphics/filters/FEComposite.h

    r286538 r286589  
    7070    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    7171
    72     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     72    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    7373
    7474    inline void platformArithmeticSoftware(const Uint8ClampedArray& source, Uint8ClampedArray& destination, float k1, float k2, float k3, float k4);
  • trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp

    r286287 r286589  
    144144}
    145145
    146 TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, RepresentationType representation) const
     146TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    147147{
    148148    ts << indent << "[feConvolveMatrix";
    149149    FilterEffect::externalRepresentation(ts, representation);
    150     ts << " order=\"" << m_kernelSize << "\" "
    151        << "kernelMatrix=\"" << m_kernelMatrix  << "\" "
    152        << "divisor=\"" << m_divisor << "\" "
    153        << "bias=\"" << m_bias << "\" "
    154        << "target=\"" << m_targetOffset << "\" "
    155        << "edgeMode=\"" << m_edgeMode << "\" "
    156        << "kernelUnitLength=\"" << m_kernelUnitLength << "\" "
    157        << "preserveAlpha=\"" << m_preserveAlpha << "\"]\n";
    158150
    159     TextStream::IndentScope indentScope(ts);
    160     inputEffect(0)->externalRepresentation(ts, representation);
     151    ts << " order=\"" << m_kernelSize << "\"";
     152    ts << " kernelMatrix=\"" << m_kernelMatrix  << "\"";
     153    ts << " divisor=\"" << m_divisor << "\"";
     154    ts << " bias=\"" << m_bias << "\"";
     155    ts << " target=\"" << m_targetOffset << "\"";
     156    ts << " edgeMode=\"" << m_edgeMode << "\"";
     157    ts << " kernelUnitLength=\"" << m_kernelUnitLength << "\"";
     158    ts << " preserveAlpha=\"" << m_preserveAlpha << "\"";
     159
     160    ts << "]\n";
    161161    return ts;
    162162}
  • trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h

    r286538 r286589  
    7575    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    7676
    77     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     77    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    7878
    7979    IntSize m_kernelSize;
  • trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp

    r286152 r286589  
    4848}
    4949
    50 TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, RepresentationType representation) const
     50TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    5151{
    5252    ts << indent << "[feDiffuseLighting";
    5353    FilterEffect::externalRepresentation(ts, representation);
    54     ts << " surfaceScale=\"" << m_surfaceScale << "\" "
    55        << "diffuseConstant=\"" << m_diffuseConstant << "\" "
    56        << "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n";
    5754
    58     TextStream::IndentScope indentScope(ts);
    59     inputEffect(0)->externalRepresentation(ts, representation);
     55    ts << " surfaceScale=\"" << m_surfaceScale << "\"";
     56    ts << " diffuseConstant=\"" << m_diffuseConstant << "\"";
     57    ts << " kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"";
     58
     59    ts << "]\n";
    6060    return ts;
    6161}
  • trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h

    r286538 r286589  
    3636    bool setDiffuseConstant(float);
    3737
    38     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     38    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    3939
    4040    template<class Decoder> static std::optional<Ref<FEDiffuseLighting>> decode(Decoder&);
  • trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp

    r286578 r286589  
    117117}
    118118
    119 TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, RepresentationType representation) const
     119TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    120120{
    121121    ts << indent << "[feDisplacementMap";
    122122    FilterEffect::externalRepresentation(ts, representation);
    123     ts << " scale=\"" << m_scale << "\" "
    124        << "xChannelSelector=\"" << m_xChannelSelector << "\" "
    125        << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n";
    126123
    127     TextStream::IndentScope indentScope(ts);
    128     inputEffect(0)->externalRepresentation(ts, representation);
    129     inputEffect(1)->externalRepresentation(ts, representation);
     124    ts << " scale=\"" << m_scale << "\"";
     125    ts << " xChannelSelector=\"" << m_xChannelSelector << "\"";
     126    ts << " yChannelSelector=\"" << m_yChannelSelector << "\"";
     127
     128    ts << "]\n";
    130129    return ts;
    131130}
  • trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h

    r286578 r286589  
    6262    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    6363
    64     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     64    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    6565
    6666    ChannelSelectorType m_xChannelSelector;
  • trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp

    r286287 r286589  
    7878}
    7979   
    80 TextStream& FEDropShadow::externalRepresentation(TextStream& ts, RepresentationType representation) const
     80TextStream& FEDropShadow::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    8181{
    8282    ts << indent <<"[feDropShadow";
    8383    FilterEffect::externalRepresentation(ts, representation);
    84     ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx << "\" dy=\"" << m_dy << "\" flood-color=\"" << serializationForRenderTreeAsText(m_shadowColor) <<"\" flood-opacity=\"" << m_shadowOpacity << "]\n";
    8584
    86     TextStream::IndentScope indentScope(ts);
    87     inputEffect(0)->externalRepresentation(ts, representation);
     85    ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"";
     86    ts << " dx=\"" << m_dx << "\" dy=\"" << m_dy << "\"";
     87    ts << " flood-color=\"" << serializationForRenderTreeAsText(m_shadowColor) << "\"";
     88    ts << " flood-opacity=\"" << m_shadowOpacity << "\"";
     89
     90    ts << "]\n";
    8891    return ts;
    8992}
  • trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h

    r286538 r286589  
    6060    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    6161
    62     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     62    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    6363
    6464    float m_stdX;
  • trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp

    r286287 r286589  
    7070}
    7171
    72 TextStream& FEFlood::externalRepresentation(TextStream& ts, RepresentationType representation) const
     72TextStream& FEFlood::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    7373{
    7474    ts << indent << "[feFlood";
    7575    FilterEffect::externalRepresentation(ts, representation);
    76     ts << " flood-color=\"" << serializationForRenderTreeAsText(floodColor()) << "\" "
    77        << "flood-opacity=\"" << floodOpacity() << "\"]\n";
     76
     77    ts << " flood-color=\"" << serializationForRenderTreeAsText(floodColor()) << "\"";
     78    ts << " flood-opacity=\"" << floodOpacity() << "\"";
     79
     80    ts << "]\n";
    7881    return ts;
    7982}
  • trunk/Source/WebCore/platform/graphics/filters/FEFlood.h

    r286538 r286589  
    5454    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    5555
    56     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     56    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    5757
    5858    Color m_floodColor;
  • trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp

    r286287 r286589  
    137137}
    138138
    139 TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, RepresentationType representation) const
     139TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    140140{
    141141    ts << indent << "[feGaussianBlur";
    142142    FilterEffect::externalRepresentation(ts, representation);
    143     ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n";
    144143
    145     TextStream::IndentScope indentScope(ts);
    146     inputEffect(0)->externalRepresentation(ts, representation);
     144    ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"";
     145
     146    ts << "]\n";
    147147    return ts;
    148148}
  • trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h

    r286538 r286589  
    5959    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    6060
    61     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     61    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    6262
    6363    float m_stdX;
  • trunk/Source/WebCore/platform/graphics/filters/FEMerge.cpp

    r286538 r286589  
    4646}
    4747
    48 TextStream& FEMerge::externalRepresentation(TextStream& ts, RepresentationType representation) const
     48TextStream& FEMerge::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    4949{
    5050    ts << indent << "[feMerge";
    5151    FilterEffect::externalRepresentation(ts, representation);
    52     unsigned size = numberOfEffectInputs();
    53     ASSERT(size > 0);
    54     ts << " mergeNodes=\"" << size << "\"]\n";
    5552
    56     TextStream::IndentScope indentScope(ts);
    57     for (unsigned i = 0; i < size; ++i)
    58         inputEffect(i)->externalRepresentation(ts, representation);
     53    ts << " mergeNodes=\"" << m_numberOfEffectInputs << "\"";
     54
     55    ts << "]\n";
    5956    return ts;
    6057}
  • trunk/Source/WebCore/platform/graphics/filters/FEMerge.h

    r286538 r286589  
    3939    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    4040
    41     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     41    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    4242
    4343    unsigned m_numberOfEffectInputs { 0 };
  • trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp

    r286287 r286589  
    102102}
    103103
    104 TextStream& FEMorphology::externalRepresentation(TextStream& ts, RepresentationType representation) const
     104TextStream& FEMorphology::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    105105{
    106106    ts << indent << "[feMorphology";
    107107    FilterEffect::externalRepresentation(ts, representation);
    108     ts << " operator=\"" << morphologyOperator() << "\" "
    109        << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n";
    110108
    111     TextStream::IndentScope indentScope(ts);
    112     inputEffect(0)->externalRepresentation(ts, representation);
     109    ts << " operator=\"" << morphologyOperator() << "\"";
     110    ts << " radius=\"" << radiusX() << ", " << radiusY() << "\"";
     111
     112    ts << "]\n";
    113113    return ts;
    114114}
  • trunk/Source/WebCore/platform/graphics/filters/FEMorphology.h

    r286538 r286589  
    5858    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    5959
    60     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     60    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    6161
    6262    MorphologyOperatorType m_type;
  • trunk/Source/WebCore/platform/graphics/filters/FEOffset.cpp

    r286287 r286589  
    7171}
    7272
    73 TextStream& FEOffset::externalRepresentation(TextStream& ts, RepresentationType representation) const
     73TextStream& FEOffset::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    7474{
    7575    ts << indent << "[feOffset";
    7676    FilterEffect::externalRepresentation(ts, representation);
    77     ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n";
    7877
    79     TextStream::IndentScope indentScope(ts);
    80     inputEffect(0)->externalRepresentation(ts, representation);
     78    ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"";
     79
     80    ts << "]\n";
    8181    return ts;
    8282}
  • trunk/Source/WebCore/platform/graphics/filters/FEOffset.h

    r286538 r286589  
    4949    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    5050
    51     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     51    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    5252
    5353    float m_dx;
  • trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp

    r286152 r286589  
    5656}
    5757
    58 TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, RepresentationType representation) const
     58TextStream& FESpecularLighting::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    5959{
    6060    ts << indent << "[feSpecularLighting";
    6161    FilterEffect::externalRepresentation(ts, representation);
    62     ts << " surfaceScale=\"" << m_surfaceScale << "\" "
    63        << "specualConstant=\"" << m_specularConstant << "\" "
    64        << "specularExponent=\"" << m_specularExponent << "\"]\n";
     62   
     63    ts << " surfaceScale=\"" << m_surfaceScale << "\"";
     64    ts << " specualConstant=\"" << m_specularConstant << "\"";
     65    ts << " specularExponent=\"" << m_specularExponent << "\"";
    6566
    66     TextStream::IndentScope indentScope(ts);
    67     inputEffect(0)->externalRepresentation(ts, representation);
     67    ts << "]\n";
    6868    return ts;
    6969}
  • trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h

    r286538 r286589  
    3737    bool setSpecularExponent(float);
    3838
    39     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     39    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    4040
    4141    template<class Decoder> static std::optional<Ref<FESpecularLighting>> decode(Decoder&);
  • trunk/Source/WebCore/platform/graphics/filters/FETile.cpp

    r286287 r286589  
    5454}
    5555
    56 TextStream& FETile::externalRepresentation(TextStream& ts, RepresentationType representation) const
     56TextStream& FETile::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    5757{
    5858    ts << indent << "[feTile";
    5959    FilterEffect::externalRepresentation(ts, representation);
    6060    ts << "]\n";
    61 
    62     TextStream::IndentScope indentScope(ts);
    63     inputEffect(0)->externalRepresentation(ts, representation);
    64 
    6561    return ts;
    6662}
  • trunk/Source/WebCore/platform/graphics/filters/FETile.h

    r286538 r286589  
    4040    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    4141
    42     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     42    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    4343};
    4444
  • trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp

    r286287 r286589  
    123123}
    124124
    125 TextStream& FETurbulence::externalRepresentation(TextStream& ts, RepresentationType representation) const
     125TextStream& FETurbulence::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    126126{
    127127    ts << indent << "[feTurbulence";
    128128    FilterEffect::externalRepresentation(ts, representation);
    129     ts << " type=\"" << type() << "\" "
    130        << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" "
    131        << "seed=\"" << seed() << "\" "
    132        << "numOctaves=\"" << numOctaves() << "\" "
    133        << "stitchTiles=\"" << stitchTiles() << "\"]\n";
     129   
     130    ts << " type=\"" << type() << "\"";
     131    ts << " baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\"";
     132    ts << " seed=\"" << seed() << "\"";
     133    ts << " numOctaves=\"" << numOctaves() << "\"";
     134    ts << " stitchTiles=\"" << stitchTiles() << "\"";
     135
     136    ts << "]\n";
    134137    return ts;
    135138}
  • trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h

    r286538 r286589  
    6868    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    6969
    70     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     70    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    7171
    7272    TurbulenceType m_type;
  • trunk/Source/WebCore/platform/graphics/filters/Filter.h

    r286578 r286589  
    2222#pragma once
    2323
    24 #include "FilterEffectGeometry.h"
    2524#include "FilterFunction.h"
    2625#include "FloatRect.h"
  • trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp

    r286578 r286589  
    162162}
    163163
    164 TextStream& FilterEffect::externalRepresentation(TextStream& ts, RepresentationType representationType) const
     164TextStream& FilterEffect::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    165165{
    166166    // FIXME: We should dump the subRegions of the filter primitives here later. This isn't
    167167    // possible at the moment, because we need more detailed informations from the target object.
    168168   
    169     if (representationType == RepresentationType::Debugging) {
     169    if (representation == FilterRepresentation::Debugging) {
    170170        TextStream::IndentScope indentScope(ts);
    171171        ts.dumpProperty("operating colorspace", operatingColorSpace());
     
    175175}
    176176
    177 TextStream& operator<<(TextStream& ts, const FilterEffect& filter)
     177TextStream& operator<<(TextStream& ts, const FilterEffect& effect)
    178178{
    179179    // Use a new stream because we want multiline mode for logging filters.
    180180    TextStream filterStream;
    181     filter.externalRepresentation(filterStream, FilterEffect::RepresentationType::Debugging);
     181    effect.externalRepresentation(filterStream, FilterRepresentation::Debugging);
    182182   
    183183    return ts << filterStream.release();
  • trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h

    r286578 r286589  
    5959    virtual void setOperatingColorSpace(const DestinationColorSpace& colorSpace) { m_operatingColorSpace = colorSpace; }
    6060
    61     enum class RepresentationType { TestOutput, Debugging };
    62     virtual WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType = RepresentationType::TestOutput) const;
     61    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    6362
    6463protected:
  • trunk/Source/WebCore/platform/graphics/filters/FilterFunction.h

    r286578 r286589  
    3939
    4040class Filter;
     41
     42enum class FilterRepresentation : uint8_t {
     43    TestOutput,
     44    Debugging
     45};
    4146
    4247class FilterFunction : public RefCounted<FilterFunction> {
     
    9499    virtual void clearResult() { }
    95100
     101    virtual WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation = FilterRepresentation::TestOutput) const = 0;
     102
    96103private:
    97104    Type m_filterType;
  • trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp

    r286287 r286589  
    5050}
    5151
    52 TextStream& SourceAlpha::externalRepresentation(TextStream& ts, RepresentationType) const
     52TextStream& SourceAlpha::externalRepresentation(TextStream& ts, FilterRepresentation) const
    5353{
    5454    ts << indent << "[SourceAlpha]\n";
  • trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h

    r286287 r286589  
    3838    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    3939
    40     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     40    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    4141};
    4242
  • trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp

    r286287 r286589  
    5757}
    5858
    59 TextStream& SourceGraphic::externalRepresentation(TextStream& ts, RepresentationType) const
     59TextStream& SourceGraphic::externalRepresentation(TextStream& ts, FilterRepresentation) const
    6060{
    6161    ts << indent << "[SourceGraphic]\n";
  • trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h

    r286538 r286589  
    4343    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const override;
    4444
    45     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const override;
     45    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const override;
    4646};
    4747
  • trunk/Source/WebCore/rendering/CSSFilter.cpp

    r286546 r286589  
    405405}
    406406
     407TextStream& CSSFilter::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
     408{
     409    unsigned level = 0;
     410
     411    for (auto it = m_functions.rbegin(), end = m_functions.rend(); it != end; ++it) {
     412        auto& function = *it;
     413       
     414        // SourceAlpha is a built-in effect. No need to say SourceGraphic is its input.
     415        if (function->filterType() == FilterEffect::Type::SourceAlpha)
     416            ++it;
     417
     418        TextStream::IndentScope indentScope(ts, level++);
     419        function->externalRepresentation(ts, representation);
     420    }
     421
     422    return ts;
     423}
     424
    407425} // namespace WebCore
  • trunk/Source/WebCore/rendering/CSSFilter.h

    r286546 r286589  
    6969#endif
    7070
     71    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const final;
     72
    7173    bool m_hasFilterThatMovesPixels { false };
    7274    bool m_hasFilterThatShouldBeRestrictedBySecurityOrigin { false };
  • trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp

    r286546 r286589  
    435435        if (dummyFilter) {
    436436            TextStream::IndentScope indentScope(ts);
    437 
    438             if (auto lastEffect = dummyFilter->lastEffect())
    439                 lastEffect->externalRepresentation(ts);
     437            dummyFilter->externalRepresentation(ts, FilterRepresentation::TestOutput);
    440438        }
    441439    } else if (resource.resourceType() == ClipperResourceType) {
  • trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp

    r286287 r286589  
    113113}
    114114
    115 TextStream& FEImage::externalRepresentation(TextStream& ts, RepresentationType representation) const
     115TextStream& FEImage::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
    116116{
    117117    ts << indent << "[feImage";
    118118    FilterEffect::externalRepresentation(ts, representation);
    119     ts << " image-size=\"" << m_sourceImageRect.width() << "x" << m_sourceImageRect.height() << "\"]\n";
     119
     120    ts << " image-size=\"" << m_sourceImageRect.width() << "x" << m_sourceImageRect.height() << "\"";
    120121    // FIXME: should this dump also object returned by SVGFEImage::image() ?
     122
     123    ts << "]\n";
    121124    return ts;
    122125}
  • trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h

    r286287 r286589  
    5555    std::unique_ptr<FilterEffectApplier> createApplier(const Filter&) const final;
    5656
    57     WTF::TextStream& externalRepresentation(WTF::TextStream&, RepresentationType) const final;
     57    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const final;
    5858
    5959    SourceImage m_sourceImage;
  • trunk/Source/WebCore/svg/graphics/filters/SVGFilter.cpp

    r286578 r286589  
    134134}
    135135
     136TextStream& SVGFilter::externalRepresentation(TextStream& ts, FilterRepresentation representation) const
     137{
     138    for (auto it = m_expression.rbegin(), end = m_expression.rend(); it != end; ++it) {
     139        auto& term = *it;
     140       
     141        // SourceAlpha is a built-in effect. No need to say SourceGraphic is its input.
     142        if (term.effect->filterType() == FilterEffect::Type::SourceAlpha)
     143            ++it;
     144
     145        TextStream::IndentScope indentScope(ts, term.level);
     146        term.effect->externalRepresentation(ts, representation);
     147    }
     148
     149    return ts;
     150}
     151
    136152} // namespace WebCore
  • trunk/Source/WebCore/svg/graphics/filters/SVGFilter.h

    r286578 r286589  
    4747    RefPtr<FilterImage> apply() final;
    4848
     49    WTF::TextStream& externalRepresentation(WTF::TextStream&, FilterRepresentation) const final;
     50
    4951private:
    5052    SVGFilter(RenderingMode, const FloatSize& filterScale, ClipOperation, const FloatRect& filterRegion, const FloatRect& targetBoundingBox, SVGUnitTypes::SVGUnitType primitiveUnits);
  • trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.cpp

    r286578 r286589  
    4242}
    4343
    44 static OptionSet<FilterEffectGeometry::Flags> boundarySetFlagsForElement(SVGElement& element)
     44static OptionSet<FilterEffectGeometry::Flags> effectGeometryFlagsForElement(SVGElement& element)
    4545{
    4646    OptionSet<FilterEffectGeometry::Flags> flags;
     
    109109            break;
    110110
    111         if (auto flags = boundarySetFlagsForElement(effectElement)) {
     111        if (auto flags = effectGeometryFlagsForElement(effectElement)) {
    112112            auto effectBoundaries = SVGLengthContext::resolveRectangle<SVGFilterPrimitiveStandardAttributes>(&effectElement, m_primitiveUnits, m_targetBoundingBox);
    113113            m_effectGeometryMap.add(*effect, FilterEffectGeometry(effectBoundaries, flags));
     
    210210}
    211211
    212 bool SVGFilterBuilder::buildEffectExpression(const RefPtr<FilterEffect>& effect, FilterEffectVector& stack, SVGFilterExpression& expression) const
     212bool SVGFilterBuilder::buildEffectExpression(const RefPtr<FilterEffect>& effect, FilterEffectVector& stack, unsigned level, SVGFilterExpression& expression) const
    213213{
    214214    // A cycle is detected.
     
    218218    stack.append(effect);
    219219   
    220     expression.append({ *effect, effectGeometry(*effect) });
     220    expression.append({ *effect, effectGeometry(*effect), level });
    221221
    222222    for (auto& inputEffect : effect->inputEffects()) {
    223         if (!buildEffectExpression(inputEffect, stack, expression))
     223        if (!buildEffectExpression(inputEffect, stack, level + 1, expression))
    224224            return false;
    225225    }
     
    238238
    239239    FilterEffectVector stack;
    240     if (!buildEffectExpression(m_lastEffect, stack, expression))
     240    if (!buildEffectExpression(m_lastEffect, stack, 0, expression))
    241241        return false;
    242242
  • trunk/Source/WebCore/svg/graphics/filters/SVGFilterBuilder.h

    r286578 r286589  
    8080
    8181    std::optional<FilterEffectGeometry> effectGeometry(FilterEffect&) const;
    82     bool buildEffectExpression(const RefPtr<FilterEffect>&, FilterEffectVector& stack, SVGFilterExpression&) const;
     82    bool buildEffectExpression(const RefPtr<FilterEffect>&, FilterEffectVector& stack, unsigned level, SVGFilterExpression&) const;
    8383
    8484    HashMap<AtomString, RefPtr<FilterEffect>> m_builtinEffects;
  • trunk/Source/WebCore/svg/graphics/filters/SVGFilterExpression.h

    r286578 r286589  
    3636    Ref<FilterEffect> effect;
    3737    std::optional<FilterEffectGeometry> geometry;
     38    unsigned level;
    3839};
    3940
Note: See TracChangeset for help on using the changeset viewer.