Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit df4a307

Browse files
Simplify management of LayerPropertyAnimation instances in GraphicsLayerCA
https://bugs.webkit.org/show_bug.cgi?id=217707 <rdar://problem/70291140> Reviewed by Dean Jackson. The management of LayerPropertyAnimation instances in GraphicsLayerCA spread those animations between different data structures. We now simplify this to be a single Vector<LayerPropertyAnimation> with three new properties. The m_playState property indicates: - whether the animation has been added to the list but awaiting the next commit to be played (PlayPending) - whether the animation has been committed and playing (Playing) - whether the animation has been marked to be paused but awaiting the next commit to be paused (PausePending) - whether the animation has been committed and paused (Paused) The m_pendingRemoval property indicates whether the animation has been marked for removal upon the next commit. The m_beginTime property indicates the time at which the animation was first added, ensuring that the animation can be removed and re-added while preserving the same begin time. As such, when GraphicsLayerCA::updateAnimations() is called we remove all animations from the layer, filter m_animations to only have animations that are not marked as pending removal, and add the now-current list of animations to the layer. No new test since this change is refactoring only and should not have any change in behavior. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::animationIsRunning const): (WebCore::animationCanBeAccelerated): (WebCore::GraphicsLayerCA::pauseAnimation): (WebCore::GraphicsLayerCA::removeAnimation): (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted): (WebCore::GraphicsLayerCA::updateAnimations): (WebCore::GraphicsLayerCA::isRunningTransformAnimation const): (WebCore::GraphicsLayerCA::setAnimationOnLayer): (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer): (WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer): (WebCore::GraphicsLayerCA::createAnimationFromKeyframes): (WebCore::GraphicsLayerCA::appendToUncommittedAnimations): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): (WebCore::animationIdentifier): Deleted. (WebCore::GraphicsLayerCA::animationCanBeAccelerated const): Deleted. (WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Deleted. (WebCore::GraphicsLayerCA::ensureLayerAnimations): Deleted. * platform/graphics/ca/GraphicsLayerCA.h: (WebCore::GraphicsLayerCA::hasAnimations const): (WebCore::GraphicsLayerCA::LayerPropertyAnimation::animationIdentifier const): (WebCore::GraphicsLayerCA::moveAnimations): (WebCore::GraphicsLayerCA::copyAnimations): (WebCore::GraphicsLayerCA::animationIsRunning const): Deleted. (WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction): Deleted. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@268483 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 069f440 commit df4a307

File tree

3 files changed

+180
-221
lines changed

3 files changed

+180
-221
lines changed

Source/WebCore/ChangeLog

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
2020-10-14 Antoine Quint <[email protected]>
2+
3+
Simplify management of LayerPropertyAnimation instances in GraphicsLayerCA
4+
https://bugs.webkit.org/show_bug.cgi?id=217707
5+
<rdar://problem/70291140>
6+
7+
Reviewed by Dean Jackson.
8+
9+
The management of LayerPropertyAnimation instances in GraphicsLayerCA spread
10+
those animations between different data structures. We now simplify this to
11+
be a single Vector<LayerPropertyAnimation> with three new properties.
12+
13+
The m_playState property indicates:
14+
15+
- whether the animation has been added to the list but awaiting the next commit
16+
to be played (PlayPending)
17+
- whether the animation has been committed and playing (Playing)
18+
- whether the animation has been marked to be paused but awaiting the next commit
19+
to be paused (PausePending)
20+
- whether the animation has been committed and paused (Paused)
21+
22+
The m_pendingRemoval property indicates whether the animation has been marked for
23+
removal upon the next commit.
24+
25+
The m_beginTime property indicates the time at which the animation was first added,
26+
ensuring that the animation can be removed and re-added while preserving the same
27+
begin time.
28+
29+
As such, when GraphicsLayerCA::updateAnimations() is called we remove all animations
30+
from the layer, filter m_animations to only have animations that are not marked
31+
as pending removal, and add the now-current list of animations to the layer.
32+
33+
No new test since this change is refactoring only and should not have any change
34+
in behavior.
35+
36+
* platform/graphics/ca/GraphicsLayerCA.cpp:
37+
(WebCore::GraphicsLayerCA::moveOrCopyAnimations):
38+
(WebCore::GraphicsLayerCA::animationIsRunning const):
39+
(WebCore::animationCanBeAccelerated):
40+
(WebCore::GraphicsLayerCA::pauseAnimation):
41+
(WebCore::GraphicsLayerCA::removeAnimation):
42+
(WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
43+
(WebCore::GraphicsLayerCA::updateAnimations):
44+
(WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
45+
(WebCore::GraphicsLayerCA::setAnimationOnLayer):
46+
(WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):
47+
(WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
48+
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
49+
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
50+
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
51+
(WebCore::animationIdentifier): Deleted.
52+
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const): Deleted.
53+
(WebCore::GraphicsLayerCA::addProcessingActionForAnimation): Deleted.
54+
(WebCore::GraphicsLayerCA::ensureLayerAnimations): Deleted.
55+
* platform/graphics/ca/GraphicsLayerCA.h:
56+
(WebCore::GraphicsLayerCA::hasAnimations const):
57+
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::animationIdentifier const):
58+
(WebCore::GraphicsLayerCA::moveAnimations):
59+
(WebCore::GraphicsLayerCA::copyAnimations):
60+
(WebCore::GraphicsLayerCA::animationIsRunning const): Deleted.
61+
(WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction): Deleted.
62+
163
2020-10-14 Youenn Fablet <[email protected]>
264

365
MediaRecorder .stop should not throw in Inactive state

0 commit comments

Comments
 (0)