Stall PaintTask exit until it can release all buffers

It is possible for a PaintTask to start exiting soon after sending new
buffers to the compositor. In that case, the compositor should return
the now unnecessary buffers to the PaintTask so that it can properly
free them.

To accomplish this, the compositor now keeps a hash map of paint task
channels per pipeline id. When a PaintTask exists, the constellation
informs the compositor that it can forget about it. Additionally, the
PaintTask should not wait for any buffers when the engine is doing a
complete shutdown. In that case, the compositor is already halted and
has simply let all buffers leak. We pipe through the shutdown type when
destroying the pipeline to make this decision.

Fixes #2641.
This commit is contained in:
Martin Robinson 2015-01-02 09:34:52 -08:00
parent 141b5d038f
commit c0b397322f
13 changed files with 180 additions and 103 deletions

View file

@ -216,6 +216,8 @@ pub enum Msg {
KeyEvent(Key, KeyModifiers),
/// Changes the cursor.
SetCursor(Cursor),
/// Informs the compositor that the paint task for the given pipeline has exited.
PaintTaskExited(PipelineId),
}
impl Show for Msg {
@ -240,6 +242,7 @@ impl Show for Msg {
Msg::ScrollTimeout(..) => write!(f, "ScrollTimeout"),
Msg::KeyEvent(..) => write!(f, "KeyEvent"),
Msg::SetCursor(..) => write!(f, "SetCursor"),
Msg::PaintTaskExited(..) => write!(f, "PaintTaskExited"),
}
}
}