mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Remove more IPC messages between script and layout (#32377)
Instead of bouncing messages from the compositor to script and then to layout, just have script call methods on Layout. Additionally, we do not need to send any followup messages to script for these messages. Instead just execute code after calling the method on Layout.
This commit is contained in:
parent
a7bf099cb1
commit
5f0866379a
6 changed files with 103 additions and 165 deletions
|
@ -30,9 +30,8 @@ use pixels::{CorsStatus, Image, PixelFormat};
|
|||
use profile_traits::time::{self as profile_time, profile, ProfilerCategory};
|
||||
use script_traits::CompositorEvent::{MouseButtonEvent, MouseMoveEvent, TouchEvent, WheelEvent};
|
||||
use script_traits::{
|
||||
AnimationState, AnimationTickType, ConstellationControlMsg, LayoutControlMsg, MouseButton,
|
||||
MouseEventType, ScrollState, TouchEventType, TouchId, WheelDelta, WindowSizeData,
|
||||
WindowSizeType,
|
||||
AnimationState, AnimationTickType, ConstellationControlMsg, MouseButton, MouseEventType,
|
||||
ScrollState, TouchEventType, TouchId, WheelDelta, WindowSizeData, WindowSizeType,
|
||||
};
|
||||
use servo_geometry::{DeviceIndependentPixel, FramebufferUintLength};
|
||||
use style_traits::{CSSPixel, DevicePixel, PinchZoomFactor};
|
||||
|
@ -1940,10 +1939,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
});
|
||||
|
||||
if let Some(pipeline) = details.pipeline.as_ref() {
|
||||
let message = ConstellationControlMsg::ForLayoutFromConstellation(
|
||||
LayoutControlMsg::SetScrollStates(scroll_states),
|
||||
*pipeline_id,
|
||||
);
|
||||
let message = ConstellationControlMsg::SetScrollStates(*pipeline_id, scroll_states);
|
||||
let _ = pipeline.script_chan.send(message);
|
||||
}
|
||||
}
|
||||
|
@ -2154,11 +2150,14 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
to_remove.push(*id);
|
||||
if let Some(pipeline) = self.pipeline(*id) {
|
||||
// and inform layout with the measured paint time.
|
||||
let message = LayoutControlMsg::PaintMetric(epoch, paint_time);
|
||||
let message =
|
||||
ConstellationControlMsg::ForLayoutFromConstellation(message, *id);
|
||||
if let Err(e) = pipeline.script_chan.send(message) {
|
||||
warn!("Sending PaintMetric message to layout failed ({:?}).", e);
|
||||
if let Err(e) =
|
||||
pipeline
|
||||
.script_chan
|
||||
.send(ConstellationControlMsg::SetEpochPaintTime(
|
||||
*id, epoch, paint_time,
|
||||
))
|
||||
{
|
||||
warn!("Sending RequestLayoutPaintMetric message to layout failed ({e:?}).");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue