Title: [293814] trunk
Revision
293814
Author
simon.fra...@apple.com
Date
2022-05-04 19:37:47 -0700 (Wed, 04 May 2022)

Log Message

Improve logging of display list items in IPC messages
https://bugs.webkit.org/show_bug.cgi?id=240053

Reviewed by Cameron McCormack.

Source/WebCore:

In order for IPC arguments to show up in IPCMessages logging, the stream operators
for display list items have to be visible to WebKit2 code. So export them all from
WebCore, but only if !LOG_DISABLED, to avoid code bloat.

* platform/graphics/Font.cpp:
(WebCore::operator<<):
* platform/graphics/Font.h:
* platform/graphics/displaylists/DisplayListItems.cpp:
(WebCore::DisplayList::FillPath::apply const):
(WebCore::DisplayList::operator<<):
* platform/graphics/displaylists/DisplayListItems.h:

LayoutTests:

Now that display list logging is debug only, these tests will only work in debug builds.

* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (293813 => 293814)


--- trunk/LayoutTests/ChangeLog	2022-05-05 02:21:35 UTC (rev 293813)
+++ trunk/LayoutTests/ChangeLog	2022-05-05 02:37:47 UTC (rev 293814)
@@ -1,3 +1,14 @@
+2022-05-04  Simon Fraser  <simon.fra...@apple.com>
+
+        Improve logging of display list items in IPC messages
+        https://bugs.webkit.org/show_bug.cgi?id=240053
+
+        Reviewed by Cameron McCormack.
+
+        Now that display list logging is debug only, these tests will only work in debug builds.
+
+        * platform/mac/TestExpectations:
+
 2022-05-04  Aditya Keerthi  <akeer...@apple.com>
 
         Indeterminate, checked checkboxes do not render correctly on iOS, GTK, and Windows

Modified: trunk/LayoutTests/platform/mac/TestExpectations (293813 => 293814)


--- trunk/LayoutTests/platform/mac/TestExpectations	2022-05-05 02:21:35 UTC (rev 293813)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2022-05-05 02:37:47 UTC (rev 293814)
@@ -8,7 +8,6 @@
 
 accessibility/mac [ Pass ]
 compositing/scrolling/async-overflow-scrolling/mac [ Pass ]
-displaylists [ Pass ]
 editing/execCommand/mac [ Pass ]
 editing/input/cocoa [ Pass ]
 editing/mac [ Pass ]
@@ -18,6 +17,9 @@
 model-element [ Pass ]
 fast/images/mac [ Pass ]
 
+# Display list logging is only available in debug
+[ Debug ] displaylists [ Pass ]
+
 # Disable plug-in tests on Apple Silicon
 [ arm64 ] compositing/plugins [ Skip ]
 [ arm64 ] http/tests/plugins [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (293813 => 293814)


--- trunk/Source/WebCore/ChangeLog	2022-05-05 02:21:35 UTC (rev 293813)
+++ trunk/Source/WebCore/ChangeLog	2022-05-05 02:37:47 UTC (rev 293814)
@@ -1,3 +1,22 @@
+2022-05-04  Simon Fraser  <simon.fra...@apple.com>
+
+        Improve logging of display list items in IPC messages
+        https://bugs.webkit.org/show_bug.cgi?id=240053
+
+        Reviewed by Cameron McCormack.
+
+        In order for IPC arguments to show up in IPCMessages logging, the stream operators
+        for display list items have to be visible to WebKit2 code. So export them all from
+        WebCore, but only if !LOG_DISABLED, to avoid code bloat.
+
+        * platform/graphics/Font.cpp:
+        (WebCore::operator<<):
+        * platform/graphics/Font.h:
+        * platform/graphics/displaylists/DisplayListItems.cpp:
+        (WebCore::DisplayList::FillPath::apply const):
+        (WebCore::DisplayList::operator<<):
+        * platform/graphics/displaylists/DisplayListItems.h:
+
 2022-05-04  Aditya Keerthi  <akeer...@apple.com>
 
         Indeterminate, checked checkboxes do not render correctly on iOS, GTK, and Windows

Modified: trunk/Source/WebCore/platform/graphics/Font.cpp (293813 => 293814)


--- trunk/Source/WebCore/platform/graphics/Font.cpp	2022-05-05 02:21:35 UTC (rev 293813)
+++ trunk/Source/WebCore/platform/graphics/Font.cpp	2022-05-05 02:37:47 UTC (rev 293814)
@@ -44,6 +44,7 @@
 #include <wtf/MathExtras.h>
 #include <wtf/NeverDestroyed.h>
 #include <wtf/text/AtomStringHash.h>
+#include <wtf/text/TextStream.h>
 
 #if ENABLE(OPENTYPE_VERTICAL)
 #include "OpenTypeVerticalData.h"
@@ -710,4 +711,12 @@
     return *m_glyphPathMap.existingMetricsForGlyph(glyph);
 }
 
+#if !LOG_DISABLED
+TextStream& operator<<(TextStream& ts, const Font& font)
+{
+    ts << font.description();
+    return ts;
+}
+#endif
+
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/Font.h (293813 => 293814)


--- trunk/Source/WebCore/platform/graphics/Font.h	2022-05-05 02:21:35 UTC (rev 293813)
+++ trunk/Source/WebCore/platform/graphics/Font.h	2022-05-05 02:37:47 UTC (rev 293814)
@@ -49,6 +49,10 @@
 #include <usp10.h>
 #endif
 
+namespace WTF {
+class TextStream;
+}
+
 namespace WebCore {
 
 class FontCache;
@@ -393,6 +397,10 @@
     return width + (SyntheticBoldInclusion == SyntheticBoldInclusion::Incorporate ? syntheticBoldOffset() : 0);
 }
 
+#if !LOG_DISABLED
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const Font&);
+#endif
+
 } // namespace WebCore
 
 namespace WTF {

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp (293813 => 293814)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-05 02:21:35 UTC (rev 293813)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.cpp	2022-05-05 02:37:47 UTC (rev 293814)
@@ -59,95 +59,41 @@
     context.translate(m_x, m_y);
 }
 
-static TextStream& operator<<(TextStream& ts, const Translate& item)
-{
-    ts.dumpProperty("x", item.x());
-    ts.dumpProperty("y", item.y());
-
-    return ts;
-}
-
 void Rotate::apply(GraphicsContext& context) const
 {
     context.rotate(m_angle);
 }
 
-static TextStream& operator<<(TextStream& ts, const Rotate& item)
-{
-    ts.dumpProperty("angle", item.angle());
-
-    return ts;
-}
-
 void Scale::apply(GraphicsContext& context) const
 {
     context.scale(m_size);
 }
 
-static TextStream& operator<<(TextStream& ts, const Scale& item)
-{
-    ts.dumpProperty("size", item.amount());
-
-    return ts;
-}
-
 void SetCTM::apply(GraphicsContext& context) const
 {
     context.setCTM(m_transform);
 }
 
-static TextStream& operator<<(TextStream& ts, const SetCTM& item)
-{
-    ts.dumpProperty("set-ctm", item.transform());
-
-    return ts;
-}
-
 void ConcatenateCTM::apply(GraphicsContext& context) const
 {
     context.concatCTM(m_transform);
 }
 
-static TextStream& operator<<(TextStream& ts, const ConcatenateCTM& item)
-{
-    ts.dumpProperty("ctm", item.transform());
-
-    return ts;
-}
-
 void SetInlineFillColor::apply(GraphicsContext& context) const
 {
     context.setFillColor(color());
 }
 
-static TextStream& operator<<(TextStream& ts, const SetInlineFillColor& state)
-{
-    ts.dumpProperty("color", state.color());
-    return ts;
-}
-
 void SetInlineStrokeColor::apply(GraphicsContext& context) const
 {
     context.setStrokeColor(color());
 }
 
-static TextStream& operator<<(TextStream& ts, const SetInlineStrokeColor& state)
-{
-    ts.dumpProperty("color", state.color());
-    return ts;
-}
-
 void SetStrokeThickness::apply(GraphicsContext& context) const
 {
     context.setStrokeThickness(m_thickness);
 }
 
-static TextStream& operator<<(TextStream& ts, const SetStrokeThickness& state)
-{
-    ts.dumpProperty("thickness", state.thickness());
-    return ts;
-}
-
 SetState::SetState(const GraphicsContextState& state)
     : m_state(state)
 {
@@ -158,57 +104,26 @@
     context.updateState(m_state);
 }
 
-static TextStream& operator<<(TextStream& ts, const SetState& item)
-{
-    ts << item.state();
-    return ts;
-}
-
 void SetLineCap::apply(GraphicsContext& context) const
 {
     context.setLineCap(m_lineCap);
 }
 
-static TextStream& operator<<(TextStream& ts, const SetLineCap& lineCap)
-{
-    ts.dumpProperty("line-cap", lineCap.lineCap());
-    return ts;
-}
-
 void SetLineDash::apply(GraphicsContext& context) const
 {
     context.setLineDash(m_dashArray, m_dashOffset);
 }
 
-static TextStream& operator<<(TextStream& ts, const SetLineDash& lineDash)
-{
-    ts.dumpProperty("dash-array", lineDash.dashArray());
-    ts.dumpProperty("dash-offset", lineDash.dashOffset());
-    return ts;
-}
-
 void SetLineJoin::apply(GraphicsContext& context) const
 {
     context.setLineJoin(m_lineJoin);
 }
 
-static TextStream& operator<<(TextStream& ts, const SetLineJoin& lineJoin)
-{
-    ts.dumpProperty("line-join", lineJoin.lineJoin());
-    return ts;
-}
-
 void SetMiterLimit::apply(GraphicsContext& context) const
 {
     context.setMiterLimit(m_miterLimit);
 }
 
-static TextStream& operator<<(TextStream& ts, const SetMiterLimit& miterLimit)
-{
-    ts.dumpProperty("mitre-limit", miterLimit.miterLimit());
-    return ts;
-}
-
 void ClearShadow::apply(GraphicsContext& context) const
 {
     context.clearShadow();
@@ -219,23 +134,11 @@
     context.clip(m_rect);
 }
 
-static TextStream& operator<<(TextStream& ts, const Clip& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 void ClipOut::apply(GraphicsContext& context) const
 {
     context.clipOut(m_rect);
 }
 
-static TextStream& operator<<(TextStream& ts, const ClipOut& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 NO_RETURN_DUE_TO_ASSERT void ClipToImageBuffer::apply(GraphicsContext&) const
 {
     ASSERT_NOT_REACHED();
@@ -246,36 +149,16 @@
     context.clipToImageBuffer(imageBuffer, m_destinationRect);
 }
 
-static TextStream& operator<<(TextStream& ts, const ClipToImageBuffer& item)
-{
-    ts.dumpProperty("image-buffer-identifier", item.imageBufferIdentifier());
-    ts.dumpProperty("dest-rect", item.destinationRect());
-    return ts;
-}
-
 void ClipOutToPath::apply(GraphicsContext& context) const
 {
     context.clipOut(m_path);
 }
 
-static TextStream& operator<<(TextStream& ts, const ClipOutToPath& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 void ClipPath::apply(GraphicsContext& context) const
 {
     context.clipPath(m_path, m_windRule);
 }
 
-static TextStream& operator<<(TextStream& ts, const ClipPath& item)
-{
-    ts.dumpProperty("path", item.path());
-    ts.dumpProperty("wind-rule", item.windRule());
-    return ts;
-}
-
 DrawFilteredImageBuffer::DrawFilteredImageBuffer(std::optional<RenderingResourceIdentifier> sourceImageIdentifier, const FloatRect& sourceImageRect, Filter& filter)
     : m_sourceImageIdentifier(sourceImageIdentifier)
     , m_sourceImageRect(sourceImageRect)
@@ -293,13 +176,6 @@
     context.drawFilteredImageBuffer(sourceImage, m_sourceImageRect, m_filter, results);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawFilteredImageBuffer& item)
-{
-    ts.dumpProperty("source-image-identifier", item.sourceImageIdentifier());
-    ts.dumpProperty("source-image-rect", item.sourceImageRect());
-    return ts;
-}
-
 DrawGlyphs::DrawGlyphs(RenderingResourceIdentifier fontIdentifier, Vector<GlyphBufferGlyph, 128>&& glyphs, Vector<GlyphBufferAdvance, 128>&& advances, const FloatRect& bounds, const FloatPoint& localAnchor, FontSmoothingMode smoothingMode)
     : m_fontIdentifier(fontIdentifier)
     , m_glyphs(WTFMove(glyphs))
@@ -346,16 +222,6 @@
     }
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawGlyphs& item)
-{
-    // FIXME: dump more stuff.
-    ts.dumpProperty("local-anchor", item.localAnchor());
-    ts.dumpProperty("anchor-point", item.anchorPoint());
-    ts.dumpProperty("length", item.glyphs().size());
-
-    return ts;
-}
-
 NO_RETURN_DUE_TO_ASSERT void DrawImageBuffer::apply(GraphicsContext&) const
 {
     ASSERT_NOT_REACHED();
@@ -366,14 +232,6 @@
     context.drawImageBuffer(imageBuffer, m_destinationRect, m_srcRect, m_options);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawImageBuffer& item)
-{
-    ts.dumpProperty("image-buffer-identifier", item.imageBufferIdentifier());
-    ts.dumpProperty("source-rect", item.source());
-    ts.dumpProperty("dest-rect", item.destinationRect());
-    return ts;
-}
-
 NO_RETURN_DUE_TO_ASSERT void DrawNativeImage::apply(GraphicsContext&) const
 {
     ASSERT_NOT_REACHED();
@@ -384,27 +242,11 @@
     context.drawNativeImage(image, m_imageSize, m_destinationRect, m_srcRect, m_options);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawNativeImage& item)
-{
-    // FIXME: dump more stuff.
-    ts.dumpProperty("image-identifier", item.imageIdentifier());
-    ts.dumpProperty("source-rect", item.source());
-    ts.dumpProperty("dest-rect", item.destinationRect());
-    return ts;
-}
-
 void DrawSystemImage::apply(GraphicsContext& context) const
 {
     context.drawSystemImage(m_systemImage, m_destinationRect);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawSystemImage& item)
-{
-    // FIXME: dump more stuff.
-    ts.dumpProperty("destination", item.destinationRect());
-    return ts;
-}
-
 DrawPattern::DrawPattern(RenderingResourceIdentifier imageIdentifier, const FloatRect& destRect, const FloatRect& tileRect, const AffineTransform& patternTransform, const FloatPoint& phase, const FloatSize& spacing, const ImagePaintingOptions& options)
     : m_imageIdentifier(imageIdentifier)
     , m_destination(destRect)
@@ -436,29 +278,11 @@
     ASSERT_NOT_REACHED();
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawPattern& item)
-{
-    ts.dumpProperty("image-identifier", item.imageIdentifier());
-    ts.dumpProperty("pattern-transform", item.patternTransform());
-    ts.dumpProperty("tile-rect", item.tileRect());
-    ts.dumpProperty("dest-rect", item.destRect());
-    ts.dumpProperty("phase", item.phase());
-    ts.dumpProperty("spacing", item.spacing());
-    return ts;
-}
-
 void DrawRect::apply(GraphicsContext& context) const
 {
     context.drawRect(m_rect, m_borderThickness);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawRect& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    ts.dumpProperty("border-thickness", item.borderThickness());
-    return ts;
-}
-
 std::optional<FloatRect> DrawLine::localBounds(const GraphicsContext&) const
 {
     FloatRect bounds;
@@ -471,13 +295,6 @@
     context.drawLine(m_point1, m_point2);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawLine& item)
-{
-    ts.dumpProperty("point-1", item.point1());
-    ts.dumpProperty("point-2", item.point2());
-    return ts;
-}
-
 DrawLinesForText::DrawLinesForText(const FloatPoint& blockLocation, const FloatSize& localAnchor, float thickness, const DashArray& widths, bool printing, bool doubleLines, StrokeStyle style)
     : m_blockLocation(blockLocation)
     , m_localAnchor(localAnchor)
@@ -506,19 +323,6 @@
     return result;
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawLinesForText& item)
-{
-    ts.dumpProperty("block-location", item.blockLocation());
-    ts.dumpProperty("local-anchor", item.localAnchor());
-    ts.dumpProperty("point", item.point());
-    ts.dumpProperty("thickness", item.thickness());
-    ts.dumpProperty("double", item.doubleLines());
-    ts.dumpProperty("widths", item.widths());
-    ts.dumpProperty("is-printing", item.isPrinting());
-    ts.dumpProperty("double", item.doubleLines());
-    return ts;
-}
-
 void DrawDotsForDocumentMarker::apply(GraphicsContext& context) const
 {
     context.drawDotsForDocumentMarker(m_rect, {
@@ -532,34 +336,16 @@
     return m_rect;
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawDotsForDocumentMarker& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 void DrawEllipse::apply(GraphicsContext& context) const
 {
     context.drawEllipse(m_rect);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawEllipse& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 void DrawPath::apply(GraphicsContext& context) const
 {
     context.drawPath(m_path);
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawPath&)
-{
-    // FIXME: add logging for paths.
-    return ts;
-}
-
 void DrawFocusRingPath::apply(GraphicsContext& context) const
 {
     context.drawFocusRing(m_path, m_width, m_offset, m_color);
@@ -572,15 +358,6 @@
     return result;
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawFocusRingPath& item)
-{
-//    ts.dumpProperty("path", item.path()); // FIXME: add logging for paths.
-    ts.dumpProperty("width", item.width());
-    ts.dumpProperty("offset", item.offset());
-    ts.dumpProperty("color", item.color());
-    return ts;
-}
-
 DrawFocusRingRects::DrawFocusRingRects(const Vector<FloatRect>& rects, float width, float offset, const Color& color)
     : m_rects(rects)
     , m_width(width)
@@ -603,38 +380,16 @@
     return result;
 }
 
-static TextStream& operator<<(TextStream& ts, const DrawFocusRingRects& item)
-{
-    ts.dumpProperty("rects", item.rects());
-    ts.dumpProperty("width", item.width());
-    ts.dumpProperty("offset", item.offset());
-    ts.dumpProperty("color", item.color());
-    return ts;
-}
-
 void FillRect::apply(GraphicsContext& context) const
 {
     context.fillRect(m_rect);
 }
 
-static TextStream& operator<<(TextStream& ts, const FillRect& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 void FillRectWithColor::apply(GraphicsContext& context) const
 {
     context.fillRect(m_rect, m_color);
 }
 
-static TextStream& operator<<(TextStream& ts, const FillRectWithColor& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    ts.dumpProperty("color", item.color());
-    return ts;
-}
-
 FillRectWithGradient::FillRectWithGradient(const FloatRect& rect, Gradient& gradient)
     : m_rect(rect)
     , m_gradient(gradient)
@@ -646,53 +401,21 @@
     context.fillRect(m_rect, m_gradient.get());
 }
 
-static TextStream& operator<<(TextStream& ts, const FillRectWithGradient& item)
-{
-    // FIXME: log gradient.
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 void FillCompositedRect::apply(GraphicsContext& context) const
 {
     context.fillRect(m_rect, m_color, m_op, m_blendMode);
 }
 
-static TextStream& operator<<(TextStream& ts, const FillCompositedRect& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    ts.dumpProperty("color", item.color());
-    ts.dumpProperty("composite-operation", item.compositeOperator());
-    ts.dumpProperty("blend-mode", item.blendMode());
-    return ts;
-}
-
 void FillRoundedRect::apply(GraphicsContext& context) const
 {
     context.fillRoundedRect(m_rect, m_color, m_blendMode);
 }
 
-static TextStream& operator<<(TextStream& ts, const FillRoundedRect& item)
-{
-    ts.dumpProperty("rect", item.roundedRect());
-    ts.dumpProperty("color", item.color());
-    ts.dumpProperty("blend-mode", item.blendMode());
-    return ts;
-}
-
 void FillRectWithRoundedHole::apply(GraphicsContext& context) const
 {
     context.fillRectWithRoundedHole(m_rect, m_roundedHoleRect, m_color);
 }
 
-static TextStream& operator<<(TextStream& ts, const FillRectWithRoundedHole& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    ts.dumpProperty("rounded-hole-rect", item.roundedHoleRect());
-    ts.dumpProperty("color", item.color());
-    return ts;
-}
-
 #if ENABLE(INLINE_PATH_DATA)
 
 void FillLine::apply(GraphicsContext& context) const
@@ -700,45 +423,21 @@
     context.fillPath(path());
 }
 
-static TextStream& operator<<(TextStream& ts, const FillLine& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 void FillArc::apply(GraphicsContext& context) const
 {
     context.fillPath(path());
 }
 
-static TextStream& operator<<(TextStream& ts, const FillArc& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 void FillQuadCurve::apply(GraphicsContext& context) const
 {
     context.fillPath(path());
 }
 
-static TextStream& operator<<(TextStream& ts, const FillQuadCurve& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 void FillBezierCurve::apply(GraphicsContext& context) const
 {
     context.fillPath(path());
 }
 
-static TextStream& operator<<(TextStream& ts, const FillBezierCurve& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 #endif // ENABLE(INLINE_PATH_DATA)
 
 void FillPath::apply(GraphicsContext& context) const
@@ -746,23 +445,11 @@
     context.fillPath(m_path);
 }
 
-static TextStream& operator<<(TextStream& ts, const FillPath& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 void FillEllipse::apply(GraphicsContext& context) const
 {
     context.fillEllipse(m_rect);
 }
 
-static TextStream& operator<<(TextStream& ts, const FillEllipse& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 #if ENABLE(VIDEO)
 PaintFrameForMedia::PaintFrameForMedia(MediaPlayer& player, const FloatRect& destination)
     : m_identifier(player.identifier())
@@ -776,11 +463,6 @@
     ASSERT_NOT_REACHED();
 }
 
-static TextStream& operator<<(TextStream& ts, const PaintFrameForMedia& item)
-{
-    ts.dumpProperty("destination", item.destination());
-    return ts;
-}
 #endif
 
 std::optional<FloatRect> StrokeRect::localBounds(const GraphicsContext&) const
@@ -795,13 +477,6 @@
     context.strokeRect(m_rect, m_lineWidth);
 }
 
-static TextStream& operator<<(TextStream& ts, const StrokeRect& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    ts.dumpProperty("line-width", item.lineWidth());
-    return ts;
-}
-
 std::optional<FloatRect> StrokePath::localBounds(const GraphicsContext& context) const
 {
     // FIXME: Need to take stroke thickness into account correctly, via CGPathByStrokingPath().
@@ -817,12 +492,6 @@
     context.strokePath(m_path);
 }
 
-static TextStream& operator<<(TextStream& ts, const StrokePath& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 std::optional<FloatRect> StrokeEllipse::localBounds(const GraphicsContext& context) const
 {
     float strokeThickness = context.strokeThickness();
@@ -837,12 +506,6 @@
     context.strokeEllipse(m_rect);
 }
 
-static TextStream& operator<<(TextStream& ts, const StrokeEllipse& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 std::optional<FloatRect> StrokeLine::localBounds(const GraphicsContext& context) const
 {
     float strokeThickness = context.strokeThickness();
@@ -865,13 +528,6 @@
     context.strokePath(path);
 }
 
-static TextStream& operator<<(TextStream& ts, const StrokeLine& item)
-{
-    ts.dumpProperty("start", item.start());
-    ts.dumpProperty("end", item.end());
-    return ts;
-}
-
 #if ENABLE(INLINE_PATH_DATA)
 
 std::optional<FloatRect> StrokeArc::localBounds(const GraphicsContext& context) const
@@ -889,12 +545,6 @@
     context.strokePath(path());
 }
 
-static TextStream& operator<<(TextStream& ts, const StrokeArc& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 std::optional<FloatRect> StrokeQuadCurve::localBounds(const GraphicsContext& context) const
 {
     // FIXME: Need to take stroke thickness into account correctly, via CGPathByStrokingPath().
@@ -910,12 +560,6 @@
     context.strokePath(path());
 }
 
-static TextStream& operator<<(TextStream& ts, const StrokeQuadCurve& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 std::optional<FloatRect> StrokeBezierCurve::localBounds(const GraphicsContext& context) const
 {
     // FIXME: Need to take stroke thickness into account correctly, via CGPathByStrokingPath().
@@ -931,12 +575,6 @@
     context.strokePath(path());
 }
 
-static TextStream& operator<<(TextStream& ts, const StrokeBezierCurve& item)
-{
-    ts.dumpProperty("path", item.path());
-    return ts;
-}
-
 #endif // ENABLE(INLINE_PATH_DATA)
 
 void ClearRect::apply(GraphicsContext& context) const
@@ -944,23 +582,11 @@
     context.clearRect(m_rect);
 }
 
-static TextStream& operator<<(TextStream& ts, const ClearRect& item)
-{
-    ts.dumpProperty("rect", item.rect());
-    return ts;
-}
-
 void BeginTransparencyLayer::apply(GraphicsContext& context) const
 {
     context.beginTransparencyLayer(m_opacity);
 }
 
-static TextStream& operator<<(TextStream& ts, const BeginTransparencyLayer& item)
-{
-    ts.dumpProperty("opacity", item.opacity());
-    return ts;
-}
-
 void EndTransparencyLayer::apply(GraphicsContext& context) const
 {
     if (context.isInTransparencyLayer())
@@ -985,12 +611,7 @@
     context.applyDeviceScaleFactor(m_scaleFactor);
 }
 
-static TextStream& operator<<(TextStream& ts, const ApplyDeviceScaleFactor& item)
-{
-    ts.dumpProperty("scale-factor", item.scaleFactor());
-    return ts;
-}
-
+#if !LOG_DISABLED
 static TextStream& operator<<(TextStream& ts, ItemType type)
 {
     switch (type) {
@@ -1067,6 +688,390 @@
     return ts;
 }
 
+TextStream& operator<<(TextStream& ts, const Translate& item)
+{
+    ts.dumpProperty("x", item.x());
+    ts.dumpProperty("y", item.y());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const Rotate& item)
+{
+    ts.dumpProperty("angle", item.angle());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const Scale& item)
+{
+    ts.dumpProperty("size", item.amount());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetCTM& item)
+{
+    ts.dumpProperty("set-ctm", item.transform());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const ConcatenateCTM& item)
+{
+    ts.dumpProperty("ctm", item.transform());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetInlineFillColor& state)
+{
+    ts.dumpProperty("color", state.color());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetInlineStrokeColor& state)
+{
+    ts.dumpProperty("color", state.color());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetStrokeThickness& state)
+{
+    ts.dumpProperty("thickness", state.thickness());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetState& item)
+{
+    ts << item.state();
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetLineCap& lineCap)
+{
+    ts.dumpProperty("line-cap", lineCap.lineCap());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetLineDash& lineDash)
+{
+    ts.dumpProperty("dash-array", lineDash.dashArray());
+    ts.dumpProperty("dash-offset", lineDash.dashOffset());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetLineJoin& lineJoin)
+{
+    ts.dumpProperty("line-join", lineJoin.lineJoin());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const SetMiterLimit& miterLimit)
+{
+    ts.dumpProperty("mitre-limit", miterLimit.miterLimit());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const Clip& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const ClipOut& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const ClipToImageBuffer& item)
+{
+    ts.dumpProperty("image-buffer-identifier", item.imageBufferIdentifier());
+    ts.dumpProperty("dest-rect", item.destinationRect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const ClipOutToPath& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const ClipPath& item)
+{
+    ts.dumpProperty("path", item.path());
+    ts.dumpProperty("wind-rule", item.windRule());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawFilteredImageBuffer& item)
+{
+    ts.dumpProperty("source-image-identifier", item.sourceImageIdentifier());
+    ts.dumpProperty("source-image-rect", item.sourceImageRect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawGlyphs& item)
+{
+    // FIXME: dump more stuff.
+    ts.dumpProperty("local-anchor", item.localAnchor());
+    ts.dumpProperty("anchor-point", item.anchorPoint());
+    ts.dumpProperty("length", item.glyphs().size());
+
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawImageBuffer& item)
+{
+    ts.dumpProperty("image-buffer-identifier", item.imageBufferIdentifier());
+    ts.dumpProperty("source-rect", item.source());
+    ts.dumpProperty("dest-rect", item.destinationRect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawNativeImage& item)
+{
+    ts.dumpProperty("image-identifier", item.imageIdentifier());
+    ts.dumpProperty("source-rect", item.source());
+    ts.dumpProperty("dest-rect", item.destinationRect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawSystemImage& item)
+{
+    // FIXME: dump more stuff.
+    ts.dumpProperty("destination", item.destinationRect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawPattern& item)
+{
+    ts.dumpProperty("image-identifier", item.imageIdentifier());
+    ts.dumpProperty("pattern-transform", item.patternTransform());
+    ts.dumpProperty("tile-rect", item.tileRect());
+    ts.dumpProperty("dest-rect", item.destRect());
+    ts.dumpProperty("phase", item.phase());
+    ts.dumpProperty("spacing", item.spacing());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawRect& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    ts.dumpProperty("border-thickness", item.borderThickness());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawLine& item)
+{
+    ts.dumpProperty("point-1", item.point1());
+    ts.dumpProperty("point-2", item.point2());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawLinesForText& item)
+{
+    ts.dumpProperty("block-location", item.blockLocation());
+    ts.dumpProperty("local-anchor", item.localAnchor());
+    ts.dumpProperty("point", item.point());
+    ts.dumpProperty("thickness", item.thickness());
+    ts.dumpProperty("double", item.doubleLines());
+    ts.dumpProperty("widths", item.widths());
+    ts.dumpProperty("is-printing", item.isPrinting());
+    ts.dumpProperty("double", item.doubleLines());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawDotsForDocumentMarker& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawEllipse& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawPath& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawFocusRingPath& item)
+{
+    ts.dumpProperty("path", item.path());
+    ts.dumpProperty("width", item.width());
+    ts.dumpProperty("offset", item.offset());
+    ts.dumpProperty("color", item.color());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const DrawFocusRingRects& item)
+{
+    ts.dumpProperty("rects", item.rects());
+    ts.dumpProperty("width", item.width());
+    ts.dumpProperty("offset", item.offset());
+    ts.dumpProperty("color", item.color());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillRect& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillRectWithColor& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    ts.dumpProperty("color", item.color());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillRectWithGradient& item)
+{
+    // FIXME: log gradient.
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillCompositedRect& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    ts.dumpProperty("color", item.color());
+    ts.dumpProperty("composite-operation", item.compositeOperator());
+    ts.dumpProperty("blend-mode", item.blendMode());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillRoundedRect& item)
+{
+    ts.dumpProperty("rect", item.roundedRect());
+    ts.dumpProperty("color", item.color());
+    ts.dumpProperty("blend-mode", item.blendMode());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillRectWithRoundedHole& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    ts.dumpProperty("rounded-hole-rect", item.roundedHoleRect());
+    ts.dumpProperty("color", item.color());
+    return ts;
+}
+
+#if ENABLE(INLINE_PATH_DATA)
+
+TextStream& operator<<(TextStream& ts, const FillLine& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillArc& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillQuadCurve& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillBezierCurve& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const StrokeArc& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const StrokeQuadCurve& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const StrokeBezierCurve& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+#endif // ENABLE(INLINE_PATH_DATA)
+
+TextStream& operator<<(TextStream& ts, const FillPath& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const FillEllipse& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+#if ENABLE(VIDEO)
+
+TextStream& operator<<(TextStream& ts, const PaintFrameForMedia& item)
+{
+    ts.dumpProperty("destination", item.destination());
+    return ts;
+}
+
+#endif // ENABLE(VIDEO)
+
+
+TextStream& operator<<(TextStream& ts, const StrokeRect& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    ts.dumpProperty("line-width", item.lineWidth());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const StrokePath& item)
+{
+    ts.dumpProperty("path", item.path());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const StrokeEllipse& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const StrokeLine& item)
+{
+    ts.dumpProperty("start", item.start());
+    ts.dumpProperty("end", item.end());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const ClearRect& item)
+{
+    ts.dumpProperty("rect", item.rect());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const BeginTransparencyLayer& item)
+{
+    ts.dumpProperty("opacity", item.opacity());
+    return ts;
+}
+
+TextStream& operator<<(TextStream& ts, const ApplyDeviceScaleFactor& item)
+{
+    ts.dumpProperty("scale-factor", item.scaleFactor());
+    return ts;
+}
+
 TextStream& operator<<(TextStream& ts, ItemHandle item)
 {
     ts << item.type();
@@ -1257,6 +1262,7 @@
     }
     return ts;
 }
+#endif
 
-}
-}
+} // namespace DisplayList
+} // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h (293813 => 293814)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2022-05-05 02:21:35 UTC (rev 293813)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListItems.h	2022-05-05 02:37:47 UTC (rev 293814)
@@ -2050,7 +2050,69 @@
 size_t paddedSizeOfTypeAndItemInBytes(const DisplayListItem&);
 ItemType displayListItemType(const DisplayListItem&);
 
+#if !LOG_DISABLED
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const Translate&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const Rotate&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const Scale&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetCTM&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const ConcatenateCTM&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetInlineFillColor&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetInlineStrokeColor&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetStrokeThickness&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetState&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetLineCap&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetLineDash&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetLineJoin&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const SetMiterLimit&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const Clip&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const ClipOut&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const ClipToImageBuffer&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const ClipOutToPath&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const ClipPath&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawFilteredImageBuffer&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawGlyphs&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawImageBuffer&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawNativeImage&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawSystemImage&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawPattern&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawRect&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawLine&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawLinesForText&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawDotsForDocumentMarker&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawEllipse&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawPath&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawFocusRingPath&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const DrawFocusRingRects&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillRect&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillRectWithColor&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillRectWithGradient&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillCompositedRect&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillRoundedRect&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillRectWithRoundedHole&);
+#if ENABLE(INLINE_PATH_DATA)
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillLine&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillArc&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillQuadCurve&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillBezierCurve&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StrokeArc&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StrokeQuadCurve&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StrokeBezierCurve&);
+#endif // ENABLE(INLINE_PATH_DATA)
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillPath&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const FillEllipse&);
+#if ENABLE(VIDEO)
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const PaintFrameForMedia&);
+#endif // ENABLE(VIDEO)
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StrokeRect&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StrokePath&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StrokeEllipse&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const StrokeLine&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const ClearRect&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const BeginTransparencyLayer&);
+WEBCORE_EXPORT TextStream& operator<<(TextStream&, const ApplyDeviceScaleFactor&);
+
 TextStream& operator<<(TextStream&, ItemHandle);
+#endif
 
 } // namespace DisplayList
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to