Skip to content

Commit

Permalink
Remove the cap on the number of iterations when tiling.
Browse files Browse the repository at this point in the history
This could trigger spuriously for very long lines outside the view box. It
still indicates potential performance problem, but we shouldn't crash at least.

Closes rust-windowing#416.
  • Loading branch information
pcwalton committed Jul 28, 2020
1 parent 41ad372 commit 441051a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions renderer/src/tiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,8 @@ fn process_line_segment(line_segment: LineSegment2F,

let (mut current_position, mut tile_coords) = (line_segment.from(), from_tile_coords);
let mut last_step_direction = None;
let mut iteration = 0;

loop {
// Quick check to catch missing the end tile.
debug_assert!(iteration < MAX_ITERATIONS);

let next_step_direction = if t_max.x() < t_max.y() {
StepDirection::X
} else if t_max.x() > t_max.y() {
Expand Down Expand Up @@ -302,11 +298,7 @@ fn process_line_segment(line_segment: LineSegment2F,

current_position = next_position;
last_step_direction = next_step_direction;

iteration += 1;
}

const MAX_ITERATIONS: u32 = 1024;
}

#[derive(Clone, Copy, PartialEq, Debug)]
Expand Down

0 comments on commit 441051a

Please sign in to comment.