[−][src]Struct layout_thread::LayoutThread
Information needed by the layout thread.
Fields
id: PipelineIdThe ID of the pipeline that we belong to.
top_level_browsing_context_id: TopLevelBrowsingContextIdThe ID of the top-level browsing context that we belong to.
url: ServoUrlThe URL of the pipeline that we belong to.
stylist: StylistPerforms CSS selector matching and style resolution.
is_iframe: boolIs the current reflow of an iframe, as opposed to a root window?
port: Receiver<Msg>The port on which we receive messages from the script thread.
pipeline_port: Receiver<LayoutControlMsg>The port on which we receive messages from the constellation.
font_cache_receiver: Receiver<()>The port on which we receive messages from the font cache thread.
font_cache_sender: IpcSender<()>The channel on which the font cache can send messages to us.
background_hang_monitor: Box<dyn BackgroundHangMonitor>A means of communication with the background hang monitor.
constellation_chan: IpcSender<ConstellationMsg>The channel on which messages can be sent to the constellation.
script_chan: IpcSender<ConstellationControlMsg>The channel on which messages can be sent to the script thread.
time_profiler_chan: ProfilerChanThe channel on which messages can be sent to the time profiler.
mem_profiler_chan: ProfilerChanThe channel on which messages can be sent to the memory profiler.
image_cache: Arc<dyn ImageCache>Reference to the script thread image cache.
font_cache_thread: FontCacheThreadPublic interface to the font cache thread.
first_reflow: Cell<bool>Is this the first reflow in this LayoutThread?
parallel_flag: boolFlag to indicate whether to use parallel operations
generation: Cell<u32>Starts at zero, and increased by one every time a layout completes. This can be used to easily check for invalid stale data.
outstanding_web_fonts: Arc<AtomicUsize>The number of Web fonts that have been requested but not yet loaded.
root_flow: RefCell<Option<FlowRef>>The root of the flow tree.
The document-specific shared lock used for author-origin stylesheets
epoch: Cell<Epoch>A counter for epoch messages
viewport_size: UntypedSize2D<Au>The size of the viewport. This may be different from the size of the screen due to viewport constraints.
rw_data: Arc<Mutex<LayoutThreadData>>A mutex to allow for fast, read-only RPC of layout's internal data structures, while still letting the LayoutThread modify them.
All the other elements of this struct are read-only.
webrender_image_cache: Arc<RwLock<FnvHashMap<(ServoUrl, UsePlaceholder), WebRenderImageInfo>>>registered_painters: RegisteredPaintersImplThe executors for paint worklets.
webrender_api: WebrenderIpcSenderWebrender interface.
paint_time_metrics: PaintTimeMetricsPaint time metrics.
layout_query_waiting_time: HistogramThe time a layout query has waited before serviced by layout thread.
last_iframe_sizes: RefCell<HashMap<BrowsingContextId, Size2D<f32, CSSPixel>>>The sizes of all iframes encountered during the last layout operation.
busy: Arc<AtomicBool>Flag that indicates if LayoutThread is busy handling a request.
load_webfonts_synchronously: boolLoad web fonts synchronously to avoid non-deterministic network-driven reflows.
dump_display_list: boolDumps the display list form after a layout.
dump_display_list_json: boolDumps the display list in JSON form after a layout.
dump_style_tree: boolDumps the DOM after restyle.
dump_rule_tree: boolDumps the flow tree after a layout.
relayout_event: boolEmits notifications when there is a relayout.
nonincremental_layout: boolTrue to turn off incremental layout.
trace_layout: boolTrue if each step of layout is traced to an external JSON file for debugging purposes. Setting this implies sequential layout and paint.
dump_flow_tree: boolDumps the flow tree after a layout.
Implementations
impl LayoutThread[src]
fn new(
id: PipelineId,
top_level_browsing_context_id: TopLevelBrowsingContextId,
url: ServoUrl,
is_iframe: bool,
port: Receiver<Msg>,
pipeline_port: IpcReceiver<LayoutControlMsg>,
background_hang_monitor: Box<dyn BackgroundHangMonitor>,
constellation_chan: IpcSender<ConstellationMsg>,
script_chan: IpcSender<ConstellationControlMsg>,
image_cache: Arc<dyn ImageCache>,
font_cache_thread: FontCacheThread,
time_profiler_chan: ProfilerChan,
mem_profiler_chan: ProfilerChan,
webrender_api: WebrenderIpcSender,
paint_time_metrics: PaintTimeMetrics,
busy: Arc<AtomicBool>,
load_webfonts_synchronously: bool,
window_size: WindowSizeData,
dump_display_list: bool,
dump_display_list_json: bool,
dump_style_tree: bool,
dump_rule_tree: bool,
relayout_event: bool,
nonincremental_layout: bool,
trace_layout: bool,
dump_flow_tree: bool
) -> LayoutThread[src]
id: PipelineId,
top_level_browsing_context_id: TopLevelBrowsingContextId,
url: ServoUrl,
is_iframe: bool,
port: Receiver<Msg>,
pipeline_port: IpcReceiver<LayoutControlMsg>,
background_hang_monitor: Box<dyn BackgroundHangMonitor>,
constellation_chan: IpcSender<ConstellationMsg>,
script_chan: IpcSender<ConstellationControlMsg>,
image_cache: Arc<dyn ImageCache>,
font_cache_thread: FontCacheThread,
time_profiler_chan: ProfilerChan,
mem_profiler_chan: ProfilerChan,
webrender_api: WebrenderIpcSender,
paint_time_metrics: PaintTimeMetrics,
busy: Arc<AtomicBool>,
load_webfonts_synchronously: bool,
window_size: WindowSizeData,
dump_display_list: bool,
dump_display_list_json: bool,
dump_style_tree: bool,
dump_rule_tree: bool,
relayout_event: bool,
nonincremental_layout: bool,
trace_layout: bool,
dump_flow_tree: bool
) -> LayoutThread
Creates a new LayoutThread structure.
fn start(self)[src]
Starts listening on the port.
fn build_layout_context<'a>(
&'a self,
guards: StylesheetGuards<'a>,
snapshot_map: &'a SnapshotMap,
origin: ImmutableOrigin,
animation_timeline_value: f64,
animations: &DocumentAnimationSet,
stylesheets_changed: bool
) -> LayoutContext<'a>[src]
&'a self,
guards: StylesheetGuards<'a>,
snapshot_map: &'a SnapshotMap,
origin: ImmutableOrigin,
animation_timeline_value: f64,
animations: &DocumentAnimationSet,
stylesheets_changed: bool
) -> LayoutContext<'a>
fn notify_activity_to_hang_monitor(&self, request: &Msg)[src]
fn handle_request<'a, 'b>(
&mut self,
possibly_locked_rw_data: &mut RwData<'a, 'b>
) -> bool[src]
&mut self,
possibly_locked_rw_data: &mut RwData<'a, 'b>
) -> bool
Receives and dispatches messages from the script and constellation threads
fn handle_request_helper<'a, 'b>(
&mut self,
request: Msg,
possibly_locked_rw_data: &mut RwData<'a, 'b>
) -> bool[src]
&mut self,
request: Msg,
possibly_locked_rw_data: &mut RwData<'a, 'b>
) -> bool
Receives and dispatches messages from other threads.
fn collect_reports<'a, 'b>(
&self,
reports_chan: ReportsChan,
possibly_locked_rw_data: &mut RwData<'a, 'b>
)[src]
&self,
reports_chan: ReportsChan,
possibly_locked_rw_data: &mut RwData<'a, 'b>
)
fn create_layout_thread(&self, info: LayoutThreadInit)[src]
fn prepare_to_exit(&mut self, response_chan: Sender<()>)[src]
Enters a quiescent state in which no new messages will be processed until an ExitNow is
received. A pong is immediately sent on the given response channel.
fn exit_now(&mut self)[src]
Shuts down the layout thread now. If there are any DOM nodes left, layout will now (safely) crash.
fn handle_add_stylesheet(
&self,
stylesheet: &Stylesheet,
guard: &SharedRwLockReadGuard
)[src]
&self,
stylesheet: &Stylesheet,
guard: &SharedRwLockReadGuard
)
fn handle_set_quirks_mode<'a, 'b>(&mut self, quirks_mode: QuirksMode)[src]
Sets quirks mode for the document, causing the quirks mode stylesheet to be used.
fn try_get_layout_root<'dom>(
&self,
node: impl LayoutNode<'dom>
) -> Option<FlowRef>[src]
&self,
node: impl LayoutNode<'dom>
) -> Option<FlowRef>
fn solve_constraints(layout_root: &mut dyn Flow, layout_context: &LayoutContext)[src]
Performs layout constraint solving.
This corresponds to Reflow() in Gecko and layout() in WebKit/Blink and should be
benchmarked against those two. It is marked #[inline(never)] to aid profiling.
fn solve_constraints_parallel(
traversal: &ThreadPool,
layout_root: &mut dyn Flow,
profiler_metadata: Option<TimerMetadata>,
time_profiler_chan: ProfilerChan,
layout_context: &LayoutContext
)[src]
traversal: &ThreadPool,
layout_root: &mut dyn Flow,
profiler_metadata: Option<TimerMetadata>,
time_profiler_chan: ProfilerChan,
layout_context: &LayoutContext
)
Performs layout constraint solving in parallel.
This corresponds to Reflow() in Gecko and layout() in WebKit/Blink and should be
benchmarked against those two. It is marked #[inline(never)] to aid profiling.
fn compute_abs_pos_and_build_display_list(
&self,
data: &Reflow,
reflow_goal: &ReflowGoal,
document: Option<&ServoLayoutDocument>,
layout_root: &mut dyn Flow,
layout_context: &mut LayoutContext,
rw_data: &mut LayoutThreadData
)[src]
&self,
data: &Reflow,
reflow_goal: &ReflowGoal,
document: Option<&ServoLayoutDocument>,
layout_root: &mut dyn Flow,
layout_context: &mut LayoutContext,
rw_data: &mut LayoutThreadData
)
Computes the stacking-relative positions of all flows and, if the painting is dirty and the reflow type need it, builds the display list.
fn handle_reflow<'a, 'b>(
&mut self,
data: &mut ScriptReflowResult,
possibly_locked_rw_data: &mut RwData<'a, 'b>
)[src]
&mut self,
data: &mut ScriptReflowResult,
possibly_locked_rw_data: &mut RwData<'a, 'b>
)
The high-level routine that performs layout threads.
fn respond_to_query_if_necessary(
&self,
reflow_goal: &ReflowGoal,
rw_data: &mut LayoutThreadData,
context: &mut LayoutContext,
reflow_result: &mut ReflowComplete,
shared_lock: &SharedRwLock
)[src]
&self,
reflow_goal: &ReflowGoal,
rw_data: &mut LayoutThreadData,
context: &mut LayoutContext,
reflow_result: &mut ReflowComplete,
shared_lock: &SharedRwLock
)
fn set_scroll_states<'a, 'b>(
&mut self,
new_scroll_states: Vec<ScrollState>,
possibly_locked_rw_data: &mut RwData<'a, 'b>
)[src]
&mut self,
new_scroll_states: Vec<ScrollState>,
possibly_locked_rw_data: &mut RwData<'a, 'b>
)
fn cancel_animations_for_nodes_not_in_flow_tree(
animations: &mut FxHashMap<AnimationSetKey, ElementAnimationSet>,
root_flow: &mut dyn Flow
)[src]
animations: &mut FxHashMap<AnimationSetKey, ElementAnimationSet>,
root_flow: &mut dyn Flow
)
Cancel animations for any nodes which have been removed from flow tree. TODO(mrobinson): We should look into a way of doing this during flow tree construction. This also doesn't yet handles nodes that have been reparented.
fn perform_post_style_recalc_layout_passes(
&self,
root_flow: &mut FlowRef,
data: &Reflow,
reflow_goal: &ReflowGoal,
document: Option<&ServoLayoutDocument>,
rw_data: &mut LayoutThreadData,
context: &mut LayoutContext
)[src]
&self,
root_flow: &mut FlowRef,
data: &Reflow,
reflow_goal: &ReflowGoal,
document: Option<&ServoLayoutDocument>,
rw_data: &mut LayoutThreadData,
context: &mut LayoutContext
)
fn perform_post_main_layout_passes(
&self,
data: &Reflow,
root_flow: &mut FlowRef,
reflow_goal: &ReflowGoal,
document: Option<&ServoLayoutDocument>,
rw_data: &mut LayoutThreadData,
layout_context: &mut LayoutContext
)[src]
&self,
data: &Reflow,
root_flow: &mut FlowRef,
reflow_goal: &ReflowGoal,
document: Option<&ServoLayoutDocument>,
rw_data: &mut LayoutThreadData,
layout_context: &mut LayoutContext
)
fn reflow_all_nodes(flow: &mut dyn Flow)[src]
fn profiler_metadata(&self) -> Option<TimerMetadata>[src]
Returns profiling information which is passed to the time profiler.
Trait Implementations
impl LayoutThreadFactory for LayoutThread[src]
type Message = Msg
fn create(
id: PipelineId,
top_level_browsing_context_id: TopLevelBrowsingContextId,
url: ServoUrl,
is_iframe: bool,
chan: (Sender<Msg>, Receiver<Msg>),
pipeline_port: IpcReceiver<LayoutControlMsg>,
background_hang_monitor_register: Box<dyn BackgroundHangMonitorRegister>,
constellation_chan: IpcSender<ConstellationMsg>,
script_chan: IpcSender<ConstellationControlMsg>,
image_cache: Arc<dyn ImageCache>,
font_cache_thread: FontCacheThread,
time_profiler_chan: ProfilerChan,
mem_profiler_chan: ProfilerChan,
webrender_api_sender: WebrenderIpcSender,
paint_time_metrics: PaintTimeMetrics,
busy: Arc<AtomicBool>,
load_webfonts_synchronously: bool,
window_size: WindowSizeData,
dump_display_list: bool,
dump_display_list_json: bool,
dump_style_tree: bool,
dump_rule_tree: bool,
relayout_event: bool,
nonincremental_layout: bool,
trace_layout: bool,
dump_flow_tree: bool
)[src]
id: PipelineId,
top_level_browsing_context_id: TopLevelBrowsingContextId,
url: ServoUrl,
is_iframe: bool,
chan: (Sender<Msg>, Receiver<Msg>),
pipeline_port: IpcReceiver<LayoutControlMsg>,
background_hang_monitor_register: Box<dyn BackgroundHangMonitorRegister>,
constellation_chan: IpcSender<ConstellationMsg>,
script_chan: IpcSender<ConstellationControlMsg>,
image_cache: Arc<dyn ImageCache>,
font_cache_thread: FontCacheThread,
time_profiler_chan: ProfilerChan,
mem_profiler_chan: ProfilerChan,
webrender_api_sender: WebrenderIpcSender,
paint_time_metrics: PaintTimeMetrics,
busy: Arc<AtomicBool>,
load_webfonts_synchronously: bool,
window_size: WindowSizeData,
dump_display_list: bool,
dump_display_list_json: bool,
dump_style_tree: bool,
dump_rule_tree: bool,
relayout_event: bool,
nonincremental_layout: bool,
trace_layout: bool,
dump_flow_tree: bool
)
Spawns a new layout thread.
impl ProfilerMetadataFactory for LayoutThread[src]
fn new_metadata(&self) -> Option<TimerMetadata>[src]
Auto Trait Implementations
impl !RefUnwindSafe for LayoutThread
impl !Send for LayoutThread
impl !Sync for LayoutThread
impl Unpin for LayoutThread
impl !UnwindSafe for LayoutThread
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Erased for T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> MaybeBoxed<Box<T>> for T[src]
fn maybe_boxed(self) -> Box<T>[src]
impl<T> MaybeBoxed<T> for T[src]
fn maybe_boxed(self) -> T[src]
impl<T> Same<T> for T[src]
type Output = T
Should always be Self
impl<T> SetParameter for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>, [src]
V: MultiLane<T>,