Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of changes #515

Merged
merged 25 commits into from Jun 14, 2013
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a53a7f6
Add link following and refactor the profiler.
Jun 6, 2013
9085b88
Implement scrolling and better zooming
Jun 6, 2013
abe6a06
Update rust-layers for GL_LINEAR zooming
pcwalton Jun 6, 2013
bf4df24
Provide an interface to the engine for the script task
Jun 6, 2013
ff1178f
handle relative url's when clicking
Jun 6, 2013
0bbf2fc
Refactor flow tree construction and actually use display property.
Jun 8, 2013
1fbfd7d
Implement horizontal scrolling and pinch-to-zoom
pcwalton Jun 9, 2013
7b28462
Send status messages to the compositor
Jun 7, 2013
a9ed2d8
Spin the event loop every 50 ms to allow Rust channels to be processed.
pcwalton Jun 10, 2013
e50cee9
Resolve relative URLs that begin with '//'
pcwalton Jun 10, 2013
f3ad95f
Added a command-line argument for rendering tiles at higher resolutions
Jun 11, 2013
1aa8d64
Fix URL relativization so that links on Wikipedia work
pcwalton Jun 11, 2013
96b9be6
Add a cheesy progress indicator
pcwalton Jun 11, 2013
204c5b6
Add a spinner for layout
pcwalton Jun 11, 2013
aad5113
Update submodules
pcwalton Jun 12, 2013
162ba83
Fix merge fallout
pcwalton Jun 12, 2013
aee2611
Make script and style display:none
pcwalton Jun 12, 2013
e1b9e01
Fix merge fallout which was disabling all CSS classes.
pcwalton Jun 12, 2013
327e799
test: Add a box model smoketest
pcwalton Jun 12, 2013
b75b2de
Compute percent widths/margins properly and fix numerous small visual…
Jun 4, 2013
4017839
Fix padding
Jun 4, 2013
badf1b8
Vertical margins now contribute to content height.
Jun 4, 2013
f3cdbaf
Stop sorting after every profiler datum comes in.
pcwalton Jun 13, 2013
2ec3412
Fix submodules and test_slam_layout
pcwalton Jun 13, 2013
c35abb2
Update rust-glut
pcwalton Jun 14, 2013
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Added a command-line argument for rendering tiles at higher resolutions

  • Loading branch information
eschweic authored and pcwalton committed Jun 12, 2013
commit f3ad95fa01e2c1363d3a9de674ae77828421b1e9
@@ -12,6 +12,8 @@ pub struct LayerBuffer {
// The rect in the containing RenderLayer that this represents.
rect: Rect<uint>,

screen_pos: Rect<uint>,

// NB: stride is in pixels, like OpenGL GL_UNPACK_ROW_LENGTH.
stride: uint
}
@@ -14,6 +14,10 @@ pub struct Opts {
n_render_threads: uint,
tile_size: uint,
profiler_period: Option<f64>,

/// A scale factor to apply to tiles, to allow rendering tiles at higher resolutions for
/// testing pan and zoom code.
zoom: uint,
}

#[allow(non_implicitly_copyable_typarams)]
@@ -28,6 +32,7 @@ pub fn from_cmdline_args(args: &[~str]) -> Opts {
getopts::optopt(~"s"), // size of tiles
getopts::optopt(~"t"), // threads to render with
getopts::optflagopt(~"p"), // profiler flag and output interval
getopts::optopt(~"z"), // zoom level
];

let opt_match = match getopts::getopts(args, opts) {
@@ -76,11 +81,17 @@ pub fn from_cmdline_args(args: &[~str]) -> Opts {
None => None,
};

let zoom: uint = match getopts::opt_maybe_str(&opt_match, ~"z") {
Some(zoom_str) => uint::from_str(zoom_str).get(),
None => 1,
};

Opts {
urls: urls,
render_backend: render_backend,
n_render_threads: n_render_threads,
tile_size: tile_size,
profiler_period: profiler_period,
zoom: zoom,
}
}
@@ -37,6 +37,7 @@ pub fn render_layers(layer_ref: *RenderLayer,
f: RenderFn)
-> LayerBufferSet {
let tile_size = opts.tile_size;
let scale = opts.zoom;

// FIXME: Try not to create a new array here.
let mut new_buffer_ports = ~[];
@@ -45,12 +46,12 @@ pub fn render_layers(layer_ref: *RenderLayer,
do time::profile(time::RenderingPrepBuffCategory, prof_chan.clone()) {
let layer: &RenderLayer = unsafe { cast::transmute(layer_ref) };
let mut y = 0;
while y < layer.size.height {
while y < layer.size.height * scale {
let mut x = 0;
while x < layer.size.width {
while x < layer.size.width * scale {
// Figure out the dimension of this tile.
let right = uint::min(x + tile_size, layer.size.width);
let bottom = uint::min(y + tile_size, layer.size.height);
let right = uint::min(x + tile_size, layer.size.width * scale);
let bottom = uint::min(y + tile_size, layer.size.height * scale);
let width = right - x;
let height = bottom - y;

@@ -65,7 +66,8 @@ pub fn render_layers(layer_ref: *RenderLayer,

debug!("tile aligned_width %u", aligned_width);

let tile_rect = Rect(Point2D(x, y), Size2D(aligned_width, height));
let tile_rect = Rect(Point2D(x / scale, y / scale), Size2D(aligned_width, height)); //change this
let screen_rect = Rect(Point2D(x, y), Size2D(aligned_width, height)); //change this

let buffer;
// FIXME: Try harder to search for a matching tile.
@@ -112,6 +114,7 @@ pub fn render_layers(layer_ref: *RenderLayer,
stride,
B8G8R8A8),
rect: tile_rect,
screen_pos: screen_rect,
stride: stride as uint
};
//}
@@ -140,17 +140,24 @@ impl<C: Compositor + Owned> Renderer<C> {

// Apply the translation to render the tile we want.
let matrix: Matrix2D<AzFloat> = Matrix2D::identity();
let matrix = matrix.translate(&-(layer_buffer.rect.origin.x as AzFloat),
&-(layer_buffer.rect.origin.y as AzFloat));
let scale = thread_render_context.opts.zoom as f32;

let matrix = matrix.scale(scale as AzFloat, scale as AzFloat);
let matrix = matrix.translate(-(layer_buffer.rect.origin.x as f32) as AzFloat,
-(layer_buffer.rect.origin.y as f32) as AzFloat);


layer_buffer.draw_target.set_transform(&matrix);

// Clear the buffer.
ctx.clear();


// Draw the display list.
let render_layer: &RenderLayer = unsafe {
cast::transmute(render_layer_ref)
};

render_layer.display_list.draw_into_context(&ctx);
}

@@ -206,7 +206,7 @@ fn run_main_loop(port: Port<Msg>,
Some(_) => fail!(~"found unexpected layer kind"),
};

let origin = buffer.rect.origin;
let origin = buffer.screen_pos.origin;
let origin = Point2D(origin.x as f32, origin.y as f32);

// Set the layer's transform.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.