diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-05-09 12:43:19 +0000 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2019-05-10 12:43:05 +0200 |
commit | f429c28f23bb21812deb042bf50e4bf16b9e1f1b (patch) | |
tree | a8db3e1774db4cc31bf25c65926dbc4779d298dd /components/style/gecko/conversions.rs | |
parent | 0d5c4481b8b5f96325260ee0ffc2b5f206c97548 (diff) | |
download | servo-f429c28f23bb21812deb042bf50e4bf16b9e1f1b.tar.gz servo-f429c28f23bb21812deb042bf50e4bf16b9e1f1b.zip |
style: Add bindings for ArcSlice and ThinArc, and use them to reduce copies of SVG path data.
As I said over bug 1549593, the eventual goal is to use ArcSlice in all
inherited properties. But this seemed like a good first candidate that doesn't
require me to move around a lot more code, since we were already using cbindgen
for the path commands.
Differential Revision: https://phabricator.services.mozilla.com/D30134
Diffstat (limited to 'components/style/gecko/conversions.rs')
-rw-r--r-- | components/style/gecko/conversions.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 748396630fb..607c7388c3d 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -577,12 +577,10 @@ pub mod basic_shape { /// Generate a SVGPathData from StyleShapeSource if possible. fn to_svg_path(&self) -> Option<SVGPathData> { - use crate::values::specified::svg_path::PathCommand; match self.mType { StyleShapeSourceType::Path => { let gecko_path = unsafe { &*self.__bindgen_anon_1.mSVGPath.as_ref().mPtr }; - let result: Vec<PathCommand> = gecko_path.mPath.iter().cloned().collect(); - Some(SVGPathData::new(result.into_boxed_slice())) + Some(SVGPathData(gecko_path.mPath.clone())) }, _ => None, } |