diff --git a/src/servo/gfx/display_list.rs b/src/servo/gfx/display_list.rs index 736a24184fb..a8e03750336 100644 --- a/src/servo/gfx/display_list.rs +++ b/src/servo/gfx/display_list.rs @@ -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); } } diff --git a/src/servo/gfx/render_task.rs b/src/servo/gfx/render_task.rs index b05668cedad..6e438f4cef9 100644 --- a/src/servo/gfx/render_task.rs +++ b/src/servo/gfx/render_task.rs @@ -148,9 +148,8 @@ pub fn draw_glyphs(ctx: &RenderContext, bounds: Rect, 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, diff --git a/src/servo/layout/display_list_builder.rs b/src/servo/layout/display_list_builder.rs index ee4f068f0db..6dbb98189cd 100644 --- a/src/servo/layout/display_list_builder.rs +++ b/src/servo/layout/display_list_builder.rs @@ -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) { 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) { @@ -81,7 +77,7 @@ fn box_to_display_items(list: dl::DisplayList, box: @Box, origin: Point2D) { // 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 = Rect(origin, copy box.data.position.size); @@ -124,7 +120,7 @@ fn box_to_display_items(list: dl::DisplayList, box: @Box, origin: Point2D) { 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)); } }