- Revision
- 245573
- Author
- [email protected]
- Date
- 2019-05-21 10:30:07 -0700 (Tue, 21 May 2019)
Log Message
Cherry-pick r245219. rdar://problem/50865946
Add logging for RenderLayer clip rects
https://bugs.webkit.org/show_bug.cgi?id=197547
Reviewed by Zalan Bujtas.
Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
The ClipRect code is performance sensitive, even in debug, so guard the log sites
with clipRectsLogEnabled() because the macro still evaluates its arguments even if
the channel is disabled (we need some better way to log that doesn't do this).
* platform/Logging.h:
* rendering/ClipRect.cpp:
(WebCore::operator<<):
* rendering/ClipRect.h:
* rendering/RenderLayer.cpp:
(WebCore::operator<<):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog (245572 => 245573)
--- branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog 2019-05-21 17:30:04 UTC (rev 245572)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/ChangeLog 2019-05-21 17:30:07 UTC (rev 245573)
@@ -1,5 +1,53 @@
2019-05-21 Kocsen Chung <[email protected]>
+ Cherry-pick r245219. rdar://problem/50865946
+
+ Add logging for RenderLayer clip rects
+ https://bugs.webkit.org/show_bug.cgi?id=197547
+
+ Reviewed by Zalan Bujtas.
+
+ Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
+
+ The ClipRect code is performance sensitive, even in debug, so guard the log sites
+ with clipRectsLogEnabled() because the macro still evaluates its arguments even if
+ the channel is disabled (we need some better way to log that doesn't do this).
+
+ * platform/Logging.h:
+ * rendering/ClipRect.cpp:
+ (WebCore::operator<<):
+ * rendering/ClipRect.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::operator<<):
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderLayer.h:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245219 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-05-02 Simon Fraser <[email protected]>
+
+ Add logging for RenderLayer clip rects
+ https://bugs.webkit.org/show_bug.cgi?id=197547
+
+ Reviewed by Zalan Bujtas.
+
+ Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
+
+ The ClipRect code is performance sensitive, even in debug, so guard the log sites
+ with clipRectsLogEnabled() because the macro still evaluates its arguments even if
+ the channel is disabled (we need some better way to log that doesn't do this).
+
+ * platform/Logging.h:
+ * rendering/ClipRect.cpp:
+ (WebCore::operator<<):
+ * rendering/ClipRect.h:
+ * rendering/RenderLayer.cpp:
+ (WebCore::operator<<):
+ (WebCore::RenderLayer::calculateClipRects const):
+ * rendering/RenderLayer.h:
+
+2019-05-21 Kocsen Chung <[email protected]>
+
Cherry-pick r245212. rdar://problem/50865946
Overflow scroll that becomes non-scrollable should stop being composited
Modified: branches/safari-608.1.24.20-branch/Source/WebCore/platform/Logging.h (245572 => 245573)
--- branches/safari-608.1.24.20-branch/Source/WebCore/platform/Logging.h 2019-05-21 17:30:04 UTC (rev 245572)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/platform/Logging.h 2019-05-21 17:30:07 UTC (rev 245573)
@@ -42,6 +42,7 @@
M(Animations) \
M(ApplePay) \
M(Archives) \
+ M(ClipRects) \
M(Compositing) \
M(ContentFiltering) \
M(ContentObservation) \
Modified: branches/safari-608.1.24.20-branch/Source/WebCore/rendering/ClipRect.cpp (245572 => 245573)
--- branches/safari-608.1.24.20-branch/Source/WebCore/rendering/ClipRect.cpp 2019-05-21 17:30:04 UTC (rev 245572)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/rendering/ClipRect.cpp 2019-05-21 17:30:07 UTC (rev 245573)
@@ -38,4 +38,17 @@
return hitTestLocation.intersects(m_rect);
}
+TextStream& operator<<(TextStream& ts, const ClipRect& clipRect)
+{
+ ts << "rect ";
+ if (clipRect.isInfinite())
+ ts << "infinite";
+ else
+ ts << clipRect.rect();
+
+ if (clipRect.affectedByRadius())
+ ts << " affected by radius";
+ return ts;
}
+
+}
Modified: branches/safari-608.1.24.20-branch/Source/WebCore/rendering/ClipRect.h (245572 => 245573)
--- branches/safari-608.1.24.20-branch/Source/WebCore/rendering/ClipRect.h 2019-05-21 17:30:04 UTC (rev 245572)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/rendering/ClipRect.h 2019-05-21 17:30:07 UTC (rev 245573)
@@ -27,6 +27,10 @@
#include "LayoutRect.h"
+namespace WTF {
+class TextStream;
+}
+
namespace WebCore {
class HitTestLocation;
@@ -103,4 +107,6 @@
return c;
}
+WTF::TextStream& operator<<(WTF::TextStream&, const ClipRect&);
+
} // namespace WebCore
Modified: branches/safari-608.1.24.20-branch/Source/WebCore/rendering/RenderLayer.cpp (245572 => 245573)
--- branches/safari-608.1.24.20-branch/Source/WebCore/rendering/RenderLayer.cpp 2019-05-21 17:30:04 UTC (rev 245572)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/rendering/RenderLayer.cpp 2019-05-21 17:30:07 UTC (rev 245573)
@@ -268,6 +268,24 @@
#endif
}
+#if !LOG_DISABLED
+static TextStream& operator<<(TextStream& ts, const ClipRects& clipRects)
+{
+ TextStream::GroupScope scope(ts);
+ ts << indent << "ClipRects\n";
+ ts << indent << " overflow : " << clipRects.overflowClipRect() << "\n";
+ ts << indent << " fixed : " << clipRects.fixedClipRect() << "\n";
+ ts << indent << " positioned: " << clipRects.posClipRect() << "\n";
+
+ return ts;
+}
+
+static bool clipRectsLogEnabled()
+{
+ return LogClipRects.state == WTFLogChannelState::On;
+}
+#endif
+
RenderLayer::RenderLayer(RenderLayerModelObject& rendererLayerModelObject)
: m_isRenderViewLayer(rendererLayerModelObject.isRenderView())
, m_forcedStackingContext(rendererLayerModelObject.isMedia())
@@ -5602,6 +5620,11 @@
clipRects.setFixedClipRect(intersection(newPosClip, clipRects.fixedClipRect()));
}
}
+
+#if !LOG_DISABLED
+ if (clipRectsLogEnabled())
+ LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " calculateClipRects " << clipRects);
+#endif
}
Ref<ClipRects> RenderLayer::parentClipRects(const ClipRectsContext& clipRectsContext) const
@@ -5646,6 +5669,11 @@
// Note: infinite clipRects should not be scrolled here, otherwise they will accidentally no longer be considered infinite.
if (parentRects->fixed() && &clipRectsContext.rootLayer->renderer() == &view && !backgroundClipRect.isInfinite())
backgroundClipRect.moveBy(view.frameView().scrollPositionForFixedPosition());
+
+#if !LOG_DISABLED
+ if (clipRectsLogEnabled())
+ LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " backgroundClipRect with context " << clipRectsContext << " returning " << backgroundClipRect);
+#endif
return backgroundClipRect;
}
@@ -6819,6 +6847,21 @@
#endif
}
+TextStream& operator<<(WTF::TextStream& ts, ClipRectsType clipRectsType)
+{
+ switch (clipRectsType) {
+ case PaintingClipRects: ts << "painting"; break;
+ case RootRelativeClipRects: ts << "root-relative"; break;
+ case AbsoluteClipRects: ts << "absolute"; break;
+ case TemporaryClipRects: ts << "temporary"; break;
+ case NumCachedClipRectsTypes:
+ case AllClipRectTypes:
+ ts << "?";
+ break;
+ }
+ return ts;
+}
+
TextStream& operator<<(TextStream& ts, const RenderLayer& layer)
{
ts << "RenderLayer " << &layer << " " << layer.size();
@@ -6837,6 +6880,15 @@
return ts;
}
+TextStream& operator<<(TextStream& ts, const RenderLayer::ClipRectsContext& context)
+{
+ ts.dumpProperty("root layer:", context.rootLayer);
+ ts.dumpProperty("type:", context.clipRectsType);
+ ts.dumpProperty("overflow-clip:", context.respectOverflowClip == IgnoreOverflowClip ? "ignore" : "respect");
+
+ return ts;
+}
+
} // namespace WebCore
#if ENABLE(TREE_DEBUGGING)
Modified: branches/safari-608.1.24.20-branch/Source/WebCore/rendering/RenderLayer.h (245572 => 245573)
--- branches/safari-608.1.24.20-branch/Source/WebCore/rendering/RenderLayer.h 2019-05-21 17:30:04 UTC (rev 245572)
+++ branches/safari-608.1.24.20-branch/Source/WebCore/rendering/RenderLayer.h 2019-05-21 17:30:07 UTC (rev 245573)
@@ -1384,7 +1384,9 @@
bool compositedWithOwnBackingStore(const RenderLayer&);
+WTF::TextStream& operator<<(WTF::TextStream&, ClipRectsType);
WTF::TextStream& operator<<(WTF::TextStream&, const RenderLayer&);
+WTF::TextStream& operator<<(WTF::TextStream&, const RenderLayer::ClipRectsContext&);
} // namespace WebCore