Skip to content

Commit

Permalink
servo: Merge #5753 - Start using on_refresh_driver_tick #5681 (from J…
Browse files Browse the repository at this point in the history
…IoJIaJIu:timeline); r=jdm

RequestAnimationFrame
[Task](servo/servo#5681)

Source-Repo: https://github.com/servo/servo
Source-Revision: 5e59e77c416dbe35e8c30ca1c21c9088ed17a079

UltraBlame original commit: 9262f690fe4c5170eefc21e007fcf53f71c98fbe
  • Loading branch information
marco-c committed Oct 1, 2019
1 parent 36297d6 commit 60ad2d7
Show file tree
Hide file tree
Showing 17 changed files with 1,899 additions and 101 deletions.
113 changes: 103 additions & 10 deletions servo/components/compositing/compositor.rs
Expand Up @@ -234,6 +234,15 @@ msg
constellation_msg
:
:
AnimationState
;
use
msg
:
:
constellation_msg
:
:
Msg
as
ConstellationMsg
Expand Down Expand Up @@ -655,6 +664,9 @@ PaintState
animations_running
:
bool
animation_callbacks_running
:
bool
}
impl
PipelineDetails
Expand Down Expand Up @@ -687,6 +699,9 @@ Painting
animations_running
:
false
animation_callbacks_running
:
false
}
}
}
Expand Down Expand Up @@ -1200,7 +1215,7 @@ Msg
ChangeRunningAnimationsState
(
pipeline_id
running_animations
animation_state
)
ShutdownState
:
Expand All @@ -1215,7 +1230,7 @@ self
change_running_animations_state
(
pipeline_id
running_animations
animation_state
)
;
}
Expand Down Expand Up @@ -1973,11 +1988,21 @@ self
pipeline_id
:
PipelineId
animations_running
animation_state
:
bool
AnimationState
)
{
match
animation_state
{
AnimationState
:
:
AnimationsPresent
=
>
{
self
.
get_or_create_pipeline_details
Expand All @@ -1987,13 +2012,39 @@ pipeline_id
.
animations_running
=
animations_running
true
;
if
animations_running
self
.
composite_if_necessary
(
CompositingReason
:
:
Animation
)
;
}
AnimationState
:
:
AnimationCallbacksPresent
=
>
{
self
.
get_or_create_pipeline_details
(
pipeline_id
)
.
animation_callbacks_running
=
true
;
self
.
composite_if_necessary
(
CompositingReason
Expand All @@ -2003,6 +2054,45 @@ Animation
)
;
}
AnimationState
:
:
NoAnimationsPresent
=
>
{
self
.
get_or_create_pipeline_details
(
pipeline_id
)
.
animations_running
=
false
;
}
AnimationState
:
:
NoAnimationCallbacksPresent
=
>
{
self
.
get_or_create_pipeline_details
(
pipeline_id
)
.
animation_callbacks_running
=
false
;
}
}
}
pub
fn
Expand Down Expand Up @@ -4781,13 +4871,15 @@ iter
)
{
if
!
pipeline_details
.
animations_running
|
|
pipeline_details
.
animation_callbacks_running
{
continue
}
self
.
constellation_chan
Expand All @@ -4812,6 +4904,7 @@ unwrap
;
}
}
}
fn
device_pixels_per_screen_px
(
Expand Down
3 changes: 2 additions & 1 deletion servo/components/compositing/compositor_task.rs
Expand Up @@ -123,6 +123,7 @@ constellation_msg
:
:
{
AnimationState
ConstellationChan
PipelineId
}
Expand Down Expand Up @@ -1029,7 +1030,7 @@ Url
ChangeRunningAnimationsState
(
PipelineId
bool
AnimationState
)
PaintMsgDiscarded
SetFrameTree
Expand Down
19 changes: 14 additions & 5 deletions servo/components/compositing/constellation.rs
Expand Up @@ -97,6 +97,15 @@ msg
constellation_msg
:
:
AnimationState
;
use
msg
:
:
constellation_msg
:
:
Msg
as
ConstellationMsg
Expand Down Expand Up @@ -1702,7 +1711,7 @@ ConstellationMsg
ChangeRunningAnimationsState
(
pipeline_id
animations_running
animation_state
)
=
>
Expand All @@ -1712,7 +1721,7 @@ self
handle_change_running_animations_state
(
pipeline_id
animations_running
animation_state
)
}
ConstellationMsg
Expand Down Expand Up @@ -3047,9 +3056,9 @@ self
pipeline_id
:
PipelineId
animations_running
animation_state
:
bool
AnimationState
)
{
self
Expand All @@ -3064,7 +3073,7 @@ CompositorMsg
ChangeRunningAnimationsState
(
pipeline_id
animations_running
animation_state
)
)
}
Expand Down

0 comments on commit 60ad2d7

Please sign in to comment.