pub fn from_tree(tree: Tree) -> BuiltSVG {
        let global_transform = Transform2F::default();

        let mut built_svg = BuiltSVG {
            scene: Scene::new(),
            result_flags: BuildResultFlags::empty(),
        };

        let root = &tree.root();
        match *root.borrow() {
            NodeKind::Svg(ref svg) => {
                built_svg.scene.set_view_box(usvg_rect_to_euclid_rect(&svg.view_box.rect));
                for kid in root.children() {
                    built_svg.process_node(&kid, &global_transform);
                }
            }
            _ => unreachable!(),
        };

        // FIXME(pcwalton): This is needed to avoid stack exhaustion in debug builds when
        // recursively dropping reference counts on very large SVGs. :(
        mem::forget(tree);

        built_svg
    }
// TODO(pcwalton): Allow a global transform to be set.
Allow a global transform to be set.
Allow a global transform to be set .
pub fn from_tree(tree: Tree) -> BuiltSVG {
        let global_transform = Transform2F::default();
        let mut built_svg = BuiltSVG {
            scene: Scene::new(),
            result_flags: BuildResultFlags::empty(),
        };
        let root = &tree.root();
        match *root.borrow() {
            NodeKind::Svg(ref svg) => {
                built_svg.scene.set_view_box(usvg_rect_to_euclid_rect(&svg.view_box.rect));
                for kid in root.children() {
                    built_svg.process_node(&kid, &global_transform);
                }
            }
            _ => unreachable!(),
        };
        // FIXME(pcwalton): This is needed to avoid stack exhaustion in debug builds when
        // recursively dropping reference counts on very large SVGs. :(
        mem::forget(tree);
        built_svg
    }
pub fn from_tree ( tree : Tree ) -> BuiltSVG { let global_transform = Transform2F :: default ( ) ; let mut built_svg = BuiltSVG { scene : Scene :: new ( ) , result_flags : BuildResultFlags :: empty ( ) , } ; let root = & tree . root ( ) ; match * root . borrow ( ) { NodeKind :: Svg ( ref svg ) => { built_svg . scene . set_view_box ( usvg_rect_to_euclid_rect ( & svg . view_box . rect ) ) ; for kid in root . children ( ) { built_svg . process_node ( & kid , & global_transform ) ; } } _ => unreachable ! ( ) , } ; // FIXME(pcwalton): This is needed to avoid stack exhaustion in debug builds when // recursively dropping reference counts on very large SVGs. :( mem :: forget ( tree ) ; built_svg }
TODO(pcwalton): Allow a global transform to be set.
TODO ( pcwalton ) : Allow a global transform to be set .
tree
Tree