Changeset 244900 in webkit


Ignore:
Timestamp:
May 2, 2019 10:01:49 PM (5 years ago)
Author:
Simon Fraser
Message:

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.

  • platform/Logging.h:
  • rendering/ClipRect.cpp:

(WebCore::operator<<):

  • rendering/ClipRect.h:
  • rendering/RenderLayer.cpp:

(WebCore::operator<<):
(WebCore::RenderLayer::calculateClipRects const):

  • rendering/RenderLayer.h:
Location:
trunk/Source/WebCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r244899 r244900  
     12019-05-02  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Add logging for RenderLayer clip rects
     4        https://bugs.webkit.org/show_bug.cgi?id=197547
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        Add a ClipRects log channel, and stream output for ClipRect and ClipRects.
     9
     10        * platform/Logging.h:
     11        * rendering/ClipRect.cpp:
     12        (WebCore::operator<<):
     13        * rendering/ClipRect.h:
     14        * rendering/RenderLayer.cpp:
     15        (WebCore::operator<<):
     16        (WebCore::RenderLayer::calculateClipRects const):
     17        * rendering/RenderLayer.h:
     18
    1192019-05-02  Youenn Fablet  <youenn@apple.com>
    220
  • trunk/Source/WebCore/platform/Logging.h

    r244818 r244900  
    4343    M(ApplePay) \
    4444    M(Archives) \
     45    M(ClipRects) \
    4546    M(Compositing) \
    4647    M(ContentFiltering) \
  • trunk/Source/WebCore/rendering/ClipRect.cpp

    r178574 r244900  
    3939}
    4040
     41TextStream& operator<<(TextStream& ts, const ClipRect& clipRect)
     42{
     43    ts << "rect ";
     44    if (clipRect.isInfinite())
     45        ts << "infinite";
     46    else
     47        ts << clipRect.rect();
     48
     49    if (clipRect.affectedByRadius())
     50        ts << " affected by radius";
     51    return ts;
    4152}
     53
     54}
  • trunk/Source/WebCore/rendering/ClipRect.h

    r208668 r244900  
    2727
    2828#include "LayoutRect.h"
     29
     30namespace WTF {
     31class TextStream;
     32}
    2933
    3034namespace WebCore {
     
    104108}
    105109
     110WTF::TextStream& operator<<(WTF::TextStream&, const ClipRect&);
     111
    106112} // namespace WebCore
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r244851 r244900  
    269269}
    270270
     271#if !LOG_DISABLED
     272static TextStream& operator<<(TextStream& ts, const ClipRects& clipRects)
     273{
     274    TextStream::GroupScope scope(ts);
     275    ts << indent << "ClipRects\n";
     276    ts << indent << "  overflow  : " << clipRects.overflowClipRect() << "\n";
     277    ts << indent << "  fixed     : " << clipRects.fixedClipRect() << "\n";
     278    ts << indent << "  positioned: " << clipRects.posClipRect() << "\n";
     279
     280    return ts;
     281}
     282#endif
     283
    271284RenderLayer::RenderLayer(RenderLayerModelObject& rendererLayerModelObject)
    272285    : m_isRenderViewLayer(rendererLayerModelObject.isRenderView())
     
    55295542        }
    55305543    }
     5544   
     5545    LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " calculateClipRects " << clipRects);
    55315546}
    55325547
     
    55785593    if (parentRects->fixed() && &clipRectsContext.rootLayer->renderer() == &view && !backgroundClipRect.isInfinite())
    55795594        backgroundClipRect.moveBy(view.frameView().scrollPositionForFixedPosition());
     5595
     5596    LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " backgroundClipRect with context " << clipRectsContext << " returning " << backgroundClipRect);
    55805597    return backgroundClipRect;
    55815598}
     
    67406757}
    67416758
     6759TextStream& operator<<(WTF::TextStream& ts, ClipRectsType clipRectsType)
     6760{
     6761    switch (clipRectsType) {
     6762    case PaintingClipRects: ts << "painting"; break;
     6763    case RootRelativeClipRects: ts << "root-relative"; break;
     6764    case AbsoluteClipRects: ts << "absolute"; break;
     6765    case TemporaryClipRects: ts << "temporary"; break;
     6766    case NumCachedClipRectsTypes:
     6767    case AllClipRectTypes:
     6768        ts << "?";
     6769        break;
     6770    }
     6771    return ts;
     6772}
     6773
    67426774TextStream& operator<<(TextStream& ts, const RenderLayer& layer)
    67436775{
     
    67586790}
    67596791
     6792TextStream& operator<<(TextStream& ts, const RenderLayer::ClipRectsContext& context)
     6793{
     6794    ts.dumpProperty("root layer:", context.rootLayer);
     6795    ts.dumpProperty("type:", context.clipRectsType);
     6796    ts.dumpProperty("overflow-clip:", context.respectOverflowClip == IgnoreOverflowClip ? "ignore" : "respect");
     6797   
     6798    return ts;
     6799}
     6800
    67606801} // namespace WebCore
    67616802
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r244509 r244900  
    13701370bool compositedWithOwnBackingStore(const RenderLayer&);
    13711371
     1372WTF::TextStream& operator<<(WTF::TextStream&, ClipRectsType);
    13721373WTF::TextStream& operator<<(WTF::TextStream&, const RenderLayer&);
     1374WTF::TextStream& operator<<(WTF::TextStream&, const RenderLayer::ClipRectsContext&);
    13731375
    13741376} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.