servo: Change some debug comment style and statements
Source-Repo:
https://github.com/servo/servo
Source-Revision:
4e9e6795475f394e2082049c718c041019614dc5
--- a/servo/src/servo/gfx/display_list.rs
+++ b/servo/src/servo/gfx/display_list.rs
@@ -83,13 +83,13 @@ type DisplayList = DVec<~DisplayItem>;
trait DisplayListMethods {
fn draw(ctx: &RenderContext);
}
impl DisplayList : DisplayListMethods {
fn draw(ctx: &RenderContext) {
for self.each |item| {
- #debug["drawing %?", item];
+ debug!["drawing %?", item];
item.draw(item, ctx);
}
}
}
\ No newline at end of file
--- a/servo/src/servo/gfx/render_task.rs
+++ b/servo/src/servo/gfx/render_task.rs
@@ -143,19 +143,18 @@ pub fn draw_glyphs(ctx: &RenderContext,
use azure::bindgen::{AzCreateScaledFontWithCairo,
AzReleaseScaledFont,
AzCreateColorPattern,
AzReleaseColorPattern};
use azure::cairo::bindgen::cairo_scaled_font_destroy;
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,
mFont: null()
};
let cfont = get_cairo_font(font);
let azfont = AzCreateScaledFontWithCairo(addr_of(nfont), 1f as AzFloat, cfont);
--- a/servo/src/servo/layout/display_list_builder.rs
+++ b/servo/src/servo/layout/display_list_builder.rs
@@ -13,62 +13,58 @@ use geom::rect::Rect;
use geom::size::Size2D;
use gfx::geometry::au;
use layout::text::TextBoxData;
use layout::base::{TextBox, BoxTree};
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
* `box` - The box to build the display list for.
* `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
* `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>) {
// TODO: each box should know how to make its own display items.
// The display list builder should mainly hold information about
// the initial request and desired result---for example, is the
// DisplayList to be used for painting or hit testing. This can
// influence which boxes are created.
@@ -76,17 +72,17 @@ fn box_to_display_items(list: dl::Displa
// TODO: to implement stacking contexts correctly, we need to
// create a set of display lists, one per each layer of a stacking
// context. (CSS 2.1, Section 9.9.1). Each box is passed the list
// set representing the box's stacking context. When asked to
// construct its constituent display items, each box puts its
// 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);
match box.kind {
TextBox(d) => {
let mut runs = d.runs;
list.push(~dl::SolidColor(bounds, 255u8, 255u8, 255u8));
@@ -119,17 +115,17 @@ fn box_to_display_items(list: dl::Displa
} else {
// DAC
// TODO: shouldn't need to unbox CSSValue by now
let boxed_color = box.node.style().background_color;
let color = match boxed_color {
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));
}
}
fn should_convert_text_boxes_to_solid_color_background_items() {
#[test];