зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1517398 - Update webrender to commit 075fd68dfcfa2a2fdc66fefe5520caa408adcfcb (WR PR #3438). r=kats
https://github.com/servo/webrender/pull/3438 Differential Revision: https://phabricator.services.mozilla.com/D15648 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
008b6d8204
Коммит
535e024020
|
@ -1 +1 @@
|
|||
184314dfbb5dbf4a290994753a9712eff1b97e3a
|
||||
075fd68dfcfa2a2fdc66fefe5520caa408adcfcb
|
||||
|
|
|
@ -1415,8 +1415,8 @@ fn add_clip_node_to_current_chain(
|
|||
clip_scroll_tree: &ClipScrollTree,
|
||||
) -> bool {
|
||||
let clip_node = &clip_data_store[node.handle];
|
||||
let clip_spatial_node = &clip_scroll_tree.spatial_nodes[node.spatial_node_index.0];
|
||||
let ref_spatial_node = &clip_scroll_tree.spatial_nodes[spatial_node_index.0];
|
||||
let clip_spatial_node = &clip_scroll_tree.spatial_nodes[node.spatial_node_index.0 as usize];
|
||||
let ref_spatial_node = &clip_scroll_tree.spatial_nodes[spatial_node_index.0 as usize];
|
||||
|
||||
// Determine the most efficient way to convert between coordinate
|
||||
// systems of the primitive and clip node.
|
||||
|
|
|
@ -44,11 +44,18 @@ impl CoordinateSystem {
|
|||
#[derive(Debug, Copy, Clone, Eq, Hash, PartialEq, PartialOrd, Ord)]
|
||||
#[cfg_attr(feature = "capture", derive(Serialize))]
|
||||
#[cfg_attr(feature = "replay", derive(Deserialize))]
|
||||
pub struct SpatialNodeIndex(pub usize);
|
||||
pub struct SpatialNodeIndex(pub u32);
|
||||
|
||||
pub const ROOT_SPATIAL_NODE_INDEX: SpatialNodeIndex = SpatialNodeIndex(0);
|
||||
const TOPMOST_SCROLL_NODE_INDEX: SpatialNodeIndex = SpatialNodeIndex(1);
|
||||
|
||||
impl SpatialNodeIndex {
|
||||
pub fn new(index: usize) -> Self {
|
||||
debug_assert!(index < ::std::u32::MAX as usize);
|
||||
SpatialNodeIndex(index as u32)
|
||||
}
|
||||
}
|
||||
|
||||
impl CoordinateSystemId {
|
||||
pub fn root() -> Self {
|
||||
CoordinateSystemId(0)
|
||||
|
@ -117,8 +124,8 @@ impl ClipScrollTree {
|
|||
from_node_index: SpatialNodeIndex,
|
||||
to_node_index: SpatialNodeIndex,
|
||||
) -> Option<LayoutTransform> {
|
||||
let from_node = &self.spatial_nodes[from_node_index.0];
|
||||
let to_node = &self.spatial_nodes[to_node_index.0];
|
||||
let from_node = &self.spatial_nodes[from_node_index.0 as usize];
|
||||
let to_node = &self.spatial_nodes[to_node_index.0 as usize];
|
||||
|
||||
let (child, parent, inverse) = if from_node_index.0 > to_node_index.0 {
|
||||
(from_node, to_node, false)
|
||||
|
@ -230,7 +237,7 @@ impl ClipScrollTree {
|
|||
None => return self.topmost_scroll_node_index(),
|
||||
};
|
||||
|
||||
let node = &self.spatial_nodes[index.0];
|
||||
let node = &self.spatial_nodes[index.0 as usize];
|
||||
match node.node_type {
|
||||
SpatialNodeType::ScrollFrame(state) if state.sensitive_to_input_events() => index,
|
||||
_ => self.find_nearest_scrolling_ancestor(node.parent)
|
||||
|
@ -246,7 +253,7 @@ impl ClipScrollTree {
|
|||
return false;
|
||||
}
|
||||
let node_index = self.find_nearest_scrolling_ancestor(node_index);
|
||||
self.spatial_nodes[node_index.0].scroll(scroll_location)
|
||||
self.spatial_nodes[node_index.0 as usize].scroll(scroll_location)
|
||||
}
|
||||
|
||||
pub fn update_tree(
|
||||
|
@ -280,7 +287,7 @@ impl ClipScrollTree {
|
|||
self.nodes_to_update.push((root_node_index, state));
|
||||
|
||||
while let Some((node_index, mut state)) = self.nodes_to_update.pop() {
|
||||
let node = match self.spatial_nodes.get_mut(node_index.0) {
|
||||
let node = match self.spatial_nodes.get_mut(node_index.0 as usize) {
|
||||
Some(node) => node,
|
||||
None => continue,
|
||||
};
|
||||
|
@ -375,11 +382,11 @@ impl ClipScrollTree {
|
|||
}
|
||||
|
||||
pub fn add_spatial_node(&mut self, node: SpatialNode) -> SpatialNodeIndex {
|
||||
let index = SpatialNodeIndex(self.spatial_nodes.len());
|
||||
let index = SpatialNodeIndex::new(self.spatial_nodes.len());
|
||||
|
||||
// When the parent node is None this means we are adding the root.
|
||||
if let Some(parent_index) = node.parent {
|
||||
self.spatial_nodes[parent_index.0].add_child(index);
|
||||
self.spatial_nodes[parent_index.0 as usize].add_child(index);
|
||||
}
|
||||
|
||||
self.spatial_nodes.push(node);
|
||||
|
@ -395,7 +402,7 @@ impl ClipScrollTree {
|
|||
index: SpatialNodeIndex,
|
||||
pt: &mut T,
|
||||
) {
|
||||
let node = &self.spatial_nodes[index.0];
|
||||
let node = &self.spatial_nodes[index.0 as usize];
|
||||
match node.node_type {
|
||||
SpatialNodeType::StickyFrame(ref sticky_frame_info) => {
|
||||
pt.new_level(format!("StickyFrame"));
|
||||
|
@ -450,7 +457,7 @@ impl ClipScrollTree {
|
|||
let mut current = spatial_node_index;
|
||||
|
||||
while current != ROOT_SPATIAL_NODE_INDEX {
|
||||
let node = &self.spatial_nodes[current.0];
|
||||
let node = &self.spatial_nodes[current.0 as usize];
|
||||
|
||||
match node.node_type {
|
||||
SpatialNodeType::ReferenceFrame(ref info) => {
|
||||
|
|
|
@ -405,7 +405,7 @@ impl<'a> DisplayListFlattener<'a> {
|
|||
let mut node_index = spatial_node_index;
|
||||
|
||||
while node_index != ROOT_SPATIAL_NODE_INDEX {
|
||||
let node = &self.clip_scroll_tree.spatial_nodes[node_index.0];
|
||||
let node = &self.clip_scroll_tree.spatial_nodes[node_index.0 as usize];
|
||||
match node.node_type {
|
||||
SpatialNodeType::ReferenceFrame(..) |
|
||||
SpatialNodeType::StickyFrame(..) => {
|
||||
|
|
|
@ -474,7 +474,7 @@ impl TransformPalette {
|
|||
clip_scroll_tree: &ClipScrollTree,
|
||||
) -> usize {
|
||||
if to_index == ROOT_SPATIAL_NODE_INDEX {
|
||||
from_index.0
|
||||
from_index.0 as usize
|
||||
} else if from_index == to_index {
|
||||
0
|
||||
} else {
|
||||
|
@ -511,7 +511,7 @@ impl TransformPalette {
|
|||
&self,
|
||||
index: SpatialNodeIndex,
|
||||
) -> LayoutToWorldTransform {
|
||||
self.transforms[index.0]
|
||||
self.transforms[index.0 as usize]
|
||||
.transform
|
||||
.with_destination::<WorldPixel>()
|
||||
}
|
||||
|
@ -520,7 +520,7 @@ impl TransformPalette {
|
|||
&self,
|
||||
index: SpatialNodeIndex,
|
||||
) -> WorldToLayoutTransform {
|
||||
self.transforms[index.0]
|
||||
self.transforms[index.0 as usize]
|
||||
.inv_transform
|
||||
.with_source::<WorldPixel>()
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ impl HitTester {
|
|||
self.clip_chains.clear();
|
||||
|
||||
for (index, node) in clip_scroll_tree.spatial_nodes.iter().enumerate() {
|
||||
let index = SpatialNodeIndex(index);
|
||||
let index = SpatialNodeIndex::new(index);
|
||||
|
||||
// If we haven't already seen a node for this pipeline, record this one as the root
|
||||
// node.
|
||||
|
@ -237,7 +237,7 @@ impl HitTester {
|
|||
|
||||
let node = &self.clip_chains[clip_chain_node_id.0 as usize].region;
|
||||
let transform = self
|
||||
.spatial_nodes[spatial_node_index.0]
|
||||
.spatial_nodes[spatial_node_index.0 as usize]
|
||||
.world_viewport_transform;
|
||||
let transformed_point = match transform
|
||||
.inverse()
|
||||
|
@ -264,7 +264,7 @@ impl HitTester {
|
|||
|
||||
for &HitTestingRun(ref items, ref clip_and_scroll) in self.runs.iter().rev() {
|
||||
let spatial_node_index = clip_and_scroll.spatial_node_index;
|
||||
let scroll_node = &self.spatial_nodes[spatial_node_index.0];
|
||||
let scroll_node = &self.spatial_nodes[spatial_node_index.0 as usize];
|
||||
let transform = scroll_node.world_content_transform;
|
||||
let point_in_layer = match transform
|
||||
.inverse()
|
||||
|
@ -301,7 +301,7 @@ impl HitTester {
|
|||
let mut result = HitTestResult::default();
|
||||
for &HitTestingRun(ref items, ref clip_and_scroll) in self.runs.iter().rev() {
|
||||
let spatial_node_index = clip_and_scroll.spatial_node_index;
|
||||
let scroll_node = &self.spatial_nodes[spatial_node_index.0];
|
||||
let scroll_node = &self.spatial_nodes[spatial_node_index.0 as usize];
|
||||
let pipeline_id = scroll_node.pipeline_id;
|
||||
match (test.pipeline_id, pipeline_id) {
|
||||
(Some(id), node_id) if node_id != id => continue,
|
||||
|
@ -343,7 +343,7 @@ impl HitTester {
|
|||
// the pipeline of the hit item. If we cannot get a transformed point, we are
|
||||
// in a situation with an uninvertible transformation so we should just skip this
|
||||
// result.
|
||||
let root_node = &self.spatial_nodes[self.pipeline_root_nodes[&pipeline_id].0];
|
||||
let root_node = &self.spatial_nodes[self.pipeline_root_nodes[&pipeline_id].0 as usize];
|
||||
let point_in_viewport = match root_node.world_viewport_transform
|
||||
.inverse()
|
||||
.and_then(|inverted| inverted.transform_point2d(&point))
|
||||
|
@ -369,7 +369,7 @@ impl HitTester {
|
|||
}
|
||||
|
||||
pub fn get_pipeline_root(&self, pipeline_id: PipelineId) -> &HitTestSpatialNode {
|
||||
&self.spatial_nodes[self.pipeline_root_nodes[&pipeline_id].0]
|
||||
&self.spatial_nodes[self.pipeline_root_nodes[&pipeline_id].0 as usize]
|
||||
}
|
||||
|
||||
// Reports the CPU heap usage of this HitTester struct.
|
||||
|
|
|
@ -359,7 +359,7 @@ impl TileCache {
|
|||
if let Some(ref mut current) = transform.current {
|
||||
let mapping: CoordinateSpaceMapping<LayoutPixel, PicturePixel> = CoordinateSpaceMapping::new(
|
||||
self.spatial_node_index,
|
||||
SpatialNodeIndex(i),
|
||||
SpatialNodeIndex::new(i),
|
||||
frame_context.clip_scroll_tree,
|
||||
).expect("todo: handle invalid mappings");
|
||||
|
||||
|
@ -1987,7 +1987,7 @@ impl PicturePrimitive {
|
|||
// No point including this cluster if it can't be transformed
|
||||
let spatial_node = &frame_context
|
||||
.clip_scroll_tree
|
||||
.spatial_nodes[cluster.spatial_node_index.0];
|
||||
.spatial_nodes[cluster.spatial_node_index.0 as usize];
|
||||
if !spatial_node.invertible {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -152,8 +152,8 @@ impl<F, T> CoordinateSpaceMapping<F, T> {
|
|||
clip_scroll_tree: &ClipScrollTree,
|
||||
) -> Option<Self> {
|
||||
let spatial_nodes = &clip_scroll_tree.spatial_nodes;
|
||||
let ref_spatial_node = &spatial_nodes[ref_spatial_node_index.0];
|
||||
let target_spatial_node = &spatial_nodes[target_node_index.0];
|
||||
let ref_spatial_node = &spatial_nodes[ref_spatial_node_index.0 as usize];
|
||||
let target_spatial_node = &spatial_nodes[target_node_index.0 as usize];
|
||||
|
||||
if ref_spatial_node_index == target_node_index {
|
||||
Some(CoordinateSpaceMapping::Local)
|
||||
|
@ -2214,7 +2214,7 @@ impl PrimitiveStore {
|
|||
|
||||
let spatial_node = &frame_context
|
||||
.clip_scroll_tree
|
||||
.spatial_nodes[prim_instance.spatial_node_index.0];
|
||||
.spatial_nodes[prim_instance.spatial_node_index.0 as usize];
|
||||
|
||||
// TODO(gw): Although constructing these is cheap, they are often
|
||||
// the same for many consecutive primitives, so it may
|
||||
|
@ -3325,7 +3325,7 @@ fn test_struct_sizes() {
|
|||
// test expectations and move on.
|
||||
// (b) You made a structure larger. This is not necessarily a problem, but should only
|
||||
// be done with care, and after checking if talos performance regresses badly.
|
||||
assert_eq!(mem::size_of::<PrimitiveInstance>(), 120, "PrimitiveInstance size changed");
|
||||
assert_eq!(mem::size_of::<PrimitiveInstance>(), 112, "PrimitiveInstance size changed");
|
||||
assert_eq!(mem::size_of::<PrimitiveInstanceKind>(), 40, "PrimitiveInstanceKind size changed");
|
||||
assert_eq!(mem::size_of::<PrimitiveTemplate>(), 56, "PrimitiveTemplate size changed");
|
||||
assert_eq!(mem::size_of::<PrimitiveTemplateKind>(), 20, "PrimitiveTemplateKind size changed");
|
||||
|
|
|
@ -288,8 +288,8 @@ impl SurfaceDescriptor {
|
|||
// coordinate system (which is the common case!) then we are effectively drawing
|
||||
// in a local space anyway, so don't care about that transform for the purposes
|
||||
// of validating the surface cache contents.
|
||||
let raster_spatial_node = &clip_scroll_tree.spatial_nodes[raster_spatial_node_index.0];
|
||||
let surface_spatial_node = &clip_scroll_tree.spatial_nodes[surface_spatial_node_index.0];
|
||||
let raster_spatial_node = &clip_scroll_tree.spatial_nodes[raster_spatial_node_index.0 as usize];
|
||||
let surface_spatial_node = &clip_scroll_tree.spatial_nodes[surface_spatial_node_index.0 as usize];
|
||||
|
||||
let mut key = CoordinateSpaceMapping::<LayoutPixel, PicturePixel>::new(
|
||||
raster_spatial_node_index,
|
||||
|
|
Загрузка…
Ссылка в новой задаче