mirror of
https://github.com/servo/servo.git
synced 2025-06-14 11:24:33 +00:00
Auto merge of #25694 - kunalmohan:24891-Constellation, r=Manishearth
Remove dependency of constellation on canvas
move `ConstellationCanvasMsg` to canvas_traits and start canvas paint thread
to components/servo. This, however, does not remove dependency for conditional
compilation options.
5f55cd5d71/components/constellation/Cargo.toml (L13-L15)
<!-- Please describe your changes on the following line: -->
---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #24891 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
commit
c67b3d71e2
8 changed files with 25 additions and 25 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -534,6 +534,7 @@ dependencies = [
|
||||||
name = "canvas_traits"
|
name = "canvas_traits"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"crossbeam-channel",
|
||||||
"cssparser",
|
"cssparser",
|
||||||
"euclid",
|
"euclid",
|
||||||
"ipc-channel",
|
"ipc-channel",
|
||||||
|
@ -806,7 +807,6 @@ dependencies = [
|
||||||
"background_hang_monitor",
|
"background_hang_monitor",
|
||||||
"backtrace",
|
"backtrace",
|
||||||
"bluetooth_traits",
|
"bluetooth_traits",
|
||||||
"canvas",
|
|
||||||
"canvas_traits",
|
"canvas_traits",
|
||||||
"compositing",
|
"compositing",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
|
|
|
@ -3,8 +3,8 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::canvas_data::*;
|
use crate::canvas_data::*;
|
||||||
use crate::ConstellationCanvasMsg;
|
|
||||||
use canvas_traits::canvas::*;
|
use canvas_traits::canvas::*;
|
||||||
|
use canvas_traits::ConstellationCanvasMsg;
|
||||||
use crossbeam_channel::{select, unbounded, Sender};
|
use crossbeam_channel::{select, unbounded, Sender};
|
||||||
use euclid::default::Size2D;
|
use euclid::default::Size2D;
|
||||||
use ipc_channel::ipc::{self, IpcSender};
|
use ipc_channel::ipc::{self, IpcSender};
|
||||||
|
|
|
@ -4,10 +4,6 @@
|
||||||
|
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
|
|
||||||
use canvas_traits::canvas::CanvasId;
|
|
||||||
use crossbeam_channel::Sender;
|
|
||||||
use euclid::default::Size2D;
|
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate bitflags;
|
extern crate bitflags;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -26,13 +22,3 @@ pub mod canvas_paint_thread;
|
||||||
mod webgl_limits;
|
mod webgl_limits;
|
||||||
mod webgl_mode;
|
mod webgl_mode;
|
||||||
pub mod webgl_thread;
|
pub mod webgl_thread;
|
||||||
|
|
||||||
pub enum ConstellationCanvasMsg {
|
|
||||||
Create {
|
|
||||||
id_sender: Sender<CanvasId>,
|
|
||||||
size: Size2D<u64>,
|
|
||||||
webrender_sender: webrender_api::RenderApiSender,
|
|
||||||
antialias: bool,
|
|
||||||
},
|
|
||||||
Exit,
|
|
||||||
}
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ path = "lib.rs"
|
||||||
webgl_backtrace = []
|
webgl_backtrace = []
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
crossbeam-channel = "0.3"
|
||||||
cssparser = "0.27"
|
cssparser = "0.27"
|
||||||
euclid = "0.20"
|
euclid = "0.20"
|
||||||
ipc-channel = "0.12"
|
ipc-channel = "0.12"
|
||||||
|
|
|
@ -6,6 +6,10 @@
|
||||||
#![crate_type = "rlib"]
|
#![crate_type = "rlib"]
|
||||||
#![deny(unsafe_code)]
|
#![deny(unsafe_code)]
|
||||||
|
|
||||||
|
use crate::canvas::CanvasId;
|
||||||
|
use crossbeam_channel::Sender;
|
||||||
|
use euclid::default::Size2D;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate lazy_static;
|
extern crate lazy_static;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -17,3 +21,13 @@ pub mod canvas;
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
pub mod webgl;
|
pub mod webgl;
|
||||||
mod webgl_channel;
|
mod webgl_channel;
|
||||||
|
|
||||||
|
pub enum ConstellationCanvasMsg {
|
||||||
|
Create {
|
||||||
|
id_sender: Sender<CanvasId>,
|
||||||
|
size: Size2D<u64>,
|
||||||
|
webrender_sender: webrender_api::RenderApiSender,
|
||||||
|
antialias: bool,
|
||||||
|
},
|
||||||
|
Exit,
|
||||||
|
}
|
||||||
|
|
|
@ -10,15 +10,10 @@ publish = false
|
||||||
name = "constellation"
|
name = "constellation"
|
||||||
path = "lib.rs"
|
path = "lib.rs"
|
||||||
|
|
||||||
[features]
|
|
||||||
canvas2d-azure = ["canvas/canvas2d-azure"]
|
|
||||||
canvas2d-raqote = ["canvas/canvas2d-raqote"]
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
background_hang_monitor = { path = "../background_hang_monitor"}
|
background_hang_monitor = { path = "../background_hang_monitor"}
|
||||||
backtrace = "0.3"
|
backtrace = "0.3"
|
||||||
bluetooth_traits = { path = "../bluetooth_traits" }
|
bluetooth_traits = { path = "../bluetooth_traits" }
|
||||||
canvas = {path = "../canvas", default-features = false}
|
|
||||||
canvas_traits = {path = "../canvas_traits"}
|
canvas_traits = {path = "../canvas_traits"}
|
||||||
compositing = {path = "../compositing"}
|
compositing = {path = "../compositing"}
|
||||||
crossbeam-channel = "0.3"
|
crossbeam-channel = "0.3"
|
||||||
|
|
|
@ -103,10 +103,9 @@ use crate::timer_scheduler::TimerScheduler;
|
||||||
use background_hang_monitor::HangMonitorRegister;
|
use background_hang_monitor::HangMonitorRegister;
|
||||||
use backtrace::Backtrace;
|
use backtrace::Backtrace;
|
||||||
use bluetooth_traits::BluetoothRequest;
|
use bluetooth_traits::BluetoothRequest;
|
||||||
use canvas::canvas_paint_thread::CanvasPaintThread;
|
|
||||||
use canvas::ConstellationCanvasMsg;
|
|
||||||
use canvas_traits::canvas::{CanvasId, CanvasMsg};
|
use canvas_traits::canvas::{CanvasId, CanvasMsg};
|
||||||
use canvas_traits::webgl::WebGLThreads;
|
use canvas_traits::webgl::WebGLThreads;
|
||||||
|
use canvas_traits::ConstellationCanvasMsg;
|
||||||
use compositing::compositor_thread::CompositorProxy;
|
use compositing::compositor_thread::CompositorProxy;
|
||||||
use compositing::compositor_thread::Msg as ToCompositorMsg;
|
use compositing::compositor_thread::Msg as ToCompositorMsg;
|
||||||
use compositing::{ConstellationMsg as FromCompositorMsg, SendableFrameTree};
|
use compositing::{ConstellationMsg as FromCompositorMsg, SendableFrameTree};
|
||||||
|
@ -811,6 +810,8 @@ where
|
||||||
is_running_problem_test: bool,
|
is_running_problem_test: bool,
|
||||||
hard_fail: bool,
|
hard_fail: bool,
|
||||||
enable_canvas_antialiasing: bool,
|
enable_canvas_antialiasing: bool,
|
||||||
|
canvas_chan: Sender<ConstellationCanvasMsg>,
|
||||||
|
ipc_canvas_chan: IpcSender<CanvasMsg>,
|
||||||
) -> (Sender<FromCompositorMsg>, IpcSender<SWManagerMsg>) {
|
) -> (Sender<FromCompositorMsg>, IpcSender<SWManagerMsg>) {
|
||||||
let (compositor_sender, compositor_receiver) = unbounded();
|
let (compositor_sender, compositor_receiver) = unbounded();
|
||||||
|
|
||||||
|
@ -901,8 +902,6 @@ where
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (canvas_chan, ipc_canvas_chan) = CanvasPaintThread::start();
|
|
||||||
|
|
||||||
let mut constellation: Constellation<Message, LTF, STF> = Constellation {
|
let mut constellation: Constellation<Message, LTF, STF> = Constellation {
|
||||||
namespace_receiver,
|
namespace_receiver,
|
||||||
namespace_sender,
|
namespace_sender,
|
||||||
|
|
|
@ -892,6 +892,9 @@ fn create_constellation(
|
||||||
player_context,
|
player_context,
|
||||||
event_loop_waker,
|
event_loop_waker,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let (canvas_chan, ipc_canvas_chan) = canvas::canvas_paint_thread::CanvasPaintThread::start();
|
||||||
|
|
||||||
let (constellation_chan, from_swmanager_sender) = Constellation::<
|
let (constellation_chan, from_swmanager_sender) = Constellation::<
|
||||||
script_layout_interface::message::Msg,
|
script_layout_interface::message::Msg,
|
||||||
layout_thread::LayoutThread,
|
layout_thread::LayoutThread,
|
||||||
|
@ -904,6 +907,8 @@ fn create_constellation(
|
||||||
opts.is_running_problem_test,
|
opts.is_running_problem_test,
|
||||||
opts.hard_fail,
|
opts.hard_fail,
|
||||||
opts.enable_canvas_antialiasing,
|
opts.enable_canvas_antialiasing,
|
||||||
|
canvas_chan,
|
||||||
|
ipc_canvas_chan,
|
||||||
);
|
);
|
||||||
|
|
||||||
if let Some(webvr_constellation_sender) = webvr_constellation_sender {
|
if let Some(webvr_constellation_sender) = webvr_constellation_sender {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue