Changeset 236501 in webkit
- Timestamp:
- Sep 26, 2018 7:34:10 AM (6 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r236494 r236501 1 2018-09-26 Antoine Quint <graouts@apple.com> 2 3 [Web Animations] Ensure renderers with accelerated animations have layers 4 https://bugs.webkit.org/show_bug.cgi?id=189990 5 <rdar://problem/44791222> 6 7 Reviewed by Zalan Bujtas. 8 9 We have done some work already in webkit.org/b/189784 to prevent never-ending calls to DocumentTimeline::updateAnimations(). This was due to 10 the change made for webkit.org/b/186930 where we queued calls to updateAnimations() in KeyframeEffectReadOnly::applyPendingAcceleratedActions() 11 while we were waiting for a renderer with a layer backing for a given animation target. Instead of doing this, we now ensure renderers always 12 have a layer when they have an accelerated animation applied. 13 14 No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html 15 which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element. 16 17 * animation/DocumentTimeline.cpp: 18 (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): This method should have been marked const all along and it is 19 now required so it can be called through RenderBox::requiresLayer() and RenderInline::requiresLayer(). 20 (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Deleted. 21 * animation/DocumentTimeline.h: 22 * animation/KeyframeEffectReadOnly.cpp: 23 (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Stop enqueuing the accelerated actions in case we're lacking a composited renderer 24 since this situation should no longer arise. 25 * rendering/RenderBox.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations. 26 * rendering/RenderBoxModelObject.cpp: 27 (WebCore::RenderBoxModelObject::hasRunningAcceleratedAnimations const): Query the document timeline, if it exists, to check that this renderer's element 28 has accelerated animations applied. 29 * rendering/RenderBoxModelObject.h: 30 * rendering/RenderInline.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations. 31 1 32 2018-09-25 Eric Carlson <eric.carlson@apple.com> 2 33 -
trunk/Source/WebCore/animation/DocumentTimeline.cpp
r236323 r236501 447 447 } 448 448 449 bool DocumentTimeline::runningAnimationsForElementAreAllAccelerated(Element& element) 449 bool DocumentTimeline::runningAnimationsForElementAreAllAccelerated(Element& element) const 450 450 { 451 451 // FIXME: This will let animations run using hardware compositing even if later in the active -
trunk/Source/WebCore/animation/DocumentTimeline.h
r236308 r236501 60 60 void animationAcceleratedRunningStateDidChange(WebAnimation&); 61 61 void applyPendingAcceleratedAnimations(); 62 bool runningAnimationsForElementAreAllAccelerated(Element&) ;62 bool runningAnimationsForElementAreAllAccelerated(Element&) const; 63 63 bool resolveAnimationsForElement(Element&, RenderStyle&); 64 64 void detachFromDocument(); -
trunk/Source/WebCore/animation/KeyframeEffectReadOnly.cpp
r236308 r236501 1278 1278 1279 1279 auto* renderer = this->renderer(); 1280 if (!renderer || !renderer->isComposited()) { 1281 if (m_lastRecordedAcceleratedAction != AcceleratedAction::Stop || m_pendingAcceleratedActions.last() != AcceleratedAction::Stop) 1282 animation()->acceleratedStateDidChange(); 1283 return; 1284 } 1280 if (!renderer || !renderer->isComposited()) 1281 return; 1285 1282 1286 1283 auto pendingAcceleratedActions = m_pendingAcceleratedActions; -
trunk/Source/WebCore/rendering/RenderBox.h
r236356 r236501 54 54 return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip() 55 55 || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection() || style().specifiesColumns() 56 || !style().hasAutoZIndex() ;56 || !style().hasAutoZIndex() || hasRunningAcceleratedAnimations(); 57 57 } 58 58 -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r234619 r236501 30 30 #include "BorderEdge.h" 31 31 #include "CachedImage.h" 32 #include "Document.h" 33 #include "DocumentTimeline.h" 32 34 #include "FloatRoundedRect.h" 33 35 #include "Frame.h" … … 2689 2691 } 2690 2692 2693 bool RenderBoxModelObject::hasRunningAcceleratedAnimations() const 2694 { 2695 if (auto* node = element()) { 2696 if (auto* timeline = node->document().existingTimeline()) 2697 return timeline->runningAnimationsForElementAreAllAccelerated(*node); 2698 } 2699 return false; 2700 } 2701 2691 2702 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderBoxModelObject.h
r233886 r236501 271 271 DecodingMode decodingModeForImageDraw(const Image&, const PaintInfo&) const; 272 272 273 bool hasRunningAcceleratedAnimations() const; 274 273 275 public: 274 276 // For RenderBlocks and RenderInlines with m_style->styleType() == PseudoId::FirstLetter, this tracks their remaining text fragments -
trunk/Source/WebCore/rendering/RenderInline.h
r228908 r236501 121 121 bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) final; 122 122 123 bool requiresLayer() const override { return isInFlowPositioned() || createsGroup() || hasClipPath() || willChangeCreatesStackingContext() ; }123 bool requiresLayer() const override { return isInFlowPositioned() || createsGroup() || hasClipPath() || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations(); } 124 124 125 125 LayoutUnit offsetLeft() const final;
Note: See TracChangeset
for help on using the changeset viewer.