Change some debug comment style and statements

This commit is contained in:
Brian J. Burg 2012-09-18 13:28:14 -07:00
parent 197d5f440e
commit 4e9e679547
3 changed files with 13 additions and 18 deletions

View file

@ -88,7 +88,7 @@ trait DisplayListMethods {
impl DisplayList : DisplayListMethods {
fn draw(ctx: &RenderContext) {
for self.each |item| {
#debug["drawing %?", item];
debug!["drawing %?", item];
item.draw(item, ctx);
}
}

View file

@ -148,9 +148,8 @@ pub fn draw_glyphs(ctx: &RenderContext, bounds: Rect<au>, text_run: &GlyphRun) {
let draw_target = ctx.canvas.azure_draw_target;
// FIXME: The font library should not be created here
let flib = FontCache();
let font = flib.get_test_font();
// FIXME: font should be accessible from GlyphRun
let font = ctx.font_cache.get_test_font();
let nfont: AzNativeFont = {
mType: AZ_NATIVE_FONT_CAIRO_FONT_FACE,

View file

@ -18,19 +18,16 @@ use servo_text::text_run::TextRun;
use util::tree;
use vec::push;
#[doc = "
/**
Builds a display list for a box and all its children
"]
*/
fn build_display_list(box : @Box) -> dl::DisplayList {
let list = DVec();
build_display_list_from_origin(list, box, Point2D(au(0), au(0)));
return list;
}
#[doc="
/**
Builds a display list for a box and all its children.
# Arguments
@ -39,23 +36,22 @@ Builds a display list for a box and all its children.
* `origin` - The coordinates of upper-left corner of the box containing the
passed-in box.
"]
*/
fn build_display_list_from_origin(list: dl::DisplayList, box: @Box, origin: Point2D<au>) {
let box_origin = Point2D(
au::from_px(au::to_px(origin.x) + au::to_px(box.data.position.origin.x)),
au::from_px(au::to_px(origin.y) + au::to_px(box.data.position.origin.y)));
#debug("Handed origin %?, box has bounds %?, starting with origin %?", origin, box.data.position.size, box_origin);
debug!("Handed origin %?, box has bounds %?, starting with origin %?", origin, box.data.position.size, box_origin);
box_to_display_items(list, box, box_origin);
for BoxTree.each_child(box) |c| {
#debug("Recursively building display list with origin %?", box_origin);
debug!("Recursively building display list with origin %?", box_origin);
build_display_list_from_origin(list, c, box_origin);
}
}
#[doc="
/**
Creates a display list item for a single block.
# Arguments
@ -63,7 +59,7 @@ Creates a display list item for a single block.
* `box` - The box to build the display list for
* `origin` - The coordinates of upper-left corner of the passed in box.
"]
*/
#[allow(non_implicitly_copyable_typarams)]
fn box_to_display_items(list: dl::DisplayList, box: @Box, origin: Point2D<au>) {
@ -81,7 +77,7 @@ fn box_to_display_items(list: dl::DisplayList, box: @Box, origin: Point2D<au>) {
// DisplayItems into the correct stack layer (according to CSS 2.1
// Appendix E). and then builder flattens the list at the end.
#debug("request to display a box from origin %?", origin);
debug!("request to display a box from origin %?", origin);
let bounds : Rect<au> = Rect(origin, copy box.data.position.size);
@ -124,7 +120,7 @@ fn box_to_display_items(list: dl::DisplayList, box: @Box, origin: Point2D<au>) {
Specified(BgColor(c)) => c,
Specified(BgTransparent) | _ => util::color::rgba(0,0,0,0.0)
};
#debug("Assigning color %? to box with bounds %?", color, bounds);
debug!("Assigning color %? to box with bounds %?", color, bounds);
list.push(~dl::SolidColor(bounds, color.red, color.green, color.blue));
}
}