Changeset 225185 in webkit
- Timestamp:
- Nov 27, 2017, 12:02:09 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 47 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/text/TextStream.h (modified) (4 diffs)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEBlend.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEBlend.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEColorMatrix.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/filters/FEColorMatrix.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEComponentTransfer.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEComponentTransfer.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEComposite.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/filters/FEComposite.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEConvolveMatrix.cpp (modified) (2 diffs)
-
WebCore/platform/graphics/filters/FEConvolveMatrix.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEDiffuseLighting.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEDiffuseLighting.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEDisplacementMap.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEDisplacementMap.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEDropShadow.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEDropShadow.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEFlood.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEFlood.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEGaussianBlur.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEGaussianBlur.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEMerge.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEMerge.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEMorphology.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEMorphology.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEOffset.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FEOffset.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FESpecularLighting.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FESpecularLighting.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FETile.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FETile.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FETurbulence.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FETurbulence.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/FilterEffect.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/FilterEffect.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/SourceAlpha.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/SourceAlpha.h (modified) (1 diff)
-
WebCore/platform/graphics/filters/SourceGraphic.cpp (modified) (1 diff)
-
WebCore/platform/graphics/filters/SourceGraphic.h (modified) (1 diff)
-
WebCore/rendering/RenderTreeAsText.cpp (modified) (13 diffs)
-
WebCore/rendering/RenderTreeAsText.h (modified) (1 diff)
-
WebCore/rendering/svg/SVGRenderTreeAsText.cpp (modified) (11 diffs)
-
WebCore/rendering/svg/SVGRenderTreeAsText.h (modified) (1 diff)
-
WebCore/svg/graphics/filters/SVGFEImage.cpp (modified) (2 diffs)
-
WebCore/svg/graphics/filters/SVGFEImage.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r225144 r225185 1 2017-11-27 Simon Fraser <simon.fraser@apple.com> 2 3 Use TextStream's indent tracking, rather than passing indent to all the externalRepresentation() functions 4 https://bugs.webkit.org/show_bug.cgi?id=180027 5 6 Reviewed by Jon Lee. 7 8 Remove all the indent arguments, and make use of TextStream::IndentScope to control 9 output indentation. 10 11 Add an indent stream manipulator so you can say 12 ts << indent << "text" 13 to write the indent. 14 15 * wtf/text/TextStream.h: 16 (WTF::TextStream::IndentScope::IndentScope): 17 (WTF::TextStream::IndentScope::~IndentScope): 18 1 19 2016-08-05 Darin Adler <darin@apple.com> 2 20 -
trunk/Source/WTF/wtf/text/TextStream.h
r220503 r225185 96 96 WTF_EXPORT_PRIVATE void writeIndent(); 97 97 98 // Stream manipulators. 99 TextStream& operator<<(TextStream& (*func)(TextStream&)) 100 { 101 return (*func)(*this); 102 } 103 104 class IndentScope { 105 public: 106 IndentScope(TextStream& ts, int amount = 1) 107 : m_stream(ts) 108 , m_amount(amount) 109 { 110 m_stream.increaseIndent(m_amount); 111 } 112 ~IndentScope() 113 { 114 m_stream.decreaseIndent(m_amount); 115 } 116 117 private: 118 TextStream& m_stream; 119 int m_amount; 120 }; 121 98 122 class GroupScope { 99 123 public: … … 119 143 }; 120 144 145 inline TextStream& indent(TextStream& ts) 146 { 147 ts.writeIndent(); 148 return ts; 149 } 150 121 151 template<typename Item> 122 152 TextStream& operator<<(TextStream& ts, const Vector<Item>& vector) … … 134 164 } 135 165 166 // Deprecated. Use TextStream::writeIndent() instead. 136 167 WTF_EXPORT_PRIVATE void writeIndent(TextStream&, int indent); 137 168 … … 139 170 140 171 using WTF::TextStream; 172 using WTF::indent; -
trunk/Source/WebCore/ChangeLog
r225184 r225185 1 2017-11-27 Simon Fraser <simon.fraser@apple.com> 2 3 Use TextStream's indent tracking, rather than passing indent to all the externalRepresentation() functions 4 https://bugs.webkit.org/show_bug.cgi?id=180027 5 6 Reviewed by Jon Lee. 7 8 Remove all the indent arguments, and make use of TextStream::IndentScope to control 9 output indentation. 10 11 Add an indent stream manipulator so you can say 12 ts << indent << "text" 13 to write the indent. 14 15 * platform/graphics/filters/FEBlend.cpp: 16 (WebCore::FEBlend::externalRepresentation const): 17 * platform/graphics/filters/FEBlend.h: 18 * platform/graphics/filters/FEColorMatrix.cpp: 19 (WebCore::FEColorMatrix::externalRepresentation const): 20 * platform/graphics/filters/FEColorMatrix.h: 21 * platform/graphics/filters/FEComponentTransfer.cpp: 22 (WebCore::FEComponentTransfer::externalRepresentation const): 23 * platform/graphics/filters/FEComponentTransfer.h: 24 * platform/graphics/filters/FEComposite.cpp: 25 (WebCore::FEComposite::externalRepresentation const): 26 * platform/graphics/filters/FEComposite.h: 27 * platform/graphics/filters/FEConvolveMatrix.cpp: 28 (WebCore::FEConvolveMatrix::externalRepresentation const): 29 * platform/graphics/filters/FEConvolveMatrix.h: 30 * platform/graphics/filters/FEDiffuseLighting.cpp: 31 (WebCore::FEDiffuseLighting::externalRepresentation const): 32 * platform/graphics/filters/FEDiffuseLighting.h: 33 * platform/graphics/filters/FEDisplacementMap.cpp: 34 (WebCore::FEDisplacementMap::externalRepresentation const): 35 * platform/graphics/filters/FEDisplacementMap.h: 36 * platform/graphics/filters/FEDropShadow.cpp: 37 (WebCore::FEDropShadow::externalRepresentation const): 38 * platform/graphics/filters/FEDropShadow.h: 39 * platform/graphics/filters/FEFlood.cpp: 40 (WebCore::FEFlood::externalRepresentation const): 41 * platform/graphics/filters/FEFlood.h: 42 * platform/graphics/filters/FEGaussianBlur.cpp: 43 (WebCore::FEGaussianBlur::externalRepresentation const): 44 * platform/graphics/filters/FEGaussianBlur.h: 45 * platform/graphics/filters/FEMerge.cpp: 46 (WebCore::FEMerge::externalRepresentation const): 47 * platform/graphics/filters/FEMerge.h: 48 * platform/graphics/filters/FEMorphology.cpp: 49 (WebCore::FEMorphology::externalRepresentation const): 50 * platform/graphics/filters/FEMorphology.h: 51 * platform/graphics/filters/FEOffset.cpp: 52 (WebCore::FEOffset::externalRepresentation const): 53 * platform/graphics/filters/FEOffset.h: 54 * platform/graphics/filters/FESpecularLighting.cpp: 55 (WebCore::FESpecularLighting::externalRepresentation const): 56 * platform/graphics/filters/FESpecularLighting.h: 57 * platform/graphics/filters/FETile.cpp: 58 (WebCore::FETile::externalRepresentation const): 59 * platform/graphics/filters/FETile.h: 60 * platform/graphics/filters/FETurbulence.cpp: 61 (WebCore::FETurbulence::externalRepresentation const): 62 * platform/graphics/filters/FETurbulence.h: 63 * platform/graphics/filters/FilterEffect.cpp: 64 (WebCore::FilterEffect::externalRepresentation const): 65 * platform/graphics/filters/FilterEffect.h: 66 * platform/graphics/filters/SourceAlpha.cpp: 67 (WebCore::SourceAlpha::externalRepresentation const): 68 * platform/graphics/filters/SourceAlpha.h: 69 * platform/graphics/filters/SourceGraphic.cpp: 70 (WebCore::SourceGraphic::externalRepresentation const): 71 * platform/graphics/filters/SourceGraphic.h: 72 * rendering/RenderTreeAsText.cpp: 73 (WebCore::write): 74 (WebCore::writeLayer): 75 (WebCore::writeLayerRenderers): 76 (WebCore::writeLayers): 77 (WebCore::externalRepresentation): 78 * rendering/RenderTreeAsText.h: 79 * rendering/svg/SVGRenderTreeAsText.cpp: 80 (WebCore::writeSVGInlineTextBox): 81 (WebCore::writeSVGInlineTextBoxes): 82 (WebCore::writeStandardPrefix): 83 (WebCore::writeChildren): 84 (WebCore::writeSVGResourceContainer): 85 (WebCore::writeSVGContainer): 86 (WebCore::write): 87 (WebCore::writeSVGText): 88 (WebCore::writeSVGInlineText): 89 (WebCore::writeSVGImage): 90 (WebCore::writeSVGGradientStop): 91 (WebCore::writeResources): 92 * rendering/svg/SVGRenderTreeAsText.h: 93 * svg/graphics/filters/SVGFEImage.cpp: 94 (WebCore::FEImage::externalRepresentation const): 95 * svg/graphics/filters/SVGFEImage.h: 96 1 97 2017-11-27 Chris Dumez <cdumez@apple.com> 2 98 -
trunk/Source/WebCore/platform/graphics/filters/FEBlend.cpp
r225137 r225185 76 76 #endif 77 77 78 TextStream& FEBlend::externalRepresentation(TextStream& ts , int indent) const78 TextStream& FEBlend::externalRepresentation(TextStream& ts) const 79 79 { 80 writeIndent(ts, indent); 81 ts << "[feBlend"; 80 ts << indent << "[feBlend"; 82 81 FilterEffect::externalRepresentation(ts); 83 82 ts << " mode=\"" << (m_mode == BlendModeNormal ? "normal" : compositeOperatorName(CompositeSourceOver, m_mode)) << "\"]\n"; 84 inputEffect(0)->externalRepresentation(ts, indent + 1); 85 inputEffect(1)->externalRepresentation(ts, indent + 1); 83 84 TextStream::IndentScope indentScope(ts); 85 inputEffect(0)->externalRepresentation(ts); 86 inputEffect(1)->externalRepresentation(ts); 86 87 return ts; 87 88 } -
trunk/Source/WebCore/platform/graphics/filters/FEBlend.h
r225137 r225185 45 45 unsigned colorArrayLength); 46 46 47 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;47 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 48 48 49 49 FEBlend(Filter&, BlendMode); -
trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.cpp
r225172 r225185 336 336 } 337 337 338 TextStream& FEColorMatrix::externalRepresentation(TextStream& ts, int indent) const 339 { 340 writeIndent(ts, indent); 341 ts << "[feColorMatrix"; 338 TextStream& FEColorMatrix::externalRepresentation(TextStream& ts) const 339 { 340 ts << indent << "[feColorMatrix"; 342 341 FilterEffect::externalRepresentation(ts); 343 342 ts << " type=\"" << m_type << "\""; … … 355 354 } 356 355 ts << "]\n"; 357 inputEffect(0)->externalRepresentation(ts, indent + 1); 356 357 TextStream::IndentScope indentScope(ts); 358 inputEffect(0)->externalRepresentation(ts); 358 359 return ts; 359 360 } -
trunk/Source/WebCore/platform/graphics/filters/FEColorMatrix.h
r225137 r225185 57 57 void platformApplySoftware() override; 58 58 59 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;59 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 60 60 61 61 ColorMatrixType m_type; -
trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.cpp
r225147 r225185 195 195 } 196 196 197 TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts, int indent) const 198 { 199 writeIndent(ts, indent); 200 ts << "[feComponentTransfer"; 197 TextStream& FEComponentTransfer::externalRepresentation(TextStream& ts) const 198 { 199 ts << indent << "[feComponentTransfer"; 201 200 FilterEffect::externalRepresentation(ts); 202 201 ts << " \n"; 203 writeIndent(ts, indent + 2); 204 ts << "{red: " << m_redFunction << "}\n"; 205 writeIndent(ts, indent + 2); 206 ts << "{green: " << m_greenFunction << "}\n"; 207 writeIndent(ts, indent + 2); 208 ts << "{blue: " << m_blueFunction << "}\n"; 209 writeIndent(ts, indent + 2); 210 ts << "{alpha: " << m_alphaFunction << "}]\n"; 211 inputEffect(0)->externalRepresentation(ts, indent + 1); 202 { 203 TextStream::IndentScope indentScope(ts, 2); 204 ts << indent << "{red: " << m_redFunction << "}\n"; 205 ts << indent <<"{green: " << m_greenFunction << "}\n"; 206 ts << indent <<"{blue: " << m_blueFunction << "}\n"; 207 ts << indent <<"{alpha: " << m_alphaFunction << "}]\n"; 208 } 209 210 TextStream::IndentScope indentScope(ts); 211 inputEffect(0)->externalRepresentation(ts); 212 212 return ts; 213 213 } -
trunk/Source/WebCore/platform/graphics/filters/FEComponentTransfer.h
r225137 r225185 80 80 void platformApplySoftware() override; 81 81 82 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;82 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 83 83 84 84 ComponentTransferFunction m_redFunction; -
trunk/Source/WebCore/platform/graphics/filters/FEComposite.cpp
r225147 r225185 328 328 } 329 329 330 TextStream& FEComposite::externalRepresentation(TextStream& ts, int indent) const 331 { 332 writeIndent(ts, indent); 333 ts << "[feComposite"; 330 TextStream& FEComposite::externalRepresentation(TextStream& ts) const 331 { 332 ts << indent << "[feComposite"; 334 333 FilterEffect::externalRepresentation(ts); 335 334 ts << " operation=\"" << m_type << "\""; … … 337 336 ts << " k1=\"" << m_k1 << "\" k2=\"" << m_k2 << "\" k3=\"" << m_k3 << "\" k4=\"" << m_k4 << "\""; 338 337 ts << "]\n"; 339 inputEffect(0)->externalRepresentation(ts, indent + 1); 340 inputEffect(1)->externalRepresentation(ts, indent + 1); 338 339 TextStream::IndentScope indentScope(ts); 340 inputEffect(0)->externalRepresentation(ts); 341 inputEffect(1)->externalRepresentation(ts); 341 342 return ts; 342 343 } -
trunk/Source/WebCore/platform/graphics/filters/FEComposite.h
r225147 r225185 71 71 72 72 void platformApplySoftware() override; 73 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;73 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 74 74 75 75 inline void platformArithmeticSoftware(const Uint8ClampedArray& source, Uint8ClampedArray& destination, float k1, float k2, float k3, float k4); -
trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.cpp
r225147 r225185 456 456 } 457 457 458 TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts, int indent) const 459 { 460 writeIndent(ts, indent); 461 ts << "[feConvolveMatrix"; 458 TextStream& FEConvolveMatrix::externalRepresentation(TextStream& ts) const 459 { 460 ts << indent << "[feConvolveMatrix"; 462 461 FilterEffect::externalRepresentation(ts); 463 462 ts << " order=\"" << m_kernelSize << "\" " … … 469 468 << "kernelUnitLength=\"" << m_kernelUnitLength << "\" " 470 469 << "preserveAlpha=\"" << m_preserveAlpha << "\"]\n"; 471 inputEffect(0)->externalRepresentation(ts, indent + 1); 470 471 TextStream::IndentScope indentScope(ts); 472 inputEffect(0)->externalRepresentation(ts); 472 473 return ts; 473 474 } -
trunk/Source/WebCore/platform/graphics/filters/FEConvolveMatrix.h
r225147 r225185 87 87 void platformApplySoftware() override; 88 88 89 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;89 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 90 90 91 91 template<bool preserveAlphaValues> -
trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.cpp
r225026 r225185 48 48 } 49 49 50 TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts , int indent) const50 TextStream& FEDiffuseLighting::externalRepresentation(TextStream& ts) const 51 51 { 52 writeIndent(ts, indent); 53 ts << "[feDiffuseLighting"; 52 ts << indent << "[feDiffuseLighting"; 54 53 FilterEffect::externalRepresentation(ts); 55 54 ts << " surfaceScale=\"" << m_surfaceScale << "\" " 56 55 << "diffuseConstant=\"" << m_diffuseConstant << "\" " 57 56 << "kernelUnitLength=\"" << m_kernelUnitLengthX << ", " << m_kernelUnitLengthY << "\"]\n"; 58 inputEffect(0)->externalRepresentation(ts, indent + 1); 57 58 TextStream::IndentScope indentScope(ts); 59 inputEffect(0)->externalRepresentation(ts); 59 60 return ts; 60 61 } -
trunk/Source/WebCore/platform/graphics/filters/FEDiffuseLighting.h
r225026 r225185 36 36 bool setDiffuseConstant(float); 37 37 38 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;38 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 39 39 40 40 private: -
trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.cpp
r225183 r225185 167 167 } 168 168 169 TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts , int indent) const169 TextStream& FEDisplacementMap::externalRepresentation(TextStream& ts) const 170 170 { 171 writeIndent(ts, indent); 172 ts << "[feDisplacementMap"; 171 ts << indent << "[feDisplacementMap"; 173 172 FilterEffect::externalRepresentation(ts); 174 173 ts << " scale=\"" << m_scale << "\" " 175 174 << "xChannelSelector=\"" << m_xChannelSelector << "\" " 176 175 << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n"; 177 inputEffect(0)->externalRepresentation(ts, indent + 1); 178 inputEffect(1)->externalRepresentation(ts, indent + 1); 176 177 TextStream::IndentScope indentScope(ts); 178 inputEffect(0)->externalRepresentation(ts); 179 inputEffect(1)->externalRepresentation(ts); 179 180 return ts; 180 181 } -
trunk/Source/WebCore/platform/graphics/filters/FEDisplacementMap.h
r225183 r225185 61 61 void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 62 62 63 WTF::TextStream& externalRepresentation(WTF::TextStream&, int indention) const override;64 65 63 int xChannelIndex() const { return m_xChannelSelector - 1; } 66 64 int yChannelIndex() const { return m_yChannelSelector - 1; } 65 66 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 67 67 68 68 ChannelSelectorType m_xChannelSelector; -
trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.cpp
r225147 r225185 115 115 } 116 116 117 TextStream& FEDropShadow::externalRepresentation(TextStream& ts , int indent) const117 TextStream& FEDropShadow::externalRepresentation(TextStream& ts) const 118 118 { 119 writeIndent(ts, indent); 120 ts << "[feDropShadow"; 119 ts << indent <<"[feDropShadow"; 121 120 FilterEffect::externalRepresentation(ts); 122 121 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx << "\" dy=\"" << m_dy << "\" flood-color=\"" << m_shadowColor.nameForRenderTreeAsText() <<"\" flood-opacity=\"" << m_shadowOpacity << "]\n"; 123 inputEffect(0)->externalRepresentation(ts, indent + 1); 122 123 TextStream::IndentScope indentScope(ts); 124 inputEffect(0)->externalRepresentation(ts); 124 125 return ts; 125 126 } -
trunk/Source/WebCore/platform/graphics/filters/FEDropShadow.h
r225137 r225185 57 57 void determineAbsolutePaintRect() override; 58 58 59 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;59 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 60 60 61 61 float m_stdX; -
trunk/Source/WebCore/platform/graphics/filters/FEFlood.cpp
r225026 r225185 68 68 } 69 69 70 TextStream& FEFlood::externalRepresentation(TextStream& ts , int indent) const70 TextStream& FEFlood::externalRepresentation(TextStream& ts) const 71 71 { 72 writeIndent(ts, indent); 73 ts << "[feFlood"; 72 ts << indent << "[feFlood"; 74 73 FilterEffect::externalRepresentation(ts); 75 74 ts << " flood-color=\"" << floodColor().nameForRenderTreeAsText() << "\" " -
trunk/Source/WebCore/platform/graphics/filters/FEFlood.h
r225137 r225185 54 54 void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 55 55 56 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;56 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 57 57 58 58 Color m_floodColor; -
trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.cpp
r225147 r225185 540 540 } 541 541 542 TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts, int indent) const 543 { 544 writeIndent(ts, indent); 545 ts << "[feGaussianBlur"; 542 TextStream& FEGaussianBlur::externalRepresentation(TextStream& ts) const 543 { 544 ts << indent << "[feGaussianBlur"; 546 545 FilterEffect::externalRepresentation(ts); 547 546 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n"; 548 inputEffect(0)->externalRepresentation(ts, indent + 1); 547 548 TextStream::IndentScope indentScope(ts); 549 inputEffect(0)->externalRepresentation(ts); 549 550 return ts; 550 551 } -
trunk/Source/WebCore/platform/graphics/filters/FEGaussianBlur.h
r225147 r225185 68 68 void determineAbsolutePaintRect() override; 69 69 70 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;70 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 71 71 72 72 static void platformApplyWorker(PlatformApplyParameters*); -
trunk/Source/WebCore/platform/graphics/filters/FEMerge.cpp
r225137 r225185 57 57 } 58 58 59 TextStream& FEMerge::externalRepresentation(TextStream& ts , int indent) const59 TextStream& FEMerge::externalRepresentation(TextStream& ts) const 60 60 { 61 writeIndent(ts, indent); 62 ts << "[feMerge"; 61 ts << indent << "[feMerge"; 63 62 FilterEffect::externalRepresentation(ts); 64 63 unsigned size = numberOfEffectInputs(); 65 64 ASSERT(size > 0); 66 65 ts << " mergeNodes=\"" << size << "\"]\n"; 66 67 TextStream::IndentScope indentScope(ts); 67 68 for (unsigned i = 0; i < size; ++i) 68 inputEffect(i)->externalRepresentation(ts , indent + 1);69 inputEffect(i)->externalRepresentation(ts); 69 70 return ts; 70 71 } -
trunk/Source/WebCore/platform/graphics/filters/FEMerge.h
r225137 r225185 38 38 void platformApplySoftware() override; 39 39 40 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;40 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 41 41 }; 42 42 -
trunk/Source/WebCore/platform/graphics/filters/FEMorphology.cpp
r225172 r225185 290 290 } 291 291 292 TextStream& FEMorphology::externalRepresentation(TextStream& ts, int indent) const 293 { 294 writeIndent(ts, indent); 295 ts << "[feMorphology"; 292 TextStream& FEMorphology::externalRepresentation(TextStream& ts) const 293 { 294 ts << indent << "[feMorphology"; 296 295 FilterEffect::externalRepresentation(ts); 297 296 ts << " operator=\"" << morphologyOperator() << "\" " 298 297 << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n"; 299 inputEffect(0)->externalRepresentation(ts, indent + 1); 298 299 TextStream::IndentScope indentScope(ts); 300 inputEffect(0)->externalRepresentation(ts); 300 301 return ts; 301 302 } -
trunk/Source/WebCore/platform/graphics/filters/FEMorphology.h
r225172 r225185 55 55 void determineAbsolutePaintRect() override; 56 56 57 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;57 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 58 58 59 59 bool platformApplyDegenerate(Uint8ClampedArray& dstPixelArray, const IntRect& imageRect, int radiusX, int radiusY); -
trunk/Source/WebCore/platform/graphics/filters/FEOffset.cpp
r225137 r225185 82 82 } 83 83 84 TextStream& FEOffset::externalRepresentation(TextStream& ts , int indent) const84 TextStream& FEOffset::externalRepresentation(TextStream& ts) const 85 85 { 86 writeIndent(ts, indent); 87 ts << "[feOffset"; 86 ts << indent << "[feOffset"; 88 87 FilterEffect::externalRepresentation(ts); 89 88 ts << " dx=\"" << dx() << "\" dy=\"" << dy() << "\"]\n"; 90 inputEffect(0)->externalRepresentation(ts, indent + 1); 89 90 TextStream::IndentScope indentScope(ts); 91 inputEffect(0)->externalRepresentation(ts); 91 92 return ts; 92 93 } -
trunk/Source/WebCore/platform/graphics/filters/FEOffset.h
r225137 r225185 46 46 void determineAbsolutePaintRect() override; 47 47 48 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;48 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 49 49 50 50 float m_dx; -
trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.cpp
r225026 r225185 56 56 } 57 57 58 TextStream& FESpecularLighting::externalRepresentation(TextStream& ts , int indent) const58 TextStream& FESpecularLighting::externalRepresentation(TextStream& ts) const 59 59 { 60 writeIndent(ts, indent); 61 ts << "[feSpecularLighting"; 60 ts << indent << "[feSpecularLighting"; 62 61 FilterEffect::externalRepresentation(ts); 63 62 ts << " surfaceScale=\"" << m_surfaceScale << "\" " 64 63 << "specualConstant=\"" << m_specularConstant << "\" " 65 64 << "specularExponent=\"" << m_specularExponent << "\"]\n"; 66 inputEffect(0)->externalRepresentation(ts, indent + 1); 65 66 TextStream::IndentScope indentScope(ts); 67 inputEffect(0)->externalRepresentation(ts); 67 68 return ts; 68 69 } -
trunk/Source/WebCore/platform/graphics/filters/FESpecularLighting.h
r225026 r225185 37 37 bool setSpecularExponent(float); 38 38 39 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;39 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 40 40 41 41 private: -
trunk/Source/WebCore/platform/graphics/filters/FETile.cpp
r225137 r225185 87 87 } 88 88 89 TextStream& FETile::externalRepresentation(TextStream& ts , int indent) const89 TextStream& FETile::externalRepresentation(TextStream& ts) const 90 90 { 91 writeIndent(ts, indent); 92 ts << "[feTile"; 91 ts << indent << "[feTile"; 93 92 FilterEffect::externalRepresentation(ts); 94 93 ts << "]\n"; 95 inputEffect(0)->externalRepresentation(ts, indent + 1); 94 95 TextStream::IndentScope indentScope(ts); 96 inputEffect(0)->externalRepresentation(ts); 96 97 97 98 return ts; -
trunk/Source/WebCore/platform/graphics/filters/FETile.h
r225137 r225185 42 42 void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 43 43 44 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;44 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 45 45 }; 46 46 -
trunk/Source/WebCore/platform/graphics/filters/FETurbulence.cpp
r225147 r225185 468 468 } 469 469 470 TextStream& FETurbulence::externalRepresentation(TextStream& ts, int indent) const 471 { 472 writeIndent(ts, indent); 473 ts << "[feTurbulence"; 470 TextStream& FETurbulence::externalRepresentation(TextStream& ts) const 471 { 472 ts << indent << "[feTurbulence"; 474 473 FilterEffect::externalRepresentation(ts); 475 474 ts << " type=\"" << type() << "\" " -
trunk/Source/WebCore/platform/graphics/filters/FETurbulence.h
r225147 r225185 113 113 void platformApplySoftware() override; 114 114 void determineAbsolutePaintRect() override { setAbsolutePaintRect(enclosingIntRect(maxEffectRect())); } 115 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;115 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 116 116 117 117 void initPaint(PaintingData&); -
trunk/Source/WebCore/platform/graphics/filters/FilterEffect.cpp
r225147 r225185 504 504 } 505 505 506 TextStream& FilterEffect::externalRepresentation(TextStream& ts , int) const506 TextStream& FilterEffect::externalRepresentation(TextStream& ts) const 507 507 { 508 508 // FIXME: We should dump the subRegions of the filter primitives here later. This isn't -
trunk/Source/WebCore/platform/graphics/filters/FilterEffect.h
r225147 r225185 115 115 virtual FilterEffectType filterEffectType() const { return FilterEffectTypeUnknown; } 116 116 117 virtual WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention = 0) const;117 virtual WTF::TextStream& externalRepresentation(WTF::TextStream&) const; 118 118 119 119 // The following functions are SVG specific and will move to RenderSVGResourceFilterPrimitive. -
trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.cpp
r225137 r225185 64 64 } 65 65 66 TextStream& SourceAlpha::externalRepresentation(TextStream& ts , int indent) const66 TextStream& SourceAlpha::externalRepresentation(TextStream& ts) const 67 67 { 68 writeIndent(ts, indent); 69 ts << "[SourceAlpha]\n"; 68 ts << indent << "[SourceAlpha]\n"; 70 69 return ts; 71 70 } -
trunk/Source/WebCore/platform/graphics/filters/SourceAlpha.h
r225137 r225185 39 39 void platformApplySoftware() override; 40 40 void determineAbsolutePaintRect() override; 41 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;41 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 42 42 }; 43 43 -
trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.cpp
r225026 r225185 61 61 } 62 62 63 TextStream& SourceGraphic::externalRepresentation(TextStream& ts , int indent) const63 TextStream& SourceGraphic::externalRepresentation(TextStream& ts) const 64 64 { 65 writeIndent(ts, indent); 66 ts << "[SourceGraphic]\n"; 65 ts << indent << "[SourceGraphic]\n"; 67 66 return ts; 68 67 } -
trunk/Source/WebCore/platform/graphics/filters/SourceGraphic.h
r225137 r225185 44 44 void determineAbsolutePaintRect() override; 45 45 void platformApplySoftware() override; 46 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const override;46 WTF::TextStream& externalRepresentation(WTF::TextStream&) const override; 47 47 48 48 FilterEffectType filterEffectType() const override { return FilterEffectTypeSourceInput; } -
trunk/Source/WebCore/rendering/RenderTreeAsText.cpp
r224150 r225185 79 79 using namespace HTMLNames; 80 80 81 static void writeLayers(TextStream&, const RenderLayer& rootLayer, RenderLayer&, const LayoutRect& paintDirtyRect, int indent = 0,RenderAsTextBehavior = RenderAsTextBehaviorNormal);81 static void writeLayers(TextStream&, const RenderLayer& rootLayer, RenderLayer&, const LayoutRect& paintDirtyRect, RenderAsTextBehavior = RenderAsTextBehaviorNormal); 82 82 83 83 static void printBorderStyle(TextStream& ts, const EBorderStyle borderStyle) … … 524 524 } 525 525 526 void write(TextStream& ts, const RenderObject& o, int indent,RenderAsTextBehavior behavior)526 void write(TextStream& ts, const RenderObject& o, RenderAsTextBehavior behavior) 527 527 { 528 528 if (is<RenderSVGShape>(o)) { 529 write(ts, downcast<RenderSVGShape>(o), indent,behavior);529 write(ts, downcast<RenderSVGShape>(o), behavior); 530 530 return; 531 531 } 532 532 if (is<RenderSVGGradientStop>(o)) { 533 writeSVGGradientStop(ts, downcast<RenderSVGGradientStop>(o), indent,behavior);533 writeSVGGradientStop(ts, downcast<RenderSVGGradientStop>(o), behavior); 534 534 return; 535 535 } 536 536 if (is<RenderSVGResourceContainer>(o)) { 537 writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(o), indent,behavior);537 writeSVGResourceContainer(ts, downcast<RenderSVGResourceContainer>(o), behavior); 538 538 return; 539 539 } 540 540 if (is<RenderSVGContainer>(o)) { 541 writeSVGContainer(ts, downcast<RenderSVGContainer>(o), indent,behavior);541 writeSVGContainer(ts, downcast<RenderSVGContainer>(o), behavior); 542 542 return; 543 543 } 544 544 if (is<RenderSVGRoot>(o)) { 545 write(ts, downcast<RenderSVGRoot>(o), indent,behavior);545 write(ts, downcast<RenderSVGRoot>(o), behavior); 546 546 return; 547 547 } 548 548 if (is<RenderSVGText>(o)) { 549 writeSVGText(ts, downcast<RenderSVGText>(o), indent,behavior);549 writeSVGText(ts, downcast<RenderSVGText>(o), behavior); 550 550 return; 551 551 } 552 552 if (is<RenderSVGInlineText>(o)) { 553 writeSVGInlineText(ts, downcast<RenderSVGInlineText>(o), indent,behavior);553 writeSVGInlineText(ts, downcast<RenderSVGInlineText>(o), behavior); 554 554 return; 555 555 } 556 556 if (is<RenderSVGImage>(o)) { 557 writeSVGImage(ts, downcast<RenderSVGImage>(o), indent,behavior);558 return; 559 } 560 561 writeIndent(ts, indent);557 writeSVGImage(ts, downcast<RenderSVGImage>(o), behavior); 558 return; 559 } 560 561 ts << indent; 562 562 563 563 RenderTreeAsText::writeRenderObject(ts, o, behavior); 564 564 ts << "\n"; 565 566 TextStream::IndentScope indentScope(ts); 565 567 566 568 if (is<RenderText>(o)) { … … 570 572 auto resolver = runResolver(downcast<RenderBlockFlow>(*text.parent()), *layout); 571 573 for (auto run : resolver.rangeForRenderer(text)) { 572 writeIndent(ts, indent + 1);574 ts << indent; 573 575 writeSimpleLine(ts, text, run); 574 576 } 575 577 } else { 576 578 for (auto* box = text.firstTextBox(); box; box = box->nextTextBox()) { 577 writeIndent(ts, indent + 1);579 ts << indent; 578 580 writeTextRun(ts, text, *box); 579 581 } … … 584 586 if (child.hasLayer()) 585 587 continue; 586 write(ts, child, indent + 1,behavior);588 write(ts, child, behavior); 587 589 } 588 590 } … … 596 598 view.layoutContext().layout(); 597 599 if (RenderLayer* layer = root->layer()) 598 writeLayers(ts, *layer, *layer, layer->rect(), indent + 1,behavior);600 writeLayers(ts, *layer, *layer, layer->rect(), behavior); 599 601 } 600 602 } … … 609 611 610 612 static void writeLayer(TextStream& ts, const RenderLayer& layer, const LayoutRect& layerBounds, const LayoutRect& backgroundClipRect, const LayoutRect& clipRect, 611 LayerPaintPhase paintPhase = LayerPaintPhaseAll, int indent = 0,RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal)613 LayerPaintPhase paintPhase = LayerPaintPhaseAll, RenderAsTextBehavior behavior = RenderAsTextBehaviorNormal) 612 614 { 613 615 IntRect adjustedLayoutBounds = snappedIntRect(layerBounds); … … 615 617 IntRect adjustedClipRect = snappedIntRect(clipRect); 616 618 617 writeIndent(ts, indent); 618 619 ts << "layer "; 619 ts << indent << "layer "; 620 620 621 621 if (behavior & RenderAsTextShowAddresses) … … 672 672 } 673 673 674 static void writeLayerRenderers(TextStream& ts, const RenderLayer& layer, LayerPaintPhase paintPhase, int indent, RenderAsTextBehavior behavior) 675 { 676 if (paintPhase != LayerPaintPhaseBackground) 677 write(ts, layer.renderer(), indent + 1, behavior); 674 static void writeLayerRenderers(TextStream& ts, const RenderLayer& layer, LayerPaintPhase paintPhase, RenderAsTextBehavior behavior) 675 { 676 if (paintPhase != LayerPaintPhaseBackground) { 677 TextStream::IndentScope indentScope(ts); 678 write(ts, layer.renderer(), behavior); 679 } 678 680 } 679 681 … … 684 686 } 685 687 686 static void writeLayers(TextStream& ts, const RenderLayer& rootLayer, RenderLayer& layer, const LayoutRect& paintRect, int indent,RenderAsTextBehavior behavior)688 static void writeLayers(TextStream& ts, const RenderLayer& rootLayer, RenderLayer& layer, const LayoutRect& paintRect, RenderAsTextBehavior behavior) 687 689 { 688 690 // FIXME: Apply overflow to the root layer to not break every test. Complete hack. Sigh. … … 708 710 bool paintsBackgroundSeparately = negativeZOrderList && negativeZOrderList->size() > 0; 709 711 if (shouldPaint && paintsBackgroundSeparately) { 710 writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), LayerPaintPhaseBackground, indent,behavior);711 writeLayerRenderers(ts, layer, LayerPaintPhaseBackground, indent,behavior);712 writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), LayerPaintPhaseBackground, behavior); 713 writeLayerRenderers(ts, layer, LayerPaintPhaseBackground, behavior); 712 714 } 713 715 714 716 if (negativeZOrderList) { 715 int currIndent = indent;716 717 if (behavior & RenderAsTextShowLayerNesting) { 717 writeIndent(ts, indent); 718 ts << " negative z-order list(" << negativeZOrderList->size() << ")\n"; 719 ++currIndent; 718 ts << indent << " negative z-order list(" << negativeZOrderList->size() << ")\n"; 719 ts.increaseIndent(); 720 720 } 721 721 722 722 for (auto* currLayer : *negativeZOrderList) 723 writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, currIndent, behavior); 723 writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, behavior); 724 725 if (behavior & RenderAsTextShowLayerNesting) 726 ts.decreaseIndent(); 724 727 } 725 728 726 729 if (shouldPaint) { 727 writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent,behavior);730 writeLayer(ts, layer, layerBounds, damageRect.rect(), clipRectToApply.rect(), paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, behavior); 728 731 729 732 if (behavior & RenderAsTextShowLayerFragments) { … … 732 735 733 736 if (layerFragments.size() > 1) { 737 TextStream::IndentScope indentScope(ts, 2); 734 738 for (unsigned i = 0; i < layerFragments.size(); ++i) { 735 739 const auto& fragment = layerFragments[i]; 736 writeIndent(ts, indent + 2); 737 ts << " fragment " << i << ": bounds in layer " << fragment.layerBounds << " fragment bounds " << fragment.boundingBox << "\n"; 740 ts << indent << " fragment " << i << ": bounds in layer " << fragment.layerBounds << " fragment bounds " << fragment.boundingBox << "\n"; 738 741 } 739 742 } 740 743 } 741 744 742 writeLayerRenderers(ts, layer, paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, indent,behavior);745 writeLayerRenderers(ts, layer, paintsBackgroundSeparately ? LayerPaintPhaseForeground : LayerPaintPhaseAll, behavior); 743 746 } 744 747 745 748 if (auto* normalFlowList = layer.normalFlowList()) { 746 int currIndent = indent;747 749 if (behavior & RenderAsTextShowLayerNesting) { 748 writeIndent(ts, indent); 749 ts << " normal flow list(" << normalFlowList->size() << ")\n"; 750 ++currIndent; 750 ts << indent << " normal flow list(" << normalFlowList->size() << ")\n"; 751 ts.increaseIndent(); 751 752 } 752 753 753 754 for (auto* currLayer : *normalFlowList) 754 writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, currIndent, behavior); 755 writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, behavior); 756 757 if (behavior & RenderAsTextShowLayerNesting) 758 ts.decreaseIndent(); 755 759 } 756 760 … … 759 763 760 764 if (layerCount) { 761 int currIndent = indent;762 765 if (behavior & RenderAsTextShowLayerNesting) { 763 writeIndent(ts, indent); 764 ts << " positive z-order list(" << positiveZOrderList->size() << ")\n"; 765 ++currIndent; 766 ts << indent << " positive z-order list(" << positiveZOrderList->size() << ")\n"; 767 ts.increaseIndent(); 766 768 } 767 769 768 770 for (auto* currLayer : *positiveZOrderList) 769 writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, currIndent, behavior); 771 writeLayers(ts, rootLayer, *currLayer, paintDirtyRect, behavior); 772 773 if (behavior & RenderAsTextShowLayerNesting) 774 ts.decreaseIndent(); 770 775 } 771 776 } … … 835 840 836 841 RenderLayer& layer = *renderer.layer(); 837 writeLayers(ts, layer, layer, layer.rect(), 0,behavior);842 writeLayers(ts, layer, layer, layer.rect(), behavior); 838 843 writeSelection(ts, renderer); 839 844 return ts.release(); -
trunk/Source/WebCore/rendering/RenderTreeAsText.h
r220503 r225185 57 57 WEBCORE_EXPORT String externalRepresentation(Frame*, RenderAsTextBehavior = RenderAsTextBehaviorNormal); 58 58 WEBCORE_EXPORT String externalRepresentation(Element*, RenderAsTextBehavior = RenderAsTextBehaviorNormal); 59 void write(WTF::TextStream&, const RenderObject&, int indent = 0,RenderAsTextBehavior = RenderAsTextBehaviorNormal);59 void write(WTF::TextStream&, const RenderObject&, RenderAsTextBehavior = RenderAsTextBehaviorNormal); 60 60 void writeDebugInfo(WTF::TextStream&, const RenderObject&, RenderAsTextBehavior = RenderAsTextBehaviorNormal); 61 61 -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r220503 r225185 299 299 } 300 300 301 static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textBox , int indent)301 static inline void writeSVGInlineTextBox(TextStream& ts, SVGInlineTextBox* textBox) 302 302 { 303 303 Vector<SVGTextFragment>& fragments = textBox->textFragments(); … … 308 308 String text = textBox->renderer().text(); 309 309 310 TextStream::IndentScope indentScope(ts); 311 310 312 unsigned fragmentsSize = fragments.size(); 311 313 for (unsigned i = 0; i < fragmentsSize; ++i) { 312 314 SVGTextFragment& fragment = fragments.at(i); 313 writeIndent(ts, indent + 1);315 ts << indent; 314 316 315 317 unsigned startOffset = fragment.characterOffset; … … 353 355 } 354 356 355 static inline void writeSVGInlineTextBoxes(TextStream& ts, const RenderText& text , int indent)357 static inline void writeSVGInlineTextBoxes(TextStream& ts, const RenderText& text) 356 358 { 357 359 for (InlineTextBox* box = text.firstTextBox(); box; box = box->nextTextBox()) { … … 359 361 continue; 360 362 361 writeSVGInlineTextBox(ts, downcast<SVGInlineTextBox>(box), indent); 362 } 363 } 364 365 static void writeStandardPrefix(TextStream& ts, const RenderObject& object, int indent, RenderAsTextBehavior behavior) 366 { 367 writeIndent(ts, indent); 363 writeSVGInlineTextBox(ts, downcast<SVGInlineTextBox>(box)); 364 } 365 } 366 367 enum class WriteIndentOrNot { 368 No, 369 Yes 370 }; 371 372 static void writeStandardPrefix(TextStream& ts, const RenderObject& object, RenderAsTextBehavior behavior, WriteIndentOrNot writeIndent = WriteIndentOrNot::Yes) 373 { 374 if (writeIndent == WriteIndentOrNot::Yes) 375 ts << indent; 376 368 377 ts << object.renderName(); 369 378 … … 377 386 } 378 387 379 static void writeChildren(TextStream& ts, const RenderElement& parent, int indent, RenderAsTextBehavior behavior) 380 { 388 static void writeChildren(TextStream& ts, const RenderElement& parent, RenderAsTextBehavior behavior) 389 { 390 TextStream::IndentScope indentScope(ts); 391 381 392 for (const auto& child : childrenOfType<RenderObject>(parent)) 382 write(ts, child, indent + 1,behavior);393 write(ts, child, behavior); 383 394 } 384 395 … … 394 405 } 395 406 396 void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& resource, int indent,RenderAsTextBehavior behavior)397 { 398 writeStandardPrefix(ts, resource, indent,behavior);407 void writeSVGResourceContainer(TextStream& ts, const RenderSVGResourceContainer& resource, RenderAsTextBehavior behavior) 408 { 409 writeStandardPrefix(ts, resource, behavior); 399 410 400 411 const AtomicString& id = resource.element().getIdAttribute(); … … 415 426 RefPtr<SVGFilter> dummyFilter = SVGFilter::create(AffineTransform(), dummyRect, dummyRect, dummyRect, true); 416 427 if (auto builder = filter.buildPrimitives(*dummyFilter)) { 428 TextStream::IndentScope indentScope(ts); 429 417 430 if (FilterEffect* lastEffect = builder->lastEffect()) 418 lastEffect->externalRepresentation(ts , indent + 1);431 lastEffect->externalRepresentation(ts); 419 432 } 420 433 } else if (resource.resourceType() == ClipperResourceType) { … … 473 486 } else 474 487 ts << "\n"; 475 writeChildren(ts, resource, indent,behavior);476 } 477 478 void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, int indent,RenderAsTextBehavior behavior)488 writeChildren(ts, resource, behavior); 489 } 490 491 void writeSVGContainer(TextStream& ts, const RenderSVGContainer& container, RenderAsTextBehavior behavior) 479 492 { 480 493 // Currently RenderSVGResourceFilterPrimitive has no meaningful output. 481 494 if (container.isSVGResourceFilterPrimitive()) 482 495 return; 483 writeStandardPrefix(ts, container, indent,behavior);496 writeStandardPrefix(ts, container, behavior); 484 497 writePositionAndStyle(ts, container, behavior); 485 498 ts << "\n"; 486 writeResources(ts, container, indent,behavior);487 writeChildren(ts, container, indent,behavior);488 } 489 490 void write(TextStream& ts, const RenderSVGRoot& root, int indent,RenderAsTextBehavior behavior)491 { 492 writeStandardPrefix(ts, root, indent,behavior);499 writeResources(ts, container, behavior); 500 writeChildren(ts, container, behavior); 501 } 502 503 void write(TextStream& ts, const RenderSVGRoot& root, RenderAsTextBehavior behavior) 504 { 505 writeStandardPrefix(ts, root, behavior); 493 506 writePositionAndStyle(ts, root, behavior); 494 507 ts << "\n"; 495 writeChildren(ts, root, indent,behavior);496 } 497 498 void writeSVGText(TextStream& ts, const RenderSVGText& text, int indent,RenderAsTextBehavior behavior)499 { 500 writeStandardPrefix(ts, text, indent,behavior);508 writeChildren(ts, root, behavior); 509 } 510 511 void writeSVGText(TextStream& ts, const RenderSVGText& text, RenderAsTextBehavior behavior) 512 { 513 writeStandardPrefix(ts, text, behavior); 501 514 writeRenderSVGTextBox(ts, text); 502 515 ts << "\n"; 503 writeResources(ts, text, indent,behavior);504 writeChildren(ts, text, indent,behavior);505 } 506 507 void writeSVGInlineText(TextStream& ts, const RenderSVGInlineText& text, int indent,RenderAsTextBehavior behavior)508 { 509 writeStandardPrefix(ts, text, indent,behavior);516 writeResources(ts, text, behavior); 517 writeChildren(ts, text, behavior); 518 } 519 520 void writeSVGInlineText(TextStream& ts, const RenderSVGInlineText& text, RenderAsTextBehavior behavior) 521 { 522 writeStandardPrefix(ts, text, behavior); 510 523 ts << " " << enclosingIntRect(FloatRect(text.firstRunLocation(), text.floatLinesBoundingBox().size())) << "\n"; 511 writeResources(ts, text, indent,behavior);512 writeSVGInlineTextBoxes(ts, text , indent);513 } 514 515 void writeSVGImage(TextStream& ts, const RenderSVGImage& image, int indent,RenderAsTextBehavior behavior)516 { 517 writeStandardPrefix(ts, image, indent,behavior);524 writeResources(ts, text, behavior); 525 writeSVGInlineTextBoxes(ts, text); 526 } 527 528 void writeSVGImage(TextStream& ts, const RenderSVGImage& image, RenderAsTextBehavior behavior) 529 { 530 writeStandardPrefix(ts, image, behavior); 518 531 writePositionAndStyle(ts, image, behavior); 519 532 ts << "\n"; 520 writeResources(ts, image, indent,behavior);521 } 522 523 void write(TextStream& ts, const RenderSVGShape& shape, int indent,RenderAsTextBehavior behavior)524 { 525 writeStandardPrefix(ts, shape, indent,behavior);533 writeResources(ts, image, behavior); 534 } 535 536 void write(TextStream& ts, const RenderSVGShape& shape, RenderAsTextBehavior behavior) 537 { 538 writeStandardPrefix(ts, shape, behavior); 526 539 ts << shape << "\n"; 527 writeResources(ts, shape, indent,behavior);528 } 529 530 void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, int indent,RenderAsTextBehavior behavior)531 { 532 writeStandardPrefix(ts, stop, indent,behavior);540 writeResources(ts, shape, behavior); 541 } 542 543 void writeSVGGradientStop(TextStream& ts, const RenderSVGGradientStop& stop, RenderAsTextBehavior behavior) 544 { 545 writeStandardPrefix(ts, stop, behavior); 533 546 534 547 ts << " [offset=" << stop.element().offset() << "] [color=" << stop.element().stopColorIncludingOpacity() << "]\n"; 535 548 } 536 549 537 void writeResources(TextStream& ts, const RenderObject& renderer, int indent,RenderAsTextBehavior behavior)550 void writeResources(TextStream& ts, const RenderObject& renderer, RenderAsTextBehavior behavior) 538 551 { 539 552 const RenderStyle& style = renderer.style(); … … 544 557 if (!svgStyle.maskerResource().isEmpty()) { 545 558 if (RenderSVGResourceMasker* masker = getRenderSVGResourceById<RenderSVGResourceMasker>(renderer.document(), svgStyle.maskerResource())) { 546 writeIndent(ts, indent); 547 ts << " "; 559 ts << indent << " "; 548 560 writeNameAndQuotedValue(ts, "masker", svgStyle.maskerResource()); 549 561 ts << " "; 550 writeStandardPrefix(ts, *masker, 0, behavior);562 writeStandardPrefix(ts, *masker, behavior, WriteIndentOrNot::No); 551 563 ts << " " << masker->resourceBoundingBox(renderer) << "\n"; 552 564 } … … 554 566 if (!svgStyle.clipperResource().isEmpty()) { 555 567 if (RenderSVGResourceClipper* clipper = getRenderSVGResourceById<RenderSVGResourceClipper>(renderer.document(), svgStyle.clipperResource())) { 556 writeIndent(ts, indent); 557 ts << " "; 568 ts << indent << " "; 558 569 writeNameAndQuotedValue(ts, "clipPath", svgStyle.clipperResource()); 559 570 ts << " "; 560 writeStandardPrefix(ts, *clipper, 0, behavior);571 writeStandardPrefix(ts, *clipper, behavior, WriteIndentOrNot::No); 561 572 ts << " " << clipper->resourceBoundingBox(renderer) << "\n"; 562 573 } … … 570 581 AtomicString id = SVGURIReference::fragmentIdentifierFromIRIString(referenceFilterOperation.url(), renderer.document()); 571 582 if (RenderSVGResourceFilter* filter = getRenderSVGResourceById<RenderSVGResourceFilter>(renderer.document(), id)) { 572 writeIndent(ts, indent); 573 ts << " "; 583 ts << indent << " "; 574 584 writeNameAndQuotedValue(ts, "filter", id); 575 585 ts << " "; 576 writeStandardPrefix(ts, *filter, 0, behavior);586 writeStandardPrefix(ts, *filter, behavior, WriteIndentOrNot::No); 577 587 ts << " " << filter->resourceBoundingBox(renderer) << "\n"; 578 588 } -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.h
r220503 r225185 49 49 50 50 // functions used by the main RenderTreeAsText code 51 void write(WTF::TextStream&, const RenderSVGShape&, int indent,RenderAsTextBehavior);52 void write(WTF::TextStream&, const RenderSVGRoot&, int indent,RenderAsTextBehavior);53 void writeSVGGradientStop(WTF::TextStream&, const RenderSVGGradientStop&, int indent,RenderAsTextBehavior);54 void writeSVGResourceContainer(WTF::TextStream&, const RenderSVGResourceContainer&, int indent,RenderAsTextBehavior);55 void writeSVGContainer(WTF::TextStream&, const RenderSVGContainer&, int indent,RenderAsTextBehavior);56 void writeSVGImage(WTF::TextStream&, const RenderSVGImage&, int indent,RenderAsTextBehavior);57 void writeSVGInlineText(WTF::TextStream&, const RenderSVGInlineText&, int indent,RenderAsTextBehavior);58 void writeSVGText(WTF::TextStream&, const RenderSVGText&, int indent,RenderAsTextBehavior);59 void writeResources(WTF::TextStream&, const RenderObject&, int indent,RenderAsTextBehavior);51 void write(WTF::TextStream&, const RenderSVGShape&, RenderAsTextBehavior); 52 void write(WTF::TextStream&, const RenderSVGRoot&, RenderAsTextBehavior); 53 void writeSVGGradientStop(WTF::TextStream&, const RenderSVGGradientStop&, RenderAsTextBehavior); 54 void writeSVGResourceContainer(WTF::TextStream&, const RenderSVGResourceContainer&, RenderAsTextBehavior); 55 void writeSVGContainer(WTF::TextStream&, const RenderSVGContainer&, RenderAsTextBehavior); 56 void writeSVGImage(WTF::TextStream&, const RenderSVGImage&, RenderAsTextBehavior); 57 void writeSVGInlineText(WTF::TextStream&, const RenderSVGInlineText&, RenderAsTextBehavior); 58 void writeSVGText(WTF::TextStream&, const RenderSVGText&, RenderAsTextBehavior); 59 void writeResources(WTF::TextStream&, const RenderObject&, RenderAsTextBehavior); 60 60 61 61 // helper operators specific to dumping the render tree. these are used in various classes to dump the render tree -
trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.cpp
r225152 r225185 138 138 } 139 139 140 TextStream& FEImage::externalRepresentation(TextStream& ts , int indent) const140 TextStream& FEImage::externalRepresentation(TextStream& ts) const 141 141 { 142 142 FloatSize imageSize; … … 145 145 else if (RenderObject* renderer = referencedRenderer()) 146 146 imageSize = enclosingIntRect(renderer->repaintRectInLocalCoordinates()).size(); 147 writeIndent(ts, indent); 148 ts << "[feImage"; 147 ts << indent << "[feImage"; 149 148 FilterEffect::externalRepresentation(ts); 150 149 ts << " image-size=\"" << imageSize.width() << "x" << imageSize.height() << "\"]\n"; -
trunk/Source/WebCore/svg/graphics/filters/SVGFEImage.h
r225137 r225185 50 50 void platformApplySoftware() final; 51 51 void determineAbsolutePaintRect() final; 52 WTF::TextStream& externalRepresentation(WTF::TextStream& , int indention) const final;52 WTF::TextStream& externalRepresentation(WTF::TextStream&) const final; 53 53 54 54 RefPtr<Image> m_image;
Note:
See TracChangeset
for help on using the changeset viewer.