Drop Servo_AnimationValues_Populate.

This commit is contained in:
Hiroyuki Ikezoe 2017-02-23 10:39:09 +09:00
parent f94ee515a3
commit bb3f2e9dba
2 changed files with 0 additions and 70 deletions

View file

@ -1351,16 +1351,6 @@ extern "C" {
result:
RawGeckoComputedKeyframeValuesListBorrowedMut);
}
extern "C" {
pub fn Servo_AnimationValues_Populate(arg1:
RawGeckoAnimationValueListBorrowedMut,
arg2:
RawServoDeclarationBlockBorrowed,
arg3: ServoComputedValuesBorrowed,
arg4:
ServoComputedValuesBorrowedOrNull,
arg5: RawGeckoPresContextBorrowed);
}
extern "C" {
pub fn Servo_AnimationValues_Interpolate(from:
RawServoAnimationValueBorrowed,

View file

@ -41,7 +41,6 @@ use style::gecko_bindings::bindings::{RawServoStyleSheetStrong, ServoComputedVal
use style::gecko_bindings::bindings::{ServoCssRulesBorrowed, ServoCssRulesStrong};
use style::gecko_bindings::bindings::{nsACString, nsAString};
use style::gecko_bindings::bindings::Gecko_AnimationAppendKeyframe;
use style::gecko_bindings::bindings::RawGeckoAnimationValueListBorrowedMut;
use style::gecko_bindings::bindings::RawGeckoComputedKeyframeValuesListBorrowedMut;
use style::gecko_bindings::bindings::RawGeckoElementBorrowed;
use style::gecko_bindings::bindings::RawGeckoPresContextBorrowed;
@ -327,65 +326,6 @@ pub extern "C" fn Servo_AnimationValue_DeepEqual(this: RawServoAnimationValueBor
this_value == other_value
}
/// Takes a ServoAnimationValues and populates it with the animation values corresponding
/// to a given property declaration block
#[no_mangle]
pub extern "C" fn Servo_AnimationValues_Populate(anim: RawGeckoAnimationValueListBorrowedMut,
declarations: RawServoDeclarationBlockBorrowed,
style: ServoComputedValuesBorrowed,
parent_style: ServoComputedValuesBorrowedOrNull,
pres_context: RawGeckoPresContextBorrowed)
{
use style::properties::declaration_block::Importance;
use style::values::computed::Context;
let parent_style = parent_style.as_ref().map(|r| &**ComputedValues::as_arc(&r));
// FIXME this might not be efficient since Populate
// is called multiple times. We should precalculate the Context
// and share it across Populate calls
let style = ComputedValues::as_arc(&style);
let declarations = RwLock::<PropertyDeclarationBlock>::as_arc(&declarations);
let guard = declarations.read();
let init = ComputedValues::default_values(pres_context);
let context = Context {
is_root_element: false,
// FIXME (bug 1303229): Use the actual viewport size here
viewport_size: Size2D::new(Au(0), Au(0)),
inherited_style: parent_style.unwrap_or(&init),
style: (**style).clone(),
font_metrics_provider: None,
};
let mut iter = guard.declarations
.iter()
.filter_map(|&(ref decl, imp)| {
if imp == Importance::Normal {
AnimationValue::from_declaration(decl, &context, &init)
} else {
None
}
});
let mut geckoiter = anim.iter_mut();
{
// we reborrow to scope the consumed mutable borrow
// we need to be able to ensure geckoiter is empty later on
// and thus can't directly use `geckoiter`
let local_geckoiter = &mut geckoiter;
for (gecko, servo) in local_geckoiter.zip(&mut iter) {
gecko.mValue.mServo.set_arc_leaky(Arc::new(servo));
}
}
// we should have gone through both iterators
if iter.next().is_some() || geckoiter.next().is_some() {
warn!("stylo: Mismatched sizes of Gecko and Servo \
array during animation value construction");
}
}
#[no_mangle]
pub extern "C" fn Servo_StyleWorkerThreadCount() -> u32 {
GLOBAL_STYLE_DATA.num_threads as u32