Changeset 183775 in webkit
- Timestamp:
- May 4, 2015, 3:53:10 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/mac-wk2/tiled-drawing/background-transparency-toggle-expected.txt (added)
-
LayoutTests/platform/mac-wk2/tiled-drawing/background-transparency-toggle.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (4 diffs)
-
Source/WebCore/page/FrameView.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerCompositor.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayerCompositor.h (modified) (2 diffs)
-
Source/WebCore/testing/Internals.cpp (modified) (1 diff)
-
Source/WebCore/testing/Internals.h (modified) (1 diff)
-
Source/WebCore/testing/Internals.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r183773 r183775 1 2015-05-04 Simon Fraser <simon.fraser@apple.com> 2 3 Fix updating of tiled backing opaquenss when the page background color changes 4 https://bugs.webkit.org/show_bug.cgi?id=144600 5 rdar://problem/20723035 6 7 Reviewed by Tim Horton. 8 9 Test that dumps layers with various baseBackgroundColor and body background color 10 combinations. 11 12 * platform/mac-wk2/tiled-drawing/background-transparency-toggle-expected.txt: Added. 13 * platform/mac-wk2/tiled-drawing/background-transparency-toggle.html: Added. 14 1 15 2015-05-04 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/Source/WebCore/ChangeLog
r183774 r183775 1 2015-05-04 Simon Fraser <simon.fraser@apple.com> 2 3 Fix updating of tiled backing opaquenss when the page background color changes 4 https://bugs.webkit.org/show_bug.cgi?id=144600 5 rdar://problem/20723035 6 7 Reviewed by Tim Horton. 8 9 RenderLayerCompositor makes the page tiles opaque or not based on the result of 10 viewHasTransparentBackground(), which consults the view transparency, and 11 FrameView::documentBackgroundColor(). documentBackgroundColor() in turn is based 12 on the root and/or body background colors. 13 14 We thus need to re-evaluate whether page tiles are opaque when any of these inputs 15 change, but were failing to do so for the FrameView's baseBackgroundColor, and 16 the page root background color. 17 18 Fix by having FrameView::setBaseBackgroundColor(), and RenderBox::styleDidChange() 19 (for the root) trigger a compositing update when necessary. 20 21 Added setViewBaseBackgroundColor() on Internals for testing. 22 23 Test: platform/mac-wk2/tiled-drawing/background-transparency-toggle.html 24 25 * page/FrameView.cpp: 26 (WebCore::FrameView::setTransparent): Use the isViewForDocumentInFrame() helper. 27 (WebCore::FrameView::setBaseBackgroundColor): Bail if we're not the view for the 28 frame's document, and trigger a compositing update check if the alpha changed. 29 (WebCore::FrameView::isViewForDocumentInFrame): Helper that checks to see if 30 this FrameView is associated with the Document being displayed in the FrameView's 31 Frame. This returns false when we're setting up a new FrameView (its Frame still 32 points to the old document, so renderView() returns the RenderView for the Frame's 33 existing Document). 34 * page/FrameView.h: 35 * rendering/RenderBox.cpp: 36 (WebCore::RenderBox::styleDidChange): Have the compositor check to see if it needs 37 to do an update. 38 * rendering/RenderLayerCompositor.cpp: 39 (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): If the result 40 of documentBackgroundColor() changed in alpha since the last time, trigger a compositing 41 update. 42 * rendering/RenderLayerCompositor.h: 43 * testing/Internals.cpp: 44 (WebCore::Internals::setViewBaseBackgroundColor): 45 * testing/Internals.h: 46 * testing/Internals.idl: 47 1 48 2015-05-04 Jer Noble <jer.noble@apple.com> 2 49 -
trunk/Source/WebCore/page/FrameView.cpp
r183710 r183775 2679 2679 m_isTransparent = isTransparent; 2680 2680 2681 RenderView* renderView = this->renderView();2682 if (!renderView)2683 return;2684 2685 2681 // setTransparent can be called in the window between FrameView initialization 2686 2682 // and switching in the new Document; this means that the RenderView that we 2687 2683 // retrieve is actually attached to the previous Document, which is going away, 2688 2684 // and must not update compositing layers. 2689 if (&renderView->frameView() != this) 2690 return; 2691 2692 RenderLayerCompositor& compositor = renderView->compositor(); 2693 compositor.setCompositingLayersNeedRebuild(); 2694 compositor.scheduleCompositingLayerUpdate(); 2685 if (!isViewForDocumentInFrame()) 2686 return; 2687 2688 renderView()->compositor().rootBackgroundTransparencyChanged(); 2695 2689 } 2696 2690 … … 2707 2701 void FrameView::setBaseBackgroundColor(const Color& backgroundColor) 2708 2702 { 2703 bool hadAlpha = m_baseBackgroundColor.hasAlpha(); 2704 2709 2705 if (!backgroundColor.isValid()) 2710 2706 m_baseBackgroundColor = Color::white; … … 2712 2708 m_baseBackgroundColor = backgroundColor; 2713 2709 2710 if (!isViewForDocumentInFrame()) 2711 return; 2712 2714 2713 recalculateScrollbarOverlayStyle(); 2714 2715 if (m_baseBackgroundColor.hasAlpha() != hadAlpha) 2716 renderView()->compositor().rootBackgroundTransparencyChanged(); 2715 2717 } 2716 2718 … … 4111 4113 } 4112 4114 4115 bool FrameView::isViewForDocumentInFrame() const 4116 { 4117 RenderView* renderView = this->renderView(); 4118 if (!renderView) 4119 return false; 4120 4121 return &renderView->frameView() == this; 4122 } 4123 4113 4124 void FrameView::enableAutoSizeMode(bool enable, const IntSize& minSize, const IntSize& maxSize) 4114 4125 { -
trunk/Source/WebCore/page/FrameView.h
r183710 r183775 649 649 650 650 bool qualifiesAsVisuallyNonEmpty() const; 651 bool isViewForDocumentInFrame() const; 651 652 652 653 AXObjectCache* axObjectCache() const; -
trunk/Source/WebCore/rendering/RenderBox.cpp
r183636 r183775 426 426 if (rootStyleChanged && is<RenderBlockFlow>(rootRenderer) && downcast<RenderBlockFlow>(*rootRenderer).multiColumnFlowThread()) 427 427 downcast<RenderBlockFlow>(*rootRenderer).updateStylesForColumnChildren(); 428 429 if (diff != StyleDifferenceEqual) 430 view().compositor().rootBackgroundTransparencyChanged(); 428 431 } 429 432 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r183710 r183775 3215 3215 } 3216 3216 3217 void RenderLayerCompositor::rootBackgroundTransparencyChanged() 3218 { 3219 Color documentBackgroundColor = m_renderView.frameView().documentBackgroundColor(); 3220 if (m_lastDocumentBackgroundColor.isValid() && documentBackgroundColor.hasAlpha() == m_lastDocumentBackgroundColor.hasAlpha()) 3221 return; 3222 3223 // FIXME: We should do something less expensive than a full layer rebuild. 3224 setCompositingLayersNeedRebuild(); 3225 scheduleCompositingLayerUpdate(); 3226 } 3227 3217 3228 void RenderLayerCompositor::setRootExtendedBackgroundColor(const Color& color) 3218 3229 { -
trunk/Source/WebCore/rendering/RenderLayerCompositor.h
r183710 r183775 166 166 GraphicsLayer* fixedRootBackgroundLayer() const; 167 167 168 // Called after the view transparency, or the document or base background color change. 169 void rootBackgroundTransparencyChanged(); 170 168 171 // Repaint the appropriate layers when the given RenderLayer starts or stops being composited. 169 172 void repaintOnCompositingChange(RenderLayer&); … … 555 558 556 559 Color m_rootExtendedBackgroundColor; 560 Color m_lastDocumentBackgroundColor; 557 561 558 562 HashMap<ScrollingNodeID, RenderLayer*> m_scrollingNodeToLayerMap; -
trunk/Source/WebCore/testing/Internals.cpp
r183710 r183775 988 988 } 989 989 990 void Internals::setViewBaseBackgroundColor(const String& colorValue, ExceptionCode& ec) 991 { 992 Document* document = contextDocument(); 993 if (!document || !document->view()) { 994 ec = INVALID_ACCESS_ERR; 995 return; 996 } 997 998 document->view()->setBaseBackgroundColor(Color(colorValue)); 999 } 1000 990 1001 void Internals::setPagination(const String& mode, int gap, int pageLength, ExceptionCode& ec) 991 1002 { -
trunk/Source/WebCore/testing/Internals.h
r183710 r183775 158 158 159 159 void setScrollViewPosition(long x, long y, ExceptionCode&); 160 void setViewBaseBackgroundColor(const String& colorValue, ExceptionCode&); 161 160 162 void setPagination(const String& mode, int gap, ExceptionCode& ec) { setPagination(mode, gap, 0, ec); } 161 163 void setPagination(const String& mode, int gap, int pageLength, ExceptionCode&); -
trunk/Source/WebCore/testing/Internals.idl
r183710 r183775 123 123 [RaisesException] void setScrollViewPosition(long x, long y); 124 124 125 [RaisesException] void setViewBaseBackgroundColor(DOMString colorValue); 126 125 127 [RaisesException] void setPagination(DOMString mode, long gap, optional long pageLength); 126 128
Note:
See TracChangeset
for help on using the changeset viewer.