Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 5 additions & 20 deletions webrender/src/clip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,17 +472,11 @@ impl ClipStore {
if let Some(clip_rect) = clip_node.item.get_local_clip_rect() {
match conversion {
ClipSpaceConversion::Local => {
local_clip_rect = match local_clip_rect.intersection(&clip_rect) {
Some(local_clip_rect) => local_clip_rect,
None => return None,
};
local_clip_rect = local_clip_rect.intersection(&clip_rect)?;
}
ClipSpaceConversion::Offset(ref offset) => {
let clip_rect = clip_rect.translate(offset);
local_clip_rect = match local_clip_rect.intersection(&clip_rect) {
Some(local_clip_rect) => local_clip_rect,
None => return None,
};
local_clip_rect = local_clip_rect.intersection(&clip_rect)?;
}
ClipSpaceConversion::Transform(..) => {
// TODO(gw): In the future, we can reduce the size
Expand All @@ -508,20 +502,11 @@ impl ClipStore {
current_clip_chain_id = clip_chain_node.parent_clip_chain_id;
}

let local_bounding_rect = match local_prim_rect.intersection(&local_clip_rect) {
Some(rect) => rect,
None => return None,
};
let local_bounding_rect = local_prim_rect.intersection(&local_clip_rect)?;

let pic_clip_rect = match prim_to_pic_mapper.map(&local_bounding_rect) {
Some(pic_bounding_rect) => pic_bounding_rect,
None => return None,
};
let pic_clip_rect = prim_to_pic_mapper.map(&local_bounding_rect)?;

let world_clip_rect = match pic_to_world_mapper.map(&pic_clip_rect) {
Some(world_clip_rect) => world_clip_rect,
None => return None,
};
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.
Expand Down