Cleanup various debug output.

This commit is contained in:
Brian J. Burg 2012-10-11 15:20:52 -07:00
parent be53bb14f7
commit e01ffd9477
4 changed files with 11 additions and 20 deletions

View file

@ -91,14 +91,14 @@ impl LayoutTreeBuilder {
// if this is a new flow, attach to parent flow and make a new BuilderContext.
if !core::box::ptr_eq(next_flow, parent_ctx.flow) {
debug!("using parent builder context");
debug!("Adding child flow f%? of f%?",
debug!("LayoutTreeBuilder: using parent builder context");
debug!("LayoutTreeBuilder: Adding child flow f%? of f%?",
parent_ctx.flow.d().id, next_flow.d().id);
FlowTree.add_child(parent_ctx.flow, next_flow);
builder_ctx = { flow: next_flow, consumer: BoxConsumer(next_flow) };
} else {
debug!("creating fresh builder context");
debug!("LayoutTreeBuilder: creating fresh builder context");
builder_ctx = copy *parent_ctx;
}
@ -110,7 +110,7 @@ impl LayoutTreeBuilder {
do cur_node.aux |data| { data.flow = Some(builder_ctx.flow) }
let new_box = self.make_box(layout_ctx, box_type, cur_node, builder_ctx.flow);
debug!("Assign ^box to flow: %?", builder_ctx.flow.debug_str());
debug!("LayoutTreeBuilder: Assign ^box to flow f%d", builder_ctx.flow.d().id);
builder_ctx.consumer.push_box(layout_ctx, new_box);
// recurse on child nodes.
@ -193,7 +193,7 @@ impl LayoutTreeBuilder {
Flow_Root => @RootFlow(data, RootFlowData()),
Flow_Table => @TableFlow(data)
};
debug!("Created context: %s", ret.debug_str());
debug!("LayoutTreeBuilder: created flow: %s", ret.debug_str());
ret
}
@ -207,7 +207,7 @@ impl LayoutTreeBuilder {
RenderBox_Text => self.make_text_box(layout_ctx, node, ctx),
RenderBox_Image => self.make_image_box(layout_ctx, node, ctx),
};
debug!("Created box: %s", ret.debug_str());
debug!("LayoutTreeBuilder: created box: %s", ret.debug_str());
ret
}

View file

@ -379,6 +379,6 @@ impl FlowContext : BoxedDebugMethods {
_ => ~"(Unknown flow)"
};
fmt!("c%? %?", self.d().id, repr)
fmt!("f%? %?", self.d().id, repr)
}
}

View file

@ -222,18 +222,14 @@ impl FlowContext : InlineLayout {
fn bubble_widths_inline(@self, ctx: &LayoutContext) {
assert self.starts_inline_flow();
debug!("box count: %u", self.inline().boxes.len());
let scanner = TextRunScanner(self);
scanner.scan_for_runs(ctx);
let mut min_width = au(0);
let mut pref_width = au(0);
debug!("/box count: %u", self.inline().boxes.len());
for self.inline().boxes.each |box| {
debug!("measuring box: %s", box.debug_str());
debug!("FlowContext[%d]: measuring %s", self.d().id, box.debug_str());
min_width = au::max(min_width, box.get_min_width(ctx));
pref_width = au::max(pref_width, box.get_pref_width(ctx));
}
@ -315,11 +311,12 @@ impl FlowContext : InlineLayout {
assert self.starts_inline_flow();
// TODO: if the CSS box introducing this inline context is *not* anonymous,
// we need to draw it too, in a way similar to BlowFlowContext
// we need to draw it too, in a way similar to BlockFlowContext
// TODO: once we form line boxes and have their cached bounds, we can be
// smarter and not recurse on a line if nothing in it can intersect dirty
debug!("building display list for %u inline boxes", self.inline().boxes.len());
debug!("FlowContext[%d]: building display list for %u inline boxes",
self.d().id, self.inline().boxes.len());
for self.inline().boxes.each |box| {
box.build_display_list(builder, dirty, offset, list)
}

View file

@ -26,8 +26,6 @@ impl TextRun {
assert offset < self.text.len();
assert offset + length <= self.text.len();
debug!("enter min_width_for_range(o=%?, l=%?)", offset, length);
let mut max_piece_width = au(0);
// TODO: use a real font reference
let font = ctx.font_cache.get_test_font();
@ -38,7 +36,6 @@ impl TextRun {
}
};
debug!("exit min_width_for_range(o=%?, l=%?)", offset, length);
return max_piece_width;
}
@ -78,8 +75,6 @@ impl TextRun {
assert offset < self.text.len();
assert offset + length <= self.text.len();
debug!("enter iter_indivisible_pieces_for_range(o=%?, l=%?)", offset, length);
//TODO: need a more sophisticated model of words and possible breaks
let text = str::view(self.text, offset, length);
@ -122,7 +117,6 @@ impl TextRun {
}
}
}
debug!("exit iter_indivisible_pieces_for_range(o=%?, l=%?)", offset, length);
}
}