From 4c3038f3783f9542f39745e61bca88013e64e6b3 Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Fri, 6 Nov 2015 17:56:02 +0100 Subject: [PATCH] Pass the constellation_chan to animation::update_animation_state directly. --- components/layout/animation.rs | 12 +++++------- components/layout/layout_task.rs | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/components/layout/animation.rs b/components/layout/animation.rs index 786c1dba92e..247765c8d92 100644 --- a/components/layout/animation.rs +++ b/components/layout/animation.rs @@ -9,7 +9,7 @@ use flow::{self, Flow}; use gfx::display_list::OpaqueNode; use incremental::{self, RestyleDamage}; use layout_task::{LayoutTask, LayoutTaskData}; -use msg::constellation_msg::{AnimationState, Msg, PipelineId}; +use msg::constellation_msg::{AnimationState, ConstellationChan, Msg, PipelineId}; use script::layout_interface::Animation; use script_traits::ConstellationControlMsg; use std::collections::HashMap; @@ -50,7 +50,7 @@ pub fn start_transitions_if_applicable(new_animations_sender: &Mutex>>, new_animations_receiver: &Receiver, pipeline_id: PipelineId) { @@ -101,11 +101,9 @@ pub fn update_animation_state(rw_data: &mut LayoutTaskData, animation_state = AnimationState::AnimationsPresent; } - rw_data.constellation_chan - .0 - .send(Msg::ChangeRunningAnimationsState(pipeline_id, animation_state)) - .unwrap(); - + constellation_chan.0 + .send(Msg::ChangeRunningAnimationsState(pipeline_id, animation_state)) + .unwrap(); } /// Recalculates style for a set of animations. This does *not* run with the DOM lock held. diff --git a/components/layout/layout_task.rs b/components/layout/layout_task.rs index 2b0c3b1f90d..c054aa37bb3 100644 --- a/components/layout/layout_task.rs +++ b/components/layout/layout_task.rs @@ -1332,7 +1332,7 @@ impl LayoutTask { layout_context: &mut SharedLayoutContext) { if let Some(mut root_flow) = self.root_flow.clone() { // Kick off animations if any were triggered, expire completed ones. - animation::update_animation_state(&mut *rw_data, + animation::update_animation_state(&self.constellation_chan, &mut self.running_animations, &self.new_animations_receiver, self.id);