Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add Servo_AnimationValue_Opacity which creates an AnimationValue of o…
…pacity.
  • Loading branch information
BorisChiou committed Oct 27, 2017
1 parent d0213b2 commit f02bd01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions components/style/gecko/generated/bindings.rs
Expand Up @@ -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,
Expand Down
13 changes: 10 additions & 3 deletions ports/geckolib/glue.rs
Expand Up @@ -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
Expand All @@ -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>)
Expand Down

0 comments on commit f02bd01

Please sign in to comment.