Switch to using WebRender hit testing

This trades quite a bit of complicated code in Servo for few more
messages and a significant performance improvement. In particular,
WebRender can search the entire display list at once instead of
ping-ponging down the pipeline tree. This allows us to send mouse
events to the correct pipeline immediately.
This commit is contained in:
Martin Robinson 2017-09-30 15:50:47 +02:00
parent 00e2a1c62a
commit b5d51dd263
20 changed files with 381 additions and 555 deletions

View file

@ -246,6 +246,17 @@ impl PipelineId {
webrender_api::PipelineId(namespace_id, index.get())
}
#[allow(unsafe_code)]
pub fn from_webrender(pipeline: webrender_api::PipelineId) -> PipelineId {
let webrender_api::PipelineId(namespace_id, index) = pipeline;
unsafe {
PipelineId {
namespace_id: PipelineNamespaceId(namespace_id),
index: PipelineIndex(NonZero::new_unchecked(index)),
}
}
}
pub fn root_scroll_node(&self) -> webrender_api::ClipId {
webrender_api::ClipId::root_scroll_node(self.to_webrender())
}