Changeset 249455 in webkit
- Timestamp:
- Sep 3, 2019 9:54:55 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r249453 r249455 1 2019-09-03 Antti Koivisto <antti@apple.com> 2 3 Remove redundant painting phase arguments from GraphicsLayerClient functions 4 https://bugs.webkit.org/show_bug.cgi?id=201443 5 6 Reviewed by Simon Fraser. 7 8 It is available from the GraphicsLayer. 9 10 * page/PageOverlayController.cpp: 11 (WebCore::PageOverlayController::paintContents): 12 * page/PageOverlayController.h: 13 * page/mac/ServicesOverlayController.h: 14 * page/mac/ServicesOverlayController.mm: 15 (WebCore::ServicesOverlayController::Highlight::paintContents): 16 * platform/graphics/GraphicsLayer.cpp: 17 (WebCore::GraphicsLayer::paintGraphicsLayerContents): 18 * platform/graphics/GraphicsLayerClient.h: 19 (WebCore::GraphicsLayerClient::paintContents): 20 * rendering/RenderLayerBacking.cpp: 21 (WebCore::RenderLayerBacking::paintIntoLayer): 22 (WebCore::RenderLayerBacking::paintFlagsForLayer const): 23 24 Factor into a function. 25 26 (WebCore::RenderLayerBacking::paintContents): 27 * rendering/RenderLayerBacking.h: 28 * rendering/RenderLayerCompositor.cpp: 29 (WebCore::RenderLayerCompositor::paintContents): 30 * rendering/RenderLayerCompositor.h: 31 1 32 2019-09-03 Myles C. Maxfield <mmaxfield@apple.com> 2 33 -
trunk/Source/WebCore/page/PageOverlayController.cpp
r246231 r249455 392 392 } 393 393 394 void PageOverlayController::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& clipRect, GraphicsLayerPaintBehavior)394 void PageOverlayController::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& graphicsContext, const FloatRect& clipRect, GraphicsLayerPaintBehavior) 395 395 { 396 396 for (auto& overlayAndGraphicsLayer : m_overlayGraphicsLayers) { -
trunk/Source/WebCore/page/PageOverlayController.h
r245950 r249455 94 94 // GraphicsLayerClient 95 95 void notifyFlushRequired(const GraphicsLayer*) override; 96 void paintContents(const GraphicsLayer*, GraphicsContext&, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& clipRect, GraphicsLayerPaintBehavior) override;96 void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& clipRect, GraphicsLayerPaintBehavior) override; 97 97 float deviceScaleFactor() const override; 98 98 bool shouldSkipLayerInDump(const GraphicsLayer*, LayerTreeAsTextBehavior) const override; -
trunk/Source/WebCore/page/linux/ResourceUsageOverlayLinux.cpp
r248846 r249455 86 86 87 87 private: 88 void paintContents(const GraphicsLayer*, GraphicsContext& context, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& clip, GraphicsLayerPaintBehavior) override88 void paintContents(const GraphicsLayer*, GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintBehavior) override 89 89 { 90 90 GraphicsContextStateSaver stateSaver(context); -
trunk/Source/WebCore/page/mac/ServicesOverlayController.h
r245950 r249455 83 83 // GraphicsLayerClient 84 84 void notifyFlushRequired(const GraphicsLayer*) override; 85 void paintContents(const GraphicsLayer*, GraphicsContext&, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& inClip, GraphicsLayerPaintBehavior) override;85 void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& inClip, GraphicsLayerPaintBehavior) override; 86 86 float deviceScaleFactor() const override; 87 87 -
trunk/Source/WebCore/page/mac/ServicesOverlayController.mm
r246231 r249455 125 125 } 126 126 127 void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect&, GraphicsLayerPaintBehavior)127 void ServicesOverlayController::Highlight::paintContents(const GraphicsLayer*, GraphicsContext& graphicsContext, const FloatRect&, GraphicsLayerPaintBehavior) 128 128 { 129 129 if (!DataDetectorsLibrary()) -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r248846 r249455 509 509 clipRect.move(offset); 510 510 511 client().paintContents(this, context, m_paintingPhase,clipRect, layerPaintBehavior);511 client().paintContents(this, context, clipRect, layerPaintBehavior); 512 512 } 513 513 -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r246668 r249455 103 103 virtual void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) { } 104 104 105 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& /* inClip */, GraphicsLayerPaintBehavior) { }105 virtual void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& /* inClip */, GraphicsLayerPaintBehavior) { } 106 106 virtual void didChangePlatformLayerForLayer(const GraphicsLayer*) { } 107 107 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r249440 r249455 2777 2777 void RenderLayerBacking::paintIntoLayer(const GraphicsLayer* graphicsLayer, GraphicsContext& context, 2778 2778 const IntRect& paintDirtyRect, // In the coords of rootLayer. 2779 OptionSet<PaintBehavior> paintBehavior , OptionSet<GraphicsLayerPaintingPhase> paintingPhase)2780 { 2781 if ((paintsIntoWindow() || paintsIntoCompositedAncestor()) && paintingPhase!= OptionSet<GraphicsLayerPaintingPhase>(GraphicsLayerPaintingPhase::ChildClippingMask)) {2779 OptionSet<PaintBehavior> paintBehavior) 2780 { 2781 if ((paintsIntoWindow() || paintsIntoCompositedAncestor()) && graphicsLayer->paintingPhase() != OptionSet<GraphicsLayerPaintingPhase>(GraphicsLayerPaintingPhase::ChildClippingMask)) { 2782 2782 #if !PLATFORM(IOS_FAMILY) && !OS(WINDOWS) 2783 2783 // FIXME: Looks like the CALayer tree is out of sync with the GraphicsLayer heirarchy … … 2789 2789 } 2790 2790 2791 auto paintFlags = paintFlagsForLayer(*graphicsLayer); 2792 2793 #ifndef NDEBUG 2794 RenderElement::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(&renderer()); 2795 #endif 2796 2797 auto paintOneLayer = [&](RenderLayer& layer, OptionSet<RenderLayer::PaintLayerFlag> paintFlags) { 2798 InspectorInstrumentation::willPaint(layer.renderer()); 2799 2800 FrameView::PaintingState paintingState; 2801 if (layer.isRenderViewLayer()) 2802 renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState); 2803 2804 RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer); 2805 2806 if (&layer == &m_owningLayer) { 2807 layer.paintLayerContents(context, paintingInfo, paintFlags); 2808 2809 if (layer.containsDirtyOverlayScrollbars()) 2810 layer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars); 2811 } else 2812 layer.paintLayerWithEffects(context, paintingInfo, paintFlags); 2813 2814 if (layer.isRenderViewLayer()) 2815 renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState); 2816 2817 ASSERT(!m_owningLayer.m_usedTransparency); 2818 2819 InspectorInstrumentation::didPaint(layer.renderer(), paintDirtyRect); 2820 }; 2821 2822 paintOneLayer(m_owningLayer, paintFlags); 2823 2824 // FIXME: Need to check m_foregroundLayer, masking etc. webkit.org/b/197565. 2825 GraphicsLayer* destinationForSharingLayers = m_scrolledContentsLayer ? m_scrolledContentsLayer.get() : m_graphicsLayer.get(); 2826 2827 if (graphicsLayer == destinationForSharingLayers) { 2828 OptionSet<RenderLayer::PaintLayerFlag> sharingLayerPaintFlags = { 2829 RenderLayer::PaintLayerPaintingCompositingBackgroundPhase, 2830 RenderLayer::PaintLayerPaintingCompositingForegroundPhase }; 2831 2832 if (graphicsLayer->paintingPhase().contains(GraphicsLayerPaintingPhase::OverflowContents)) 2833 sharingLayerPaintFlags.add(RenderLayer::PaintLayerPaintingOverflowContents); 2834 2835 for (auto& layerWeakPtr : m_backingSharingLayers) 2836 paintOneLayer(*layerWeakPtr, sharingLayerPaintFlags); 2837 } 2838 2839 compositor().didPaintBacking(this); 2840 } 2841 2842 OptionSet<RenderLayer::PaintLayerFlag> RenderLayerBacking::paintFlagsForLayer(const GraphicsLayer& graphicsLayer) const 2843 { 2791 2844 OptionSet<RenderLayer::PaintLayerFlag> paintFlags; 2845 2846 auto paintingPhase = graphicsLayer.paintingPhase(); 2792 2847 if (paintingPhase.contains(GraphicsLayerPaintingPhase::Background)) 2793 2848 paintFlags.add(RenderLayer::PaintLayerPaintingCompositingBackgroundPhase); … … 2805 2860 paintFlags.add(RenderLayer::PaintLayerPaintingCompositingScrollingPhase); 2806 2861 2807 if ( graphicsLayer == m_backgroundLayer.get() && m_backgroundLayerPaintsFixedRootBackground)2862 if (&graphicsLayer == m_backgroundLayer.get() && m_backgroundLayerPaintsFixedRootBackground) 2808 2863 paintFlags.add({ RenderLayer::PaintLayerPaintingRootBackgroundOnly, RenderLayer::PaintLayerPaintingCompositingForegroundPhase }); // Need PaintLayerPaintingCompositingForegroundPhase to walk child layers. 2809 2864 else if (compositor().fixedRootBackgroundLayer()) 2810 2865 paintFlags.add(RenderLayer::PaintLayerPaintingSkipRootBackground); 2811 2866 2812 #ifndef NDEBUG 2813 RenderElement::SetLayoutNeededForbiddenScope forbidSetNeedsLayout(&renderer()); 2814 #endif 2815 2816 auto paintOneLayer = [&](RenderLayer& layer, OptionSet<RenderLayer::PaintLayerFlag> paintFlags) { 2817 InspectorInstrumentation::willPaint(layer.renderer()); 2818 2819 FrameView::PaintingState paintingState; 2820 if (layer.isRenderViewLayer()) 2821 renderer().view().frameView().willPaintContents(context, paintDirtyRect, paintingState); 2822 2823 RenderLayer::LayerPaintingInfo paintingInfo(&m_owningLayer, paintDirtyRect, paintBehavior, -m_subpixelOffsetFromRenderer); 2824 2825 if (&layer == &m_owningLayer) { 2826 layer.paintLayerContents(context, paintingInfo, paintFlags); 2827 2828 if (layer.containsDirtyOverlayScrollbars()) 2829 layer.paintLayerContents(context, paintingInfo, paintFlags | RenderLayer::PaintLayerPaintingOverlayScrollbars); 2830 } else 2831 layer.paintLayerWithEffects(context, paintingInfo, paintFlags); 2832 2833 if (layer.isRenderViewLayer()) 2834 renderer().view().frameView().didPaintContents(context, paintDirtyRect, paintingState); 2835 2836 ASSERT(!m_owningLayer.m_usedTransparency); 2837 2838 InspectorInstrumentation::didPaint(layer.renderer(), paintDirtyRect); 2839 }; 2840 2841 paintOneLayer(m_owningLayer, paintFlags); 2842 2843 // FIXME: Need to check m_foregroundLayer, masking etc. webkit.org/b/197565. 2844 GraphicsLayer* destinationForSharingLayers = m_scrolledContentsLayer ? m_scrolledContentsLayer.get() : m_graphicsLayer.get(); 2845 2846 if (graphicsLayer == destinationForSharingLayers) { 2847 OptionSet<RenderLayer::PaintLayerFlag> sharingLayerPaintFlags = { 2848 RenderLayer::PaintLayerPaintingCompositingBackgroundPhase, 2849 RenderLayer::PaintLayerPaintingCompositingForegroundPhase }; 2850 2851 if (paintingPhase.contains(GraphicsLayerPaintingPhase::OverflowContents)) 2852 sharingLayerPaintFlags.add(RenderLayer::PaintLayerPaintingOverflowContents); 2853 2854 for (auto& layerWeakPtr : m_backingSharingLayers) 2855 paintOneLayer(*layerWeakPtr, sharingLayerPaintFlags); 2856 } 2857 2858 compositor().didPaintBacking(this); 2867 return paintFlags; 2859 2868 } 2860 2869 … … 2979 2988 2980 2989 // Up-call from compositing layer drawing callback. 2981 void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, OptionSet<GraphicsLayerPaintingPhase> paintingPhase,const FloatRect& clip, GraphicsLayerPaintBehavior layerPaintBehavior)2990 void RenderLayerBacking::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintBehavior layerPaintBehavior) 2982 2991 { 2983 2992 #ifndef NDEBUG … … 3004 3013 || graphicsLayer == m_scrolledContentsLayer.get()) { 3005 3014 3006 if (! paintingPhase.contains(GraphicsLayerPaintingPhase::OverflowContents))3015 if (!graphicsLayer->paintingPhase().contains(GraphicsLayerPaintingPhase::OverflowContents)) 3007 3016 dirtyRect.intersect(enclosingIntRect(compositedBoundsIncludingMargin())); 3008 3017 … … 3015 3024 behavior.add(PaintBehavior::TileFirstPaint); 3016 3025 3017 paintIntoLayer(graphicsLayer, context, dirtyRect, behavior , paintingPhase);3026 paintIntoLayer(graphicsLayer, context, dirtyRect, behavior); 3018 3027 3019 3028 if (renderer().settings().visibleDebugOverlayRegions() & NonFastScrollableRegion) // Piggy-back off the setting that shows touch handler regions. -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r249440 r249455 231 231 void notifyFlushBeforeDisplayRefresh(const GraphicsLayer*) override; 232 232 233 void paintContents(const GraphicsLayer*, GraphicsContext&, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& clip, GraphicsLayerPaintBehavior) override;233 void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect& clip, GraphicsLayerPaintBehavior) override; 234 234 235 235 float deviceScaleFactor() const override; … … 377 377 GraphicsLayer* tileCacheFlatteningLayer() const { return m_isFrameLayerWithTiledBacking ? m_childContainmentLayer.get() : nullptr; } 378 378 379 void paintIntoLayer(const GraphicsLayer*, GraphicsContext&, const IntRect& paintDirtyRect, OptionSet<PaintBehavior>, OptionSet<GraphicsLayerPaintingPhase>); 379 void paintIntoLayer(const GraphicsLayer*, GraphicsContext&, const IntRect& paintDirtyRect, OptionSet<PaintBehavior>); 380 OptionSet<RenderLayer::PaintLayerFlag> paintFlagsForLayer(const GraphicsLayer&) const; 380 381 381 382 void paintDebugOverlays(const GraphicsLayer*, GraphicsContext&); -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r249440 r249455 3383 3383 } 3384 3384 3385 void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& clip, GraphicsLayerPaintBehavior)3385 void RenderLayerCompositor::paintContents(const GraphicsLayer* graphicsLayer, GraphicsContext& context, const FloatRect& clip, GraphicsLayerPaintBehavior) 3386 3386 { 3387 3387 #if PLATFORM(MAC) -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r249440 r249455 398 398 // GraphicsLayerClient implementation 399 399 void notifyFlushRequired(const GraphicsLayer*) override; 400 void paintContents(const GraphicsLayer*, GraphicsContext&, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect&, GraphicsLayerPaintBehavior) override;400 void paintContents(const GraphicsLayer*, GraphicsContext&, const FloatRect&, GraphicsLayerPaintBehavior) override; 401 401 void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const override; 402 402 bool isTrackingRepaints() const override { return m_isTrackingRepaints; } -
trunk/Source/WebKitLegacy/win/ChangeLog
r249175 r249455 1 2019-09-03 Antti Koivisto <antti@apple.com> 2 3 Remove redundant painting phase arguments from GraphicsLayerClient functions 4 https://bugs.webkit.org/show_bug.cgi?id=201443 5 6 Reviewed by Simon Fraser. 7 8 * WebView.cpp: 9 (WebView::paintContents): 10 * WebView.h: 11 1 12 2019-08-27 Mark Lam <mark.lam@apple.com> 2 13 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.cpp
r248885 r249455 325 325 } 326 326 327 void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& rectToPaint, GraphicsLayerPaintBehavior)327 void AcceleratedCompositingContext::paintContents(const GraphicsLayer*, GraphicsContext& context, const FloatRect& rectToPaint, GraphicsLayerPaintBehavior) 328 328 { 329 329 context.save(); -
trunk/Source/WebKitLegacy/win/WebCoreSupport/AcceleratedCompositingContext.h
r248885 r249455 54 54 55 55 // GraphicsLayerClient 56 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, OptionSet<WebCore::GraphicsLayerPaintingPhase>,const WebCore::FloatRect& rectToPaint, WebCore::GraphicsLayerPaintBehavior) override;56 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::FloatRect& rectToPaint, WebCore::GraphicsLayerPaintBehavior) override; 57 57 float deviceScaleFactor() const override; 58 58 -
trunk/Source/WebKitLegacy/win/WebView.cpp
r248960 r249455 7371 7371 } 7372 7372 7373 void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, OptionSet<GraphicsLayerPaintingPhase>,const FloatRect& inClipPixels, GraphicsLayerPaintBehavior)7373 void WebView::paintContents(const GraphicsLayer*, GraphicsContext& context, const FloatRect& inClipPixels, GraphicsLayerPaintBehavior) 7374 7374 { 7375 7375 Frame* frame = core(m_mainFrame); -
trunk/Source/WebKitLegacy/win/WebView.h
r248444 r249455 567 567 void notifyAnimationStarted(const WebCore::GraphicsLayer*, const String&, MonotonicTime) override; 568 568 void notifyFlushRequired(const WebCore::GraphicsLayer*) override; 569 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, OptionSet<WebCore::GraphicsLayerPaintingPhase>,const WebCore::FloatRect& inClip, WebCore::GraphicsLayerPaintBehavior) override;569 void paintContents(const WebCore::GraphicsLayer*, WebCore::GraphicsContext&, const WebCore::FloatRect& inClip, WebCore::GraphicsLayerPaintBehavior) override; 570 570 571 571 #if USE(CA)
Note: See TracChangeset
for help on using the changeset viewer.