Changeset 232991 in webkit
- Timestamp:
- Jun 19, 2018 4:06:09 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r232985 r232991 1 2018-06-19 Tim Horton <timothy_horton@apple.com> 2 3 Unpainted area while scrolling in Reader is white 4 https://bugs.webkit.org/show_bug.cgi?id=186541 5 <rdar://problem/40471363> 6 7 Reviewed by Timothy Hatcher. 8 9 * tiled-drawing/background-transparency-toggle-expected.txt: 10 This is a progression; the extended background color now matches the color 11 of the page at this point (#CCCCCC is the specified body background, black 12 with 0.2 alpha, blended with the root's white background). 13 14 * tiled-drawing/simple-document-with-dynamic-background-color-expected.txt: Added. 15 * tiled-drawing/simple-document-with-dynamic-background-color.html: Added. 16 Added a test that ensures that dynamically changing the background color 17 actually applies to the RenderView background. Previously, the second layer 18 tree dump would have a black background where it should be red. 19 1 20 2018-06-19 Michael Catanzaro <mcatanzaro@igalia.com> 2 21 -
trunk/LayoutTests/tiled-drawing/background-transparency-toggle-expected.txt
r222285 r232991 50 50 (bounds 785.00 1024.00) 51 51 (contentsOpaque 1) 52 (backgroundColor #CCCCCC) 52 53 (tile cache coverage 0, 0 785 x 1024) 53 54 (tile size 785 x 512) -
trunk/Source/WebCore/ChangeLog
r232981 r232991 1 2018-06-19 Tim Horton <timothy_horton@apple.com> 2 3 Unpainted area while scrolling in Reader is white 4 https://bugs.webkit.org/show_bug.cgi?id=186541 5 <rdar://problem/40471363> 6 7 Reviewed by Timothy Hatcher. 8 9 New test: tiled-drawing/simple-document-with-dynamic-background-color.html 10 11 For platforms that do not use the overhang layer, we depend on 12 RenderView's background color to fill unpainted space. 13 14 RenderView's background color is only updated inside updateRootLayerConfiguration, 15 and it is possible with a simple enough page to change the document's 16 background color without running that code. 17 18 * page/FrameView.cpp: 19 (WebCore::FrameView::setTransparent): 20 (WebCore::FrameView::setBaseBackgroundColor): 21 Make use of the newly added rootBackgroundColorOrTransparencyChanged. 22 23 (WebCore::FrameView::calculateExtendedBackgroundMode const): 24 Update a comment, since the function it mentioned is no longer. 25 26 (WebCore::FrameView::updateTilesForExtendedBackgroundMode): 27 Remove this code that clears the root extended background color 28 if using tiles to extend in both directions. Two reasons: 29 1) it seems harmless to also have a root extended background color 30 2) this just gets clobbered by the call in RenderView::paintBoxDecorations 31 32 * rendering/RenderLayerCompositor.cpp: 33 (WebCore::RenderLayerCompositor::updateCompositingLayers): 34 Add a bit that will do a updateConfiguration() on the root layer if no 35 other work needs to be done, so that we can update the root layer's 36 transparency or background color without doing a full layer rebuild. 37 38 (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged): 39 Make use of the newly added rootBackgroundColorOrTransparencyChanged. 40 41 (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged): 42 Change rootBackgroundTransparencyChanged to also cover color changes. 43 Fold setRootExtendedBackgroundColor in here, and make use of 44 setRootLayerConfigurationNeedsUpdate() instead of doing a full rebuild. 45 Previously, we would bail if the transparency state hadn't changed; 46 now, we'll also update the root layer's background color and the 47 exposed-to-WebKit extended background color if they change too. 48 49 (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Deleted. 50 (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): Deleted. 51 52 * rendering/RenderLayerCompositor.h: 53 Add setRootLayerConfigurationNeedsUpdate, remove setRootExtendedBackgroundColor, 54 and add both a bit indicating that the root layer configuration needs updating 55 and the cached view background color to make the early return in 56 rootBackgroundColorOrTransparencyChanged possible. 57 58 * rendering/RenderView.cpp: 59 (WebCore::RenderView::paintBoxDecorations): 60 Make use of the newly added rootBackgroundColorOrTransparencyChanged. 61 1 62 2018-06-19 Youenn Fablet <youenn@apple.com> 2 63 -
trunk/Source/WebCore/page/FrameView.cpp
r232859 r232991 2897 2897 return; 2898 2898 2899 renderView()->compositor().rootBackground TransparencyChanged();2899 renderView()->compositor().rootBackgroundColorOrTransparencyChanged(); 2900 2900 setNeedsLayout(); 2901 2901 } … … 2913 2913 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) 2914 2914 { 2915 bool wasOpaque = m_baseBackgroundColor.isOpaque(); 2916 2917 if (!backgroundColor.isValid()) 2918 m_baseBackgroundColor = Color::white; 2919 else 2920 m_baseBackgroundColor = backgroundColor; 2915 m_baseBackgroundColor = backgroundColor.isValid() ? backgroundColor : Color::white; 2921 2916 2922 2917 if (!isViewForDocumentInFrame()) … … 2926 2921 setNeedsLayout(); 2927 2922 2928 if (m_baseBackgroundColor.isOpaque() != wasOpaque) 2929 renderView()->compositor().rootBackgroundTransparencyChanged(); 2923 renderView()->compositor().rootBackgroundColorOrTransparencyChanged(); 2930 2924 } 2931 2925 … … 2971 2965 // Just because Settings::backgroundShouldExtendBeyondPage() is true does not necessarily mean 2972 2966 // that the background rect needs to be extended for painting. Simple backgrounds can be extended 2973 // just with RenderLayerCompositor ::setRootExtendedBackgroundColor(). More complicated backgrounds,2967 // just with RenderLayerCompositor's rootExtendedBackgroundColor. More complicated backgrounds, 2974 2968 // such as images, require extending the background rect to continue painting into the extended 2975 2969 // region. This function finds out if it is necessary to extend the background rect for painting. … … 3025 3019 return; 3026 3020 3027 renderView->compositor().setRootExtendedBackgroundColor(mode == ExtendedBackgroundModeAll ? Color() : documentBackgroundColor());3028 3021 backing->setTiledBackingHasMargins(mode & ExtendedBackgroundModeHorizontal, mode & ExtendedBackgroundModeVertical); 3029 3022 } -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r232218 r232991 670 670 bool checkForHierarchyUpdate = m_reevaluateCompositingAfterLayout; 671 671 bool needGeometryUpdate = false; 672 bool needRootLayerConfigurationUpdate = m_rootLayerConfigurationNeedsUpdate; 672 673 673 674 switch (updateType) { … … 684 685 } 685 686 686 if (!checkForHierarchyUpdate && !needGeometryUpdate )687 if (!checkForHierarchyUpdate && !needGeometryUpdate && !needRootLayerConfigurationUpdate) 687 688 return false; 688 689 … … 692 693 // Only clear the flag if we're updating the entire hierarchy. 693 694 m_compositingLayersNeedRebuild = false; 695 m_rootLayerConfigurationNeedsUpdate = false; 694 696 updateRoot = &rootRenderLayer(); 695 697 … … 753 755 updateLayerTreeGeometry(*updateRoot, 0); 754 756 ASSERT(!isFullUpdate || !m_subframeScrollLayersNeedReattach); 755 } 757 } else if (needRootLayerConfigurationUpdate) 758 m_renderView.layer()->backing()->updateConfiguration(); 756 759 757 760 #if !LOG_DISABLED … … 3107 3110 3108 3111 if (oldBackgroundColor != renderer.style().visitedDependentColorWithColorFilter(CSSPropertyBackgroundColor)) 3109 rootBackground TransparencyChanged();3112 rootBackgroundColorOrTransparencyChanged(); 3110 3113 3111 3114 bool hadFixedBackground = oldStyle && oldStyle->hasEntirelyFixedBackground(); … … 3116 3119 } 3117 3120 3118 void RenderLayerCompositor::rootBackground TransparencyChanged()3121 void RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged() 3119 3122 { 3120 3123 if (!inCompositingMode()) 3121 3124 return; 3122 3125 3123 bool isTransparent = viewHasTransparentBackground(); 3124 3125 LOG(Compositing, "RenderLayerCompositor %p rootBackgroundTransparencyChanged. isTransparent=%d, changed=%d", this, isTransparent, m_viewBackgroundIsTransparent != isTransparent); 3126 if (m_viewBackgroundIsTransparent == isTransparent) 3126 Color backgroundColor; 3127 bool isTransparent = viewHasTransparentBackground(&backgroundColor); 3128 3129 Color extendedBackgroundColor = m_renderView.settings().backgroundShouldExtendBeyondPage() ? backgroundColor : Color(); 3130 3131 bool transparencyChanged = m_viewBackgroundIsTransparent != isTransparent; 3132 bool backgroundColorChanged = m_viewBackgroundColor != backgroundColor; 3133 bool extendedBackgroundColorChanged = m_rootExtendedBackgroundColor != extendedBackgroundColor; 3134 3135 LOG(Compositing, "RenderLayerCompositor %p rootBackgroundColorOrTransparencyChanged. isTransparent=%d, transparencyChanged=%d, backgroundColorChanged=%d, extendedBackgroundColorChanged=%d", this, isTransparent, transparencyChanged, backgroundColorChanged, extendedBackgroundColorChanged); 3136 if (!transparencyChanged && !backgroundColorChanged && !extendedBackgroundColorChanged) 3127 3137 return; 3128 3138 3129 3139 m_viewBackgroundIsTransparent = isTransparent; 3130 3131 // FIXME: We should do something less expensive than a full layer rebuild. 3132 setCompositingLayersNeedRebuild(); 3140 m_viewBackgroundColor = backgroundColor; 3141 m_rootExtendedBackgroundColor = extendedBackgroundColor; 3142 3143 if (extendedBackgroundColorChanged) { 3144 page().chrome().client().pageExtendedBackgroundColorDidChange(m_rootExtendedBackgroundColor); 3145 3146 #if ENABLE(RUBBER_BANDING) 3147 if (!m_layerForOverhangAreas) 3148 return; 3149 3150 m_layerForOverhangAreas->setBackgroundColor(m_rootExtendedBackgroundColor); 3151 3152 if (!m_rootExtendedBackgroundColor.isValid()) 3153 m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang); 3154 #endif 3155 } 3156 3157 setRootLayerConfigurationNeedsUpdate(); 3133 3158 scheduleCompositingLayerUpdate(); 3134 }3135 3136 void RenderLayerCompositor::setRootExtendedBackgroundColor(const Color& color)3137 {3138 if (color == m_rootExtendedBackgroundColor)3139 return;3140 3141 m_rootExtendedBackgroundColor = color;3142 3143 page().chrome().client().pageExtendedBackgroundColorDidChange(color);3144 3145 #if ENABLE(RUBBER_BANDING)3146 if (!m_layerForOverhangAreas)3147 return;3148 3149 m_layerForOverhangAreas->setBackgroundColor(m_rootExtendedBackgroundColor);3150 3151 if (!m_rootExtendedBackgroundColor.isValid())3152 m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang);3153 #endif3154 3159 } 3155 3160 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r224796 r232991 166 166 167 167 // Called after the view transparency, or the document or base background color change. 168 void rootBackground TransparencyChanged();168 void rootBackgroundColorOrTransparencyChanged(); 169 169 170 170 // Repaint the appropriate layers when the given RenderLayer starts or stops being composited. … … 314 314 void didPaintBacking(RenderLayerBacking*); 315 315 316 void setRootExtendedBackgroundColor(const Color&);317 316 const Color& rootExtendedBackgroundColor() const { return m_rootExtendedBackgroundColor; } 318 317 … … 482 481 bool documentUsesTiledBacking() const; 483 482 bool isMainFrameCompositor() const; 483 484 void setRootLayerConfigurationNeedsUpdate() { m_rootLayerConfigurationNeedsUpdate = true; } 484 485 485 486 private: … … 502 503 bool m_compositing { false }; 503 504 bool m_compositingLayersNeedRebuild { false }; 505 bool m_rootLayerConfigurationNeedsUpdate { false }; 504 506 bool m_flushingLayers { false }; 505 507 bool m_shouldFlushOnReattach { false }; … … 562 564 #endif 563 565 566 Color m_viewBackgroundColor; 564 567 Color m_rootExtendedBackgroundColor; 565 568 -
trunk/Source/WebCore/rendering/RenderView.cpp
r232178 r232991 455 455 } 456 456 457 bool backgroundShouldExtendBeyondPage = settings().backgroundShouldExtendBeyondPage(); 458 compositor().setRootExtendedBackgroundColor(backgroundShouldExtendBeyondPage ? frameView().documentBackgroundColor() : Color()); 457 compositor().rootBackgroundColorOrTransparencyChanged(); 459 458 460 459 Page* page = document().page(); … … 475 474 else { 476 475 const Color& documentBackgroundColor = frameView().documentBackgroundColor(); 477 const Color& backgroundColor = ( backgroundShouldExtendBeyondPage&& documentBackgroundColor.isValid()) ? documentBackgroundColor : frameView().baseBackgroundColor();476 const Color& backgroundColor = (settings().backgroundShouldExtendBeyondPage() && documentBackgroundColor.isValid()) ? documentBackgroundColor : frameView().baseBackgroundColor(); 478 477 if (backgroundColor.isVisible()) { 479 478 CompositeOperator previousOperator = paintInfo.context().compositeOperation();
Note: See TracChangeset
for help on using the changeset viewer.