Implement to_transform_3d_matrix for computing distance of mismatched transform lists.

We could use this method to convert a TransformList into a Matrix, and
use this matrix for computing distance for Stylo and rendering the transform
for Servo.

This is an equivalent of nsStyleTransformMatrix::ReadTransforms in Gecko.
This commit is contained in:
Boris Chiou 2017-08-22 10:25:35 +08:00
parent 772a8464eb
commit 5c2d8507be
5 changed files with 215 additions and 146 deletions

View file

@ -4,6 +4,7 @@
//! Computed angles.
use euclid::Radians;
use std::{f32, f64, fmt};
use std::f64::consts::PI;
use style_traits::ToCss;
@ -112,3 +113,10 @@ impl ToCss for Angle {
}
}
}
impl From<Angle> for Radians<CSSFloat> {
#[inline]
fn from(a: Angle) -> Self {
Radians::new(a.radians())
}
}