mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove unecessary webrender document from layout.
This commit is contained in:
parent
75efaa95f5
commit
abc689e034
7 changed files with 20 additions and 67 deletions
|
@ -587,10 +587,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
/// instance in the parent process.
|
||||
fn handle_webrender_message(&mut self, msg: WebrenderMsg) {
|
||||
match msg {
|
||||
WebrenderMsg::Layout(script_traits::WebrenderMsg::SendInitialTransaction(
|
||||
_doc,
|
||||
pipeline,
|
||||
)) => {
|
||||
WebrenderMsg::Layout(script_traits::WebrenderMsg::SendInitialTransaction(pipeline)) => {
|
||||
self.waiting_on_pending_frame = true;
|
||||
let mut txn = webrender_api::Transaction::new();
|
||||
txn.set_display_list(
|
||||
|
@ -605,7 +602,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
},
|
||||
|
||||
WebrenderMsg::Layout(script_traits::WebrenderMsg::SendScrollNode(
|
||||
_doc,
|
||||
point,
|
||||
scroll_id,
|
||||
clamping,
|
||||
|
@ -617,7 +613,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
},
|
||||
|
||||
WebrenderMsg::Layout(script_traits::WebrenderMsg::SendDisplayList(
|
||||
_doc,
|
||||
epoch,
|
||||
size,
|
||||
pipeline,
|
||||
|
@ -644,7 +639,6 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
},
|
||||
|
||||
WebrenderMsg::Layout(script_traits::WebrenderMsg::HitTest(
|
||||
_doc,
|
||||
pipeline,
|
||||
point,
|
||||
flags,
|
||||
|
@ -684,6 +678,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
self.webrender_api
|
||||
.send_transaction(self.webrender_document, txn);
|
||||
},
|
||||
|
||||
WebrenderMsg::Font(WebrenderFontMsg::AddFontInstance(font_key, size, sender)) => {
|
||||
let key = self.webrender_api.generate_font_instance_key();
|
||||
let mut txn = webrender_api::Transaction::new();
|
||||
|
@ -692,6 +687,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
.send_transaction(self.webrender_document, txn);
|
||||
let _ = sender.send(key);
|
||||
},
|
||||
|
||||
WebrenderMsg::Font(WebrenderFontMsg::AddFont(data, sender)) => {
|
||||
let font_key = self.webrender_api.generate_font_key();
|
||||
let mut txn = webrender_api::Transaction::new();
|
||||
|
@ -703,9 +699,11 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
.send_transaction(self.webrender_document, txn);
|
||||
let _ = sender.send(font_key);
|
||||
},
|
||||
|
||||
WebrenderMsg::Canvas(WebrenderCanvasMsg::GenerateKey(sender)) => {
|
||||
let _ = sender.send(self.webrender_api.generate_image_key());
|
||||
},
|
||||
|
||||
WebrenderMsg::Canvas(WebrenderCanvasMsg::UpdateImages(updates)) => {
|
||||
let mut txn = webrender_api::Transaction::new();
|
||||
for update in updates {
|
||||
|
|
|
@ -606,7 +606,6 @@ impl UnprivilegedPipelineContent {
|
|||
self.time_profiler_chan,
|
||||
self.mem_profiler_chan,
|
||||
self.webrender_api_sender,
|
||||
self.webrender_document,
|
||||
paint_time_metrics,
|
||||
layout_thread_busy_flag.clone(),
|
||||
self.opts.load_webfonts_synchronously,
|
||||
|
|
|
@ -212,9 +212,6 @@ pub struct LayoutThread {
|
|||
/// Webrender interface.
|
||||
webrender_api: WebrenderIpcSender,
|
||||
|
||||
/// Webrender document.
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
|
||||
/// Paint time metrics.
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
|
||||
|
@ -276,7 +273,6 @@ impl LayoutThreadFactory for LayoutThread {
|
|||
time_profiler_chan: profile_time::ProfilerChan,
|
||||
mem_profiler_chan: profile_mem::ProfilerChan,
|
||||
webrender_api_sender: WebrenderIpcSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
busy: Arc<AtomicBool>,
|
||||
load_webfonts_synchronously: bool,
|
||||
|
@ -325,7 +321,6 @@ impl LayoutThreadFactory for LayoutThread {
|
|||
time_profiler_chan,
|
||||
mem_profiler_chan.clone(),
|
||||
webrender_api_sender,
|
||||
webrender_document,
|
||||
paint_time_metrics,
|
||||
busy,
|
||||
load_webfonts_synchronously,
|
||||
|
@ -495,7 +490,6 @@ impl LayoutThread {
|
|||
time_profiler_chan: profile_time::ProfilerChan,
|
||||
mem_profiler_chan: profile_mem::ProfilerChan,
|
||||
webrender_api: WebrenderIpcSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
busy: Arc<AtomicBool>,
|
||||
load_webfonts_synchronously: bool,
|
||||
|
@ -510,7 +504,7 @@ impl LayoutThread {
|
|||
dump_flow_tree: bool,
|
||||
) -> LayoutThread {
|
||||
// Let webrender know about this pipeline by sending an empty display list.
|
||||
webrender_api.send_initial_transaction(webrender_document, id.to_webrender());
|
||||
webrender_api.send_initial_transaction(id.to_webrender());
|
||||
|
||||
let device = Device::new(
|
||||
MediaType::screen(),
|
||||
|
@ -553,7 +547,6 @@ impl LayoutThread {
|
|||
epoch: Cell::new(Epoch(1)),
|
||||
viewport_size: Size2D::new(Au(0), Au(0)),
|
||||
webrender_api,
|
||||
webrender_document,
|
||||
stylist: Stylist::new(device, QuirksMode::NoQuirks),
|
||||
rw_data: Arc::new(Mutex::new(LayoutThreadData {
|
||||
constellation_chan: constellation_chan,
|
||||
|
@ -773,7 +766,6 @@ impl LayoutThread {
|
|||
|
||||
let point = Point2D::new(-state.scroll_offset.x, -state.scroll_offset.y);
|
||||
self.webrender_api.send_scroll_node(
|
||||
self.webrender_document,
|
||||
webrender_api::units::LayoutPoint::from_untyped(point),
|
||||
state.scroll_id,
|
||||
webrender_api::ScrollClamping::ToContentBounds,
|
||||
|
@ -882,7 +874,6 @@ impl LayoutThread {
|
|||
self.time_profiler_chan.clone(),
|
||||
self.mem_profiler_chan.clone(),
|
||||
self.webrender_api.clone(),
|
||||
self.webrender_document,
|
||||
info.paint_time_metrics,
|
||||
info.layout_is_busy,
|
||||
self.load_webfonts_synchronously,
|
||||
|
@ -1171,12 +1162,8 @@ impl LayoutThread {
|
|||
self.paint_time_metrics
|
||||
.maybe_observe_paint_time(self, epoch, is_contentful.0);
|
||||
|
||||
self.webrender_api.send_display_list(
|
||||
self.webrender_document,
|
||||
epoch,
|
||||
viewport_size,
|
||||
builder.finalize(),
|
||||
);
|
||||
self.webrender_api
|
||||
.send_display_list(epoch, viewport_size, builder.finalize());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -1578,7 +1565,6 @@ impl LayoutThread {
|
|||
|
||||
let client_point = webrender_api::units::WorldPoint::from_untyped(client_point);
|
||||
let results = self.webrender_api.hit_test(
|
||||
self.webrender_document,
|
||||
Some(self.id.to_webrender()),
|
||||
client_point,
|
||||
flags,
|
||||
|
|
|
@ -191,9 +191,6 @@ pub struct LayoutThread {
|
|||
/// Webrender interface.
|
||||
webrender_api: WebrenderIpcSender,
|
||||
|
||||
/// Webrender document.
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
|
||||
/// Paint time metrics.
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
|
||||
|
@ -245,7 +242,6 @@ impl LayoutThreadFactory for LayoutThread {
|
|||
time_profiler_chan: profile_time::ProfilerChan,
|
||||
mem_profiler_chan: profile_mem::ProfilerChan,
|
||||
webrender_api_sender: WebrenderIpcSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
busy: Arc<AtomicBool>,
|
||||
load_webfonts_synchronously: bool,
|
||||
|
@ -294,7 +290,6 @@ impl LayoutThreadFactory for LayoutThread {
|
|||
time_profiler_chan,
|
||||
mem_profiler_chan.clone(),
|
||||
webrender_api_sender,
|
||||
webrender_document,
|
||||
paint_time_metrics,
|
||||
busy,
|
||||
load_webfonts_synchronously,
|
||||
|
@ -463,7 +458,6 @@ impl LayoutThread {
|
|||
time_profiler_chan: profile_time::ProfilerChan,
|
||||
mem_profiler_chan: profile_mem::ProfilerChan,
|
||||
webrender_api_sender: WebrenderIpcSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
busy: Arc<AtomicBool>,
|
||||
load_webfonts_synchronously: bool,
|
||||
|
@ -477,7 +471,7 @@ impl LayoutThread {
|
|||
trace_layout: bool,
|
||||
) -> LayoutThread {
|
||||
// Let webrender know about this pipeline by sending an empty display list.
|
||||
webrender_api_sender.send_initial_transaction(webrender_document, id.to_webrender());
|
||||
webrender_api_sender.send_initial_transaction(id.to_webrender());
|
||||
|
||||
// The device pixel ratio is incorrect (it does not have the hidpi value),
|
||||
// but it will be set correctly when the initial reflow takes place.
|
||||
|
@ -521,7 +515,6 @@ impl LayoutThread {
|
|||
epoch: Cell::new(Epoch(1)),
|
||||
viewport_size: Size2D::new(Au(0), Au(0)),
|
||||
webrender_api: webrender_api_sender,
|
||||
webrender_document,
|
||||
stylist: Stylist::new(device, QuirksMode::NoQuirks),
|
||||
rw_data: Arc::new(Mutex::new(LayoutThreadData {
|
||||
constellation_chan: constellation_chan,
|
||||
|
@ -737,7 +730,6 @@ impl LayoutThread {
|
|||
|
||||
let point = Point2D::new(-state.scroll_offset.x, -state.scroll_offset.y);
|
||||
self.webrender_api.send_scroll_node(
|
||||
self.webrender_document,
|
||||
webrender_api::units::LayoutPoint::from_untyped(point),
|
||||
state.scroll_id,
|
||||
webrender_api::ScrollClamping::ToContentBounds,
|
||||
|
@ -823,7 +815,6 @@ impl LayoutThread {
|
|||
self.time_profiler_chan.clone(),
|
||||
self.mem_profiler_chan.clone(),
|
||||
self.webrender_api.clone(),
|
||||
self.webrender_document,
|
||||
info.paint_time_metrics,
|
||||
info.layout_is_busy,
|
||||
self.load_webfonts_synchronously,
|
||||
|
@ -1231,7 +1222,6 @@ impl LayoutThread {
|
|||
|
||||
let client_point = webrender_api::units::WorldPoint::from_untyped(client_point);
|
||||
let results = self.webrender_api.hit_test(
|
||||
self.webrender_document,
|
||||
Some(self.id.to_webrender()),
|
||||
client_point,
|
||||
flags,
|
||||
|
@ -1349,12 +1339,8 @@ impl LayoutThread {
|
|||
self.viewport_size.width.to_f32_px(),
|
||||
self.viewport_size.height.to_f32_px(),
|
||||
));
|
||||
self.webrender_api.send_display_list(
|
||||
self.webrender_document,
|
||||
epoch,
|
||||
viewport_size,
|
||||
display_list.wr.finalize(),
|
||||
);
|
||||
self.webrender_api
|
||||
.send_display_list(epoch, viewport_size, display_list.wr.finalize());
|
||||
|
||||
if self.trace_layout {
|
||||
layout_debug::end_trace(self.generation.get());
|
||||
|
|
|
@ -44,7 +44,6 @@ pub trait LayoutThreadFactory {
|
|||
time_profiler_chan: time::ProfilerChan,
|
||||
mem_profiler_chan: mem::ProfilerChan,
|
||||
webrender_api_sender: WebrenderIpcSender,
|
||||
webrender_document: webrender_api::DocumentId,
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
busy: Arc<AtomicBool>,
|
||||
load_webfonts_synchronously: bool,
|
||||
|
|
|
@ -1100,12 +1100,11 @@ impl From<i32> for MediaSessionActionType {
|
|||
#[derive(Deserialize, Serialize)]
|
||||
pub enum WebrenderMsg {
|
||||
/// Inform WebRender of the existence of this pipeline.
|
||||
SendInitialTransaction(DocumentId, webrender_api::PipelineId),
|
||||
SendInitialTransaction(webrender_api::PipelineId),
|
||||
/// Perform a scroll operation.
|
||||
SendScrollNode(DocumentId, LayoutPoint, ExternalScrollId, ScrollClamping),
|
||||
SendScrollNode(LayoutPoint, ExternalScrollId, ScrollClamping),
|
||||
/// Inform WebRender of a new display list for the given pipeline.
|
||||
SendDisplayList(
|
||||
DocumentId,
|
||||
webrender_api::Epoch,
|
||||
LayoutSize,
|
||||
webrender_api::PipelineId,
|
||||
|
@ -1116,7 +1115,6 @@ pub enum WebrenderMsg {
|
|||
/// Perform a hit test operation. The result will be returned via
|
||||
/// the provided channel sender.
|
||||
HitTest(
|
||||
DocumentId,
|
||||
Option<webrender_api::PipelineId>,
|
||||
WorldPoint,
|
||||
HitTestFlags,
|
||||
|
@ -1140,15 +1138,8 @@ impl WebrenderIpcSender {
|
|||
}
|
||||
|
||||
/// Inform WebRender of the existence of this pipeline.
|
||||
pub fn send_initial_transaction(
|
||||
&self,
|
||||
document: DocumentId,
|
||||
pipeline: webrender_api::PipelineId,
|
||||
) {
|
||||
if let Err(e) = self
|
||||
.0
|
||||
.send(WebrenderMsg::SendInitialTransaction(document, pipeline))
|
||||
{
|
||||
pub fn send_initial_transaction(&self, pipeline: webrender_api::PipelineId) {
|
||||
if let Err(e) = self.0.send(WebrenderMsg::SendInitialTransaction(pipeline)) {
|
||||
warn!("Error sending initial transaction: {}", e);
|
||||
}
|
||||
}
|
||||
|
@ -1156,14 +1147,14 @@ impl WebrenderIpcSender {
|
|||
/// Perform a scroll operation.
|
||||
pub fn send_scroll_node(
|
||||
&self,
|
||||
document: DocumentId,
|
||||
point: LayoutPoint,
|
||||
scroll_id: ExternalScrollId,
|
||||
clamping: ScrollClamping,
|
||||
) {
|
||||
if let Err(e) = self.0.send(WebrenderMsg::SendScrollNode(
|
||||
document, point, scroll_id, clamping,
|
||||
)) {
|
||||
if let Err(e) = self
|
||||
.0
|
||||
.send(WebrenderMsg::SendScrollNode(point, scroll_id, clamping))
|
||||
{
|
||||
warn!("Error sending scroll node: {}", e);
|
||||
}
|
||||
}
|
||||
|
@ -1171,14 +1162,12 @@ impl WebrenderIpcSender {
|
|||
/// Inform WebRender of a new display list for the given pipeline.
|
||||
pub fn send_display_list(
|
||||
&self,
|
||||
document: DocumentId,
|
||||
epoch: Epoch,
|
||||
size: LayoutSize,
|
||||
(pipeline, size2, list): (webrender_api::PipelineId, LayoutSize, BuiltDisplayList),
|
||||
) {
|
||||
let (data, descriptor) = list.into_data();
|
||||
if let Err(e) = self.0.send(WebrenderMsg::SendDisplayList(
|
||||
document,
|
||||
webrender_api::Epoch(epoch.0),
|
||||
size,
|
||||
pipeline,
|
||||
|
@ -1194,16 +1183,13 @@ impl WebrenderIpcSender {
|
|||
/// and a result is available.
|
||||
pub fn hit_test(
|
||||
&self,
|
||||
document: DocumentId,
|
||||
pipeline: Option<webrender_api::PipelineId>,
|
||||
point: WorldPoint,
|
||||
flags: HitTestFlags,
|
||||
) -> HitTestResult {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
self.0
|
||||
.send(WebrenderMsg::HitTest(
|
||||
document, pipeline, point, flags, sender,
|
||||
))
|
||||
.send(WebrenderMsg::HitTest(pipeline, point, flags, sender))
|
||||
.expect("error sending hit test");
|
||||
receiver.recv().expect("error receiving hit test result")
|
||||
}
|
||||
|
|
|
@ -37,7 +37,6 @@ packages = [
|
|||
"wayland-sys",
|
||||
"parking_lot",
|
||||
"parking_lot_core",
|
||||
"ron",
|
||||
|
||||
# https://github.com/servo/servo/pull/23288#issuecomment-494687746
|
||||
"gl_generator",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue