Fix for race condition causing reftests to hang under load.

If the root layer has a zero size rectangle, it will never be
painted, so assume the pipeline is idle in that case.

Re-enable two reftests that were disabled due to this issue.
This commit is contained in:
Glenn Watson 2015-03-16 15:04:00 +10:00
parent 7ca3c8d6e3
commit 591b10aa58
2 changed files with 15 additions and 6 deletions

View file

@ -15,7 +15,7 @@ use std::cmp;
use std::mem;
use geom::point::{Point2D, TypedPoint2D};
use geom::rect::{Rect, TypedRect};
use geom::size::TypedSize2D;
use geom::size::{Size2D, TypedSize2D};
use geom::scale_factor::ScaleFactor;
use gfx::color;
use gfx::paint_task::Msg as PaintMsg;
@ -450,8 +450,18 @@ impl<Window: WindowMethods> IOCompositor<Window> {
return false;
}
return self.pipeline_details.values().all(|ref details| {
details.paint_state == PaintState::Idle
});
// If a pipeline exists and has a root layer that has
// zero size, it will never be painted. In this case,
// consider it as idle to avoid hangs in reftests.
if let Some(ref pipeline) = details.pipeline {
if let Some(root_layer) = self.find_pipeline_root_layer(pipeline.id) {
if root_layer.bounds.borrow().size == Size2D::zero() {
return true;
}
}
}
details.paint_state == PaintState::Idle
});
}
fn has_paint_msg_tracking(&self) -> bool {

View file

@ -95,6 +95,8 @@ flaky_cpu == append_style_a.html append_style_b.html
== iframe/bg_color.html iframe/bg_color_ref.html
== iframe/hide_and_show.html iframe/hide_and_show_ref.html
== iframe/hide_layers1.html iframe/hide_layers_ref.html
== iframe/hide_layers2.html iframe/hide_layers_ref.html
== iframe/multiple_external.html iframe/multiple_external_ref.html
== iframe/overflow.html iframe/overflow_ref.html
== iframe/positioning_margin.html iframe/positioning_margin_ref.html
@ -107,9 +109,6 @@ flaky_cpu == append_style_a.html append_style_b.html
== iframe/simple_inline_width_height.html iframe/simple_inline_width_height_ref.html
== iframe/simple_inline_width_percentage.html iframe/simple_inline_width_percentage_ref.html
# gw: race condition here caused by pipelines never painting when removed from document
#== iframe/hide_layers1.html iframe/hide_layers_ref.html
#== iframe/hide_layers2.html iframe/hide_layers_ref.html
!= image_rendering_auto_a.html image_rendering_pixelated_a.html
== image_rendering_pixelated_a.html image_rendering_pixelated_ref.html
== img_block_display_a.html img_block_display_ref.html