Changeset 218735 in webkit
- Timestamp:
- Jun 22, 2017 9:34:14 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r218733 r218735 1 2017-06-22 Antti Koivisto <antti@apple.com> 2 3 REGRESSION(r217695): Offscreen/overflowed items not being rendered while translating in-frame 4 https://bugs.webkit.org/show_bug.cgi?id=173732 5 6 Reviewed by Simon Fraser. 7 8 * compositing/backing/transform-transition-from-outside-view-expected.txt: Added. 9 * compositing/backing/transform-transition-from-outside-view.html: Added. 10 1 11 2017-06-22 Myles C. Maxfield <mmaxfield@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r218734 r218735 1 2017-06-22 Antti Koivisto <antti@apple.com> 2 3 REGRESSION(r217695): Offscreen/overflowed items not being rendered while translating in-frame 4 https://bugs.webkit.org/show_bug.cgi?id=173732 5 6 Reviewed by Simon Fraser. 7 8 If an accelerated animation starts completely outside the view we fail to create backing for it 9 when it moves into view. 10 11 Fix by computing the full extent rect of the animation when it starts and doing the viewport overlap 12 testing with that. 13 14 Test: compositing/backing/transform-transition-from-outside-view.html 15 16 * platform/graphics/GraphicsLayer.h: 17 (WebCore::GraphicsLayer::animationExtent): 18 (WebCore::GraphicsLayer::setAnimationExtent): 19 * platform/graphics/ca/GraphicsLayerCA.cpp: 20 (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect): 21 22 Return the current animation transformation matrix so we can use it elsewhere without recomputing. 23 24 (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): 25 26 If we have animation extent use it instead of bounds for visibility testing. 27 28 (WebCore::GraphicsLayerCA::recursiveCommitChanges): 29 30 Track if theres is a visible ancestor layer with a transition animation. 31 32 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): 33 (WebCore::GraphicsLayerCA::updateCoverage): 34 35 For simplicity create backing for all sublayers of a visible transform animated layer. 36 37 * platform/graphics/ca/GraphicsLayerCA.h: 38 (WebCore::GraphicsLayerCA::VisibleAndCoverageRects::VisibleAndCoverageRects): Deleted. 39 * rendering/RenderLayerBacking.cpp: 40 (WebCore::RenderLayerBacking::updateGeometry): 41 42 Pass the animation extent (including descendants) to GraphicsLayer. 43 1 44 2017-06-22 Chris Dumez <cdumez@apple.com> 2 45 -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r218615 r218735 572 572 virtual bool isCoordinatedGraphicsLayer() const { return false; } 573 573 574 const std::optional<FloatRect>& animationExtent() const { return m_animationExtent; } 575 void setAnimationExtent(std::optional<FloatRect> animationExtent) { m_animationExtent = animationExtent; } 576 574 577 static void traverse(GraphicsLayer&, const WTF::Function<void (GraphicsLayer&)>&); 575 578 … … 677 680 FloatSize m_contentsTileSize; 678 681 FloatRoundedRect m_backdropFiltersRect; 682 std::optional<FloatRect> m_animationExtent; 679 683 680 684 int m_repaintCount; -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r217737 r218735 1344 1344 if (!applyWasClamped && !mapWasClamped) 1345 1345 clipRectForSelf.intersect(clipRectForChildren); 1346 1346 1347 1347 if (masksToBounds()) { 1348 1348 ASSERT(accumulation == TransformState::FlattenTransform); … … 1361 1361 coverageRect = (*quad).boundingBox(); 1362 1362 1363 return VisibleAndCoverageRects(clipRectForSelf, coverageRect);1363 return { clipRectForSelf, coverageRect, currentTransform }; 1364 1364 } 1365 1365 … … 1393 1393 bool visibleRectChanged = rects.visibleRect != m_visibleRect; 1394 1394 bool coverageRectChanged = rects.coverageRect != m_coverageRect; 1395 if (!visibleRectChanged && !coverageRectChanged) 1396 return; 1395 if (!visibleRectChanged && !coverageRectChanged && !animationExtent()) 1396 return; 1397 1398 auto bounds = FloatRect(m_boundsOrigin, size()); 1399 if (auto extent = animationExtent()) { 1400 // Adjust the animation extent to match the current animation position. 1401 bounds = rects.animatingTransform.inverse().value_or(TransformationMatrix()).mapRect(*extent); 1402 } 1397 1403 1398 1404 // FIXME: we need to take reflections into account when determining whether this layer intersects the coverage rect. 1399 bool intersectsCoverageRect = isViewportConstrained || rects.coverageRect.intersects( FloatRect(m_boundsOrigin, size()));1405 bool intersectsCoverageRect = isViewportConstrained || rects.coverageRect.intersects(bounds); 1400 1406 if (intersectsCoverageRect != m_intersectsCoverageRect) { 1401 1407 addUncommittedChanges(CoverageRectChanged); … … 1491 1497 if (affectedByPageScale) 1492 1498 baseRelativePosition += m_position; 1493 1499 1494 1500 commitLayerChangesBeforeSublayers(childCommitState, pageScaleFactor, baseRelativePosition); 1495 1501 1496 1502 if (isRunningTransformAnimation()) { 1497 1503 childCommitState.ancestorHasTransformAnimation = true; 1504 if (m_intersectsCoverageRect) 1505 childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect = true; 1498 1506 affectedByTransformAnimation = true; 1499 1507 } … … 1745 1753 1746 1754 if (m_uncommittedChanges & CoverageRectChanged) 1747 updateCoverage( );1755 updateCoverage(commitState); 1748 1756 1749 1757 if (m_uncommittedChanges & TilingAreaChanged) // Needs to happen after CoverageRectChanged, ContentsScaleChanged … … 2283 2291 } 2284 2292 2285 void GraphicsLayerCA::updateCoverage( )2293 void GraphicsLayerCA::updateCoverage(const CommitState& commitState) 2286 2294 { 2287 2295 // FIXME: Need to set coverage on clone layers too. … … 2292 2300 2293 2301 if (canDetachBackingStore()) { 2294 m_layer->setBackingStoreAttached(m_intersectsCoverageRect); 2302 bool requiresBacking = m_intersectsCoverageRect 2303 || commitState.ancestorWithTransformAnimationIntersectsCoverageRect // FIXME: Compute backing exactly for descendants of animating layers. 2304 || (isRunningTransformAnimation() && !animationExtent()); // Create backing if we don't know the animation extent. 2305 2306 m_layer->setBackingStoreAttached(requiresBacking); 2295 2307 if (m_layerClones) { 2296 2308 for (auto& it : *m_layerClones) 2297 it.value->setBackingStoreAttached( m_intersectsCoverageRect);2309 it.value->setBackingStoreAttached(requiresBacking); 2298 2310 } 2299 2311 } -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r217737 r218735 158 158 bool ancestorHadChanges { false }; 159 159 bool ancestorHasTransformAnimation { false }; 160 bool ancestorWithTransformAnimationIntersectsCoverageRect { false }; 160 161 bool ancestorIsViewportConstrained { false }; 161 162 }; … … 300 301 FloatRect visibleRect; 301 302 FloatRect coverageRect; 302 303 VisibleAndCoverageRects(const FloatRect& visRect, const FloatRect& covRect) 304 : visibleRect(visRect) 305 , coverageRect(covRect) 306 { 307 } 303 TransformationMatrix animatingTransform; 308 304 }; 309 305 … … 401 397 void updateStructuralLayer(); 402 398 void updateDrawsContent(); 403 void updateCoverage( );399 void updateCoverage(const CommitState&); 404 400 void updateBackgroundColor(); 405 401 void updateUserInteractionEnabled(); -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r218615 r218735 946 946 947 947 const RenderStyle& style = renderer().style(); 948 949 bool isRunningAcceleratedTransformAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform, AnimationBase::Running | AnimationBase::Paused); 950 bool isRunningAcceleratedOpacityAnimation = renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity, AnimationBase::Running | AnimationBase::Paused); 951 948 952 // Set transform property, if it is not animating. We have to do this here because the transform 949 953 // is affected by the layer dimensions. 950 if (! renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyTransform, AnimationBase::Running | AnimationBase::Paused))954 if (!isRunningAcceleratedTransformAnimation) 951 955 updateTransform(style); 952 956 953 957 // Set opacity, if it is not animating. 954 if (! renderer().animation().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyOpacity, AnimationBase::Running | AnimationBase::Paused))958 if (!isRunningAcceleratedOpacityAnimation) 955 959 updateOpacity(style); 956 960 … … 978 982 m_graphicsLayer->setPosition(primaryGraphicsLayerRect.location()); 979 983 m_graphicsLayer->setSize(primaryGraphicsLayerRect.size()); 984 985 auto computeAnimationExtent = [&] () -> std::optional<FloatRect> { 986 LayoutRect animatedBounds; 987 if (isRunningAcceleratedTransformAnimation && m_owningLayer.getOverlapBoundsIncludingChildrenAccountingForTransformAnimations(animatedBounds)) 988 return FloatRect(animatedBounds); 989 return { }; 990 }; 991 m_graphicsLayer->setAnimationExtent(computeAnimationExtent()); 980 992 981 993 ComputedOffsets rendererOffset(m_owningLayer, LayoutRect(), parentGraphicsLayerRect, primaryGraphicsLayerRect);
Note: See TracChangeset
for help on using the changeset viewer.