mirror of
https://github.com/servo/servo.git
synced 2025-06-28 11:03:39 +01:00
layout: Refactor flow construction to move around large structs less.
5% perf win, and a net loss in lines of code.
This commit is contained in:
parent
48e9b8f752
commit
d34ebf521d
4 changed files with 34 additions and 52 deletions
|
@ -9,9 +9,9 @@ use layout::context::LayoutContext;
|
|||
use layout::display_list_builder::{DisplayListBuilder, ExtraDisplayListData};
|
||||
use layout::flow::{BaseFlow, FlowClass, Flow, InlineFlowClass};
|
||||
use layout::flow;
|
||||
use layout::float_context::FloatContext;
|
||||
use layout::float_context::{FloatContext, FloatLeft, PlacementInfo};
|
||||
use layout::util::ElementMapping;
|
||||
use layout::float_context::{PlacementInfo, FloatLeft};
|
||||
use layout::wrapper::ThreadSafeLayoutNode;
|
||||
|
||||
use extra::container::Deque;
|
||||
use extra::ringbuf::RingBuf;
|
||||
|
@ -466,18 +466,9 @@ pub struct InlineFlow {
|
|||
}
|
||||
|
||||
impl InlineFlow {
|
||||
pub fn new(base: BaseFlow) -> InlineFlow {
|
||||
pub fn from_boxes(id: int, node: ThreadSafeLayoutNode, boxes: ~[Box]) -> InlineFlow {
|
||||
InlineFlow {
|
||||
base: base,
|
||||
boxes: ~[],
|
||||
lines: ~[],
|
||||
elems: ElementMapping::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_boxes(base: BaseFlow, boxes: ~[Box]) -> InlineFlow {
|
||||
InlineFlow {
|
||||
base: base,
|
||||
base: BaseFlow::new(id, node),
|
||||
boxes: boxes,
|
||||
lines: ~[],
|
||||
elems: ElementMapping::new(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue