servo: Merge #4536 - Stall PaintTask exit until it can release all buffers (from mrobinson:pixmap); r=pcwalton

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.

Source-Repo: https://github.com/servo/servo
Source-Revision: a31acffb0405b2c38b39c39c6d552f2ba79b6326
This commit is contained in:
Martin Robinson
2015-01-02 20:21:47 -07:00
parent 473efad71a
commit 6c0ac241fb
13 changed files with 180 additions and 103 deletions

View File

@@ -26,6 +26,7 @@ use devtools_traits::DevtoolsControlChan;
use libc::c_void;
use servo_msg::constellation_msg::{ConstellationChan, PipelineId, Failure, WindowSizeData};
use servo_msg::constellation_msg::{LoadData, SubpageId, Key, KeyState, KeyModifiers};
use servo_msg::constellation_msg::PipelineExitType;
use servo_msg::compositor_msg::ScriptListener;
use servo_net::image_cache_task::ImageCacheTask;
use servo_net::resource_task::ResourceTask;
@@ -60,7 +61,7 @@ pub enum ConstellationControlMsg {
/// Notifies script that window has been resized but to not take immediate action.
ResizeInactiveMsg(PipelineId, WindowSizeData),
/// Notifies the script that a pipeline should be closed.
ExitPipelineMsg(PipelineId),
ExitPipelineMsg(PipelineId, PipelineExitType),
/// Sends a DOM event.
SendEventMsg(PipelineId, CompositorEvent),
/// Notifies script that reflow is finished.