mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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:
parent
00e2a1c62a
commit
b5d51dd263
20 changed files with 381 additions and 555 deletions
|
@ -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())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue