author | Andreea Pavel <apavel@mozilla.com> |
Mon, 08 Jul 2019 05:11:23 +0300 | |
changeset 544426 | fec2c81434b4daecc226168a761fbd0b8229d8b7 |
parent 544425 | fddbb046b7c1ac4ccf47305241716348270d76dc |
child 544427 | f4081c5e99bf3f47f82f70b09edc7b94cc243841 |
push id | 2131 |
push user | ffxbld-merge |
push date | Mon, 26 Aug 2019 18:30:20 +0000 |
treeherder | mozilla-release@b19ffb3ca153 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1563993 |
milestone | 69.0a1 |
backs out | f1b593ede263787c8710ef5f211195e5c8dda02f |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
gfx/wr/webrender/src/clip.rs | file | annotate | diff | comparison | revisions | |
gfx/wr/webrender/src/prim_store/mod.rs | file | annotate | diff | comparison | revisions |
--- a/gfx/wr/webrender/src/clip.rs +++ b/gfx/wr/webrender/src/clip.rs @@ -292,30 +292,16 @@ impl ClipSpaceConversion { } else { ClipSpaceConversion::Transform( clip_scroll_tree .get_world_transform(clip_spatial_node_index) .into_transform() ) } } - - fn to_flags(&self) -> ClipNodeFlags { - match *self { - ClipSpaceConversion::Local => { - ClipNodeFlags::SAME_SPATIAL_NODE | ClipNodeFlags::SAME_COORD_SYSTEM - } - ClipSpaceConversion::ScaleOffset(..) => { - ClipNodeFlags::SAME_COORD_SYSTEM - } - ClipSpaceConversion::Transform(..) => { - ClipNodeFlags::empty() - } - } - } } // Temporary information that is cached and reused // during building of a clip chain instance. #[derive(MallocSizeOf)] #[cfg_attr(feature = "capture", derive(Serialize))] struct ClipNodeInfo { conversion: ClipSpaceConversion, @@ -331,17 +317,27 @@ impl ClipNodeInfo { clipped_rect: &LayoutRect, gpu_cache: &mut GpuCache, resource_cache: &mut ResourceCache, clip_scroll_tree: &ClipScrollTree, request_resources: bool, ) -> Option<ClipNodeInstance> { // Calculate some flags that are required for the segment // building logic. - let mut flags = self.conversion.to_flags(); + let mut flags = match self.conversion { + ClipSpaceConversion::Local => { + ClipNodeFlags::SAME_SPATIAL_NODE | ClipNodeFlags::SAME_COORD_SYSTEM + } + ClipSpaceConversion::ScaleOffset(..) => { + ClipNodeFlags::SAME_COORD_SYSTEM + } + ClipSpaceConversion::Transform(..) => { + ClipNodeFlags::empty() + } + }; // Some clip shaders support a fast path mode for simple clips. // For now, the fast path is only selected if: // - The clip item content supports fast path // - Both clip and primitive are in the root coordinate system (no need for AA along edges) // TODO(gw): We could also apply fast path when segments are created, since we only write // the mask for a single corner at a time then, so can always consider radii uniform. let clip_spatial_node = &clip_scroll_tree.spatial_nodes[self.spatial_node_index.0 as usize]; @@ -816,25 +812,21 @@ impl ClipStore { pic_to_world_mapper: &SpaceMapper<PicturePixel, WorldPixel>, clip_scroll_tree: &ClipScrollTree, gpu_cache: &mut GpuCache, resource_cache: &mut ResourceCache, device_pixel_scale: DevicePixelScale, world_rect: &WorldRect, clip_data_store: &mut ClipDataStore, request_resources: bool, - is_chased: bool, ) -> Option<ClipChainInstance> { let local_clip_rect = match self.active_local_clip_rect { Some(rect) => rect, None => return None, }; - if is_chased { - println!("\tbuilding clip chain instance with local rect {:?}", local_prim_rect); - } let local_bounding_rect = local_prim_rect.intersection(&local_clip_rect)?; let pic_clip_rect = prim_to_pic_mapper.map(&local_bounding_rect)?; let world_clip_rect = pic_to_world_mapper.map(&pic_clip_rect)?; // Now, we've collected all the clip nodes that *potentially* affect this // primitive region, and reduced the size of the prim region as much as possible. @@ -863,21 +855,16 @@ impl ClipStore { node_info.local_pos, transform, &world_clip_rect, world_rect, ) } }; - if is_chased { - println!("\t\tclip {:?} at {:?} in space {:?}", node.item, node_info.local_pos, node_info.spatial_node_index); - println!("\t\tflags {:?}, resulted in {:?}", node_info.conversion.to_flags(), clip_result); - } - match clip_result { ClipResult::Accept => { // Doesn't affect the primitive at all, so skip adding to list } ClipResult::Reject => { // Completely clips the supplied prim rect return None; } @@ -1333,21 +1320,18 @@ impl ClipItem { } }; let inner_clip_rect = inner_rect.and_then(|ref inner_rect| { project_inner_rect(transform, inner_rect) }); if let Some(inner_clip_rect) = inner_clip_rect { - match prim_world_rect.intersection(world_rect) { - Some(ref rect) if inner_clip_rect.contains_rect(rect) => - return ClipResult::Accept, - Some(_) => (), - None => return ClipResult::Reject, + if inner_clip_rect.contains_rect(prim_world_rect) { + return ClipResult::Accept; } } let outer_clip_rect = match project_rect( transform, &clip_rect, world_rect, ) {
--- a/gfx/wr/webrender/src/prim_store/mod.rs +++ b/gfx/wr/webrender/src/prim_store/mod.rs @@ -2046,17 +2046,16 @@ impl PrimitiveStore { &map_surface_to_world, &frame_context.clip_scroll_tree, frame_state.gpu_cache, frame_state.resource_cache, surface.device_pixel_scale, &world_culling_rect, &mut frame_state.data_stores.clip, true, - prim_instance.is_chased(), ); if let Some(ref mut tile_cache) = frame_state.tile_cache { if !tile_cache.update_prim_dependencies( prim_instance, clip_chain.as_ref(), prim_local_rect, frame_context.clip_scroll_tree, @@ -3835,17 +3834,16 @@ impl PrimitiveInstance { &pic_state.map_pic_to_world, &frame_context.clip_scroll_tree, frame_state.gpu_cache, frame_state.resource_cache, device_pixel_scale, &dirty_world_rect, &mut data_stores.clip, false, - self.is_chased(), ); let clip_mask_kind = segment.update_clip_task( segment_clip_chain.as_ref(), prim_info.clipped_world_rect, root_spatial_node_index, pic_context.surface_index, pic_state,