Changeset 245336 in webkit
- Timestamp:
- May 15, 2019, 11:53:45 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 7 edited
-
WTF/ChangeLog (modified) (1 diff)
-
WTF/wtf/text/TextStream.h (modified) (1 diff)
-
WebCore/ChangeLog (modified) (1 diff)
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/pal/LogMacros.h (modified) (1 diff)
-
WebCore/rendering/RenderLayer.cpp (modified) (3 diffs)
-
WebCore/rendering/RenderLayerCompositor.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r245325 r245336 1 2019-05-15 Simon Fraser <simon.fraser@apple.com> 2 3 Make LOG_WITH_STREAM more efficient 4 https://bugs.webkit.org/show_bug.cgi?id=197905 5 6 Reviewed by Alex Christensen. 7 8 Add a streamable repeat() class that can be used to output a series of characters. 9 This is useful for indenting output. 10 11 * wtf/text/TextStream.h: 12 (WTF::TextStream::repeat::repeat): 13 (WTF::TextStream::operator<<): 14 1 15 2019-05-15 Víctor Manuel Jáquez Leal <vjaquez@igalia.com> 2 16 -
trunk/Source/WTF/wtf/text/TextStream.h
r225220 r245336 103 103 } 104 104 105 struct Repeat { 106 Repeat(unsigned inWidth, char inCharacter) 107 : width(inWidth), character(inCharacter) 108 { } 109 unsigned width { 0 }; 110 char character { ' ' }; 111 }; 112 113 TextStream& operator<<(const Repeat& repeated) 114 { 115 for (unsigned i = 0; i < repeated.width; ++i) 116 m_text.append(repeated.character); 117 118 return *this; 119 } 120 105 121 class IndentScope { 106 122 public: -
trunk/Source/WebCore/ChangeLog
r245335 r245336 23 23 (WebCore::MockRealtimeMediaSourceCenter::mockRealtimeMediaSourceCenterEnabled): 24 24 * platform/mock/MockRealtimeMediaSourceCenter.h: 25 26 2019-05-15 Simon Fraser <simon.fraser@apple.com> 27 28 Make LOG_WITH_STREAM more efficient 29 https://bugs.webkit.org/show_bug.cgi?id=197905 30 31 Reviewed by Alex Christensen. 32 33 No longer need to conditionalize ClipRects logging on the channel being enabled 34 since LOG_WITH_STREAM fix the performance problem. 35 36 Convert some RenderLayerCompositor logging to use LOG_WITH_STREAM. 37 38 * rendering/RenderLayer.cpp: 39 (WebCore::RenderLayer::calculateClipRects const): 40 (WebCore::clipRectsLogEnabled): Deleted. 41 * rendering/RenderLayerCompositor.cpp: 42 (WebCore::RenderLayerCompositor::computeCompositingRequirements): 43 (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): 25 44 26 45 2019-05-15 Simon Fraser <simon.fraser@apple.com> -
trunk/Source/WebCore/PAL/ChangeLog
r245183 r245336 1 2019-05-15 Simon Fraser <simon.fraser@apple.com> 2 3 Make LOG_WITH_STREAM more efficient 4 https://bugs.webkit.org/show_bug.cgi?id=197905 5 6 Reviewed by Alex Christensen. 7 8 Make the LOG_WITH_STREAM macro check that the log channel is enabled before 9 building the stream. 10 11 * pal/LogMacros.h: 12 1 13 2019-05-10 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/Source/WebCore/PAL/pal/LogMacros.h
r223206 r245336 33 33 34 34 #define LOG_WITH_STREAM(channel, commands) do { \ 35 WTF::TextStream stream(WTF::TextStream::LineMode::SingleLine); \ 36 commands; \ 37 WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), "%s", stream.release().utf8().data()); \ 35 if (JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel).state == WTFLogChannelState::On) { \ 36 WTF::TextStream stream(WTF::TextStream::LineMode::SingleLine); \ 37 commands; \ 38 WTFLog(&JOIN_LOG_CHANNEL_WITH_PREFIX(LOG_CHANNEL_PREFIX, channel), "%s", stream.release().utf8().data()); \ 39 } \ 38 40 } while (0) 39 41 -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r245317 r245336 281 281 } 282 282 283 static bool clipRectsLogEnabled()284 {285 return LogClipRects.state == WTFLogChannelState::On;286 }287 283 #endif 288 284 … … 5630 5626 } 5631 5627 5632 #if !LOG_DISABLED 5633 if (clipRectsLogEnabled()) 5634 LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " calculateClipRects " << clipRects); 5635 #endif 5628 LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " calculateClipRects " << clipRects); 5636 5629 } 5637 5630 … … 5679 5672 backgroundClipRect.moveBy(view.frameView().scrollPositionForFixedPosition()); 5680 5673 5681 #if !LOG_DISABLED 5682 if (clipRectsLogEnabled()) 5683 LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " backgroundClipRect with context " << clipRectsContext << " returning " << backgroundClipRect); 5684 #endif 5674 LOG_WITH_STREAM(ClipRects, stream << "RenderLayer " << this << " backgroundClipRect with context " << clipRectsContext << " returning " << backgroundClipRect); 5685 5675 return backgroundClipRect; 5686 5676 } -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r245326 r245336 139 139 childState.hasNotIsolatedCompositedBlendingDescendants = false; // FIXME: should this only be reset for stacking contexts? 140 140 #endif 141 #if ENABLE(TREE_DEBUGGING)141 #if !LOG_DISABLED 142 142 childState.depth = depth + 1; 143 143 #endif … … 168 168 bool hasNotIsolatedCompositedBlendingDescendants { false }; 169 169 #endif 170 #if ENABLE(TREE_DEBUGGING)171 intdepth { 0 };170 #if !LOG_DISABLED 171 unsigned depth { 0 }; 172 172 #endif 173 173 }; … … 831 831 } 832 832 833 #if ENABLE(TREE_DEBUGGING) 834 LOG(Compositing, "%*p %s computeCompositingRequirements (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, layer.isNormalFlowOnly() ? "n" : "s", backingSharingState.backingProviderCandidate()); 835 #endif 833 LOG_WITH_STREAM(Compositing, stream << TextStream::Repeat(compositingState.depth * 2, ' ') << &layer << (layer.isNormalFlowOnly() ? " n" : " s") << " computeCompositingRequirements (backing provider candidate " << backingSharingState.backingProviderCandidate() << ")"); 836 834 837 835 // FIXME: maybe we can avoid updating all remaining layers in paint order. … … 1061 1059 } 1062 1060 1063 #if ENABLE(TREE_DEBUGGING)1064 LOG(Compositing, "%*p computeCompositingRequirements - willBeComposited %d (backing provider candidate %p)", 12 + compositingState.depth * 2, &layer, willBeComposited, backingSharingState.backingProviderCandidate());1065 #endif1066 1067 1061 layer.clearCompositingRequirementsTraversalState(); 1068 1069 1062 overlapMap.geometryMap().popMappingsToAncestor(ancestorLayer); 1063 1064 LOG_WITH_STREAM(Compositing, stream << TextStream::Repeat(compositingState.depth * 2, ' ') << &layer << " computeCompositingRequirements - willBeComposited " << willBeComposited << " (backing provider candidate " << backingSharingState.backingProviderCandidate() << ")"); 1070 1065 } 1071 1066 … … 1077 1072 ASSERT(!layer.needsCompositingRequirementsTraversal()); 1078 1073 1079 #if ENABLE(TREE_DEBUGGING) 1080 LOG(Compositing, "%*p traverseUnchangedSubtree", 12 + compositingState.depth * 2, &layer); 1081 #endif 1074 LOG_WITH_STREAM(Compositing, stream << TextStream::Repeat(compositingState.depth * 2, ' ') << &layer << (layer.isNormalFlowOnly() ? " n" : " s") << " traverseUnchangedSubtree"); 1082 1075 1083 1076 layer.updateDescendantDependentFlags();
Note:
See TracChangeset
for help on using the changeset viewer.