mirror of
https://github.com/servo/servo.git
synced 2025-07-17 04:13:42 +01:00
compositor: Unify the cross process and in-process API (#36543)
Because there used to be two traits exposing messages to the compositor, there were two kinds of messages that could be sent: 1. In-process messages from the `Constellation` 2. Cross-process messages from other parts of Servo Now these two types of messages can be unified into one type. This is a reland of #36443, which caused regressions due to the fact that messages to the compositor were no longer triggering the event loop waker. This version of the PR splits out just the bits that unify the two APIs, leaving the cleanup of routes in the constellation for another PR. Testing: This is covered by existing WPT tests. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
980a42d7f7
commit
e9daec7d42
7 changed files with 87 additions and 183 deletions
|
@ -2,7 +2,7 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use compositing_traits::CrossProcessCompositorMessage;
|
||||
use compositing_traits::CompositorMsg;
|
||||
use dom_struct::dom_struct;
|
||||
use euclid::Size2D;
|
||||
use profile_traits::ipc;
|
||||
|
@ -41,7 +41,7 @@ impl Screen {
|
|||
self.window
|
||||
.compositor_api()
|
||||
.sender()
|
||||
.send(CrossProcessCompositorMessage::GetScreenSize(
|
||||
.send(CompositorMsg::GetScreenSize(
|
||||
self.window.webview_id(),
|
||||
sender,
|
||||
))
|
||||
|
@ -57,7 +57,7 @@ impl Screen {
|
|||
self.window
|
||||
.compositor_api()
|
||||
.sender()
|
||||
.send(CrossProcessCompositorMessage::GetAvailableScreenSize(
|
||||
.send(CompositorMsg::GetAvailableScreenSize(
|
||||
self.window.webview_id(),
|
||||
sender,
|
||||
))
|
||||
|
|
|
@ -1884,10 +1884,7 @@ impl Window {
|
|||
let (sender, receiver) =
|
||||
ProfiledIpc::channel::<DeviceIndependentIntRect>(timer_profile_chan).unwrap();
|
||||
let _ = self.compositor_api.sender().send(
|
||||
compositing_traits::CrossProcessCompositorMessage::GetClientWindowRect(
|
||||
self.webview_id(),
|
||||
sender,
|
||||
),
|
||||
compositing_traits::CompositorMsg::GetClientWindowRect(self.webview_id(), sender),
|
||||
);
|
||||
let rect = receiver.recv().unwrap_or_default();
|
||||
(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue