aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/layout/inline.rs
diff options
context:
space:
mode:
authorGlenn Watson <gw@intuitionlibrary.com>2014-08-08 13:53:37 +1000
committerGlenn Watson <gw@intuitionlibrary.com>2014-08-11 12:10:28 +1000
commit4a0e01b4f033940b5d31ad1a47e322b2769ef1a5 (patch)
tree1e286508e0d54e3aad2e1155d39a252e783b8d77 /src/components/layout/inline.rs
parent4062af69ec562c8a3f781a2918bc4134a809b391 (diff)
downloadservo-4a0e01b4f033940b5d31ad1a47e322b2769ef1a5.tar.gz
servo-4a0e01b4f033940b5d31ad1a47e322b2769ef1a5.zip
Refactor how LayoutContext structure works (reduce TLS lookups + simplify fns used by seq/parallel code paths).
- LayoutContext is renamed to SharedLayoutContext. - SharedLayoutContext is immutable. - LayoutContext is a wrapper around SharedLayoutContext + access to local caches (font, style etc). - Creating a LayoutContext does a single local_data lookup to fetch the cache information. - Android shares same implementation of context.rs as other platforms. - LayoutContext can be used from both green thread (parallel layout) and native thread (sequential layout). - Removes the need for other types (such as FontContext, StyleSharingCandidateCache etc) to be passed around.
Diffstat (limited to 'src/components/layout/inline.rs')
-rw-r--r--src/components/layout/inline.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/components/layout/inline.rs b/src/components/layout/inline.rs
index e3aabadff35..89449ca5571 100644
--- a/src/components/layout/inline.rs
+++ b/src/components/layout/inline.rs
@@ -932,7 +932,7 @@ impl InlineFlow {
// FIXME(#2795): Get the real container size
let container_size = Size2D::zero();
if !abs_rect.to_physical(self.base.writing_mode, container_size)
- .intersects(&layout_context.dirty) {
+ .intersects(&layout_context.shared.dirty) {
return
}
@@ -1090,7 +1090,7 @@ impl Flow for InlineFlow {
self
}
- fn bubble_inline_sizes(&mut self, _: &mut LayoutContext) {
+ fn bubble_inline_sizes(&mut self, _: &LayoutContext) {
let writing_mode = self.base.writing_mode;
for kid in self.base.child_iter() {
flow::mut_base(kid).floats = Floats::new(writing_mode);
@@ -1115,7 +1115,7 @@ impl Flow for InlineFlow {
/// Recursively (top-down) determines the actual inline-size of child contexts and fragments. When called
/// on this context, the context has had its inline-size set by the parent context.
- fn assign_inline_sizes(&mut self, _: &mut LayoutContext) {
+ fn assign_inline_sizes(&mut self, _: &LayoutContext) {
// Initialize content fragment inline-sizes if they haven't been initialized already.
//
// TODO: Combine this with `LineBreaker`'s walk in the fragment list, or put this into `Fragment`.
@@ -1144,7 +1144,7 @@ impl Flow for InlineFlow {
}
/// Calculate and set the block-size of this flow. See CSS 2.1 § 10.6.1.
- fn assign_block_size(&mut self, _: &mut LayoutContext) {
+ fn assign_block_size(&mut self, _: &LayoutContext) {
debug!("assign_block_size_inline: assigning block_size for flow");
// Divide the fragments into lines.