From f02bd01adddb77881920a2e0817a0cbf88a28163 Mon Sep 17 00:00:00 2001 From: Boris Chiou Date: Fri, 27 Oct 2017 21:04:36 +0200 Subject: [PATCH] Add Servo_AnimationValue_Opacity which creates an AnimationValue of opacity. --- components/style/gecko/generated/bindings.rs | 4 ++++ ports/geckolib/glue.rs | 13 ++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index 3f1fe721076..f21f9005867 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -2618,6 +2618,10 @@ extern "C" { RawServoAnimationValueBorrowed) -> f32; } +extern "C" { + pub fn Servo_AnimationValue_Opacity(arg1: f32) + -> RawServoAnimationValueStrong; +} extern "C" { pub fn Servo_AnimationValue_GetTransform(value: RawServoAnimationValueBorrowed, diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 901a06bfe14..169ea08d254 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -634,9 +634,9 @@ pub extern "C" fn Servo_Shorthand_AnimationValues_Serialize(shorthand_property: } #[no_mangle] -pub extern "C" fn Servo_AnimationValue_GetOpacity(value: RawServoAnimationValueBorrowed) - -> f32 -{ +pub extern "C" fn Servo_AnimationValue_GetOpacity( + value: RawServoAnimationValueBorrowed +) -> f32 { let value = AnimationValue::as_arc(&value); if let AnimationValue::Opacity(opacity) = **value { opacity @@ -645,6 +645,13 @@ pub extern "C" fn Servo_AnimationValue_GetOpacity(value: RawServoAnimationValueB } } +#[no_mangle] +pub extern "C" fn Servo_AnimationValue_Opacity( + opacity: f32 +) -> RawServoAnimationValueStrong { + Arc::new(AnimationValue::Opacity(opacity)).into_strong() +} + #[no_mangle] pub extern "C" fn Servo_AnimationValue_GetTransform(value: RawServoAnimationValueBorrowed, list: *mut structs::RefPtr)