Add Servo_AnimationValue_Opacity which creates an AnimationValue of opacity.

This commit is contained in:
Boris Chiou 2017-10-27 21:04:36 +02:00
parent d0213b2111
commit f02bd01add
2 changed files with 14 additions and 3 deletions

View file

@ -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,

View file

@ -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<nsCSSValueSharedList>)