mirror of
https://github.com/servo/servo.git
synced 2025-07-09 00:13:41 +01:00
Bug 1335942 - Part 2: Support GetOpacity FFI. r=manishearth
This commit is contained in:
parent
c7dc3e4008
commit
22d04e1a16
2 changed files with 17 additions and 0 deletions
|
@ -1301,6 +1301,11 @@ extern "C" {
|
||||||
RawServoAnimationValueBorrowedListBorrowed)
|
RawServoAnimationValueBorrowedListBorrowed)
|
||||||
-> RawServoDeclarationBlockStrong;
|
-> RawServoDeclarationBlockStrong;
|
||||||
}
|
}
|
||||||
|
extern "C" {
|
||||||
|
pub fn Servo_AnimationValues_GetOpacity(value:
|
||||||
|
RawServoAnimationValueBorrowed)
|
||||||
|
-> f32;
|
||||||
|
}
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal)
|
pub fn Servo_ParseStyleAttribute(data: *const nsACString_internal)
|
||||||
-> RawServoDeclarationBlockStrong;
|
-> RawServoDeclarationBlockStrong;
|
||||||
|
|
|
@ -205,6 +205,18 @@ pub extern "C" fn Servo_AnimationValues_Uncompute(value: RawServoAnimationValueB
|
||||||
})).into_strong()
|
})).into_strong()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn Servo_AnimationValues_GetOpacity(value: RawServoAnimationValueBorrowed)
|
||||||
|
-> f32
|
||||||
|
{
|
||||||
|
let value = AnimationValue::as_arc(&value);
|
||||||
|
if let AnimationValue::Opacity(opacity) = **value {
|
||||||
|
opacity
|
||||||
|
} else {
|
||||||
|
panic!("The AnimationValue should be Opacity");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Takes a ServoAnimationValues and populates it with the animation values corresponding
|
/// Takes a ServoAnimationValues and populates it with the animation values corresponding
|
||||||
/// to a given property declaration block
|
/// to a given property declaration block
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue