Fix a compositor race condition that can result in the most recent buffer not being painted.

This commit is contained in:
Glenn Watson 2015-05-12 10:34:05 +10:00
parent 885068207f
commit 79942f0920
4 changed files with 44 additions and 22 deletions

View file

@ -43,6 +43,16 @@ impl Epoch {
}
}
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
pub struct FrameTreeId(pub u32);
impl FrameTreeId {
pub fn next(&mut self) {
let FrameTreeId(ref mut u) = *self;
*u += 1;
}
}
#[derive(Clone, PartialEq, Eq, Copy)]
pub struct LayerId(pub usize, pub u32);
@ -99,7 +109,8 @@ pub trait PaintListener {
fn assign_painted_buffers(&mut self,
pipeline_id: PipelineId,
epoch: Epoch,
replies: Vec<(LayerId, Box<LayerBufferSet>)>);
replies: Vec<(LayerId, Box<LayerBufferSet>)>,
frame_tree_id: FrameTreeId);
fn paint_msg_discarded(&mut self);
fn set_paint_state(&mut self, PipelineId, PaintState);