Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter out clip items in local space #1436

Closed
kvark opened this issue Jun 29, 2017 · 3 comments
Closed

Filter out clip items in local space #1436

kvark opened this issue Jun 29, 2017 · 3 comments
Assignees

Comments

@kvark
Copy link
Member

@kvark kvark commented Jun 29, 2017

Current implementation does smart filtering in screen space, but we can do even better if we take the local inner clips of items that we know to be in the same reference frame:

/// Filter out all the clip instances that don't contribute to the result
        let mut inner_rect = Some(task_rect);
        let clips: Vec<_> = raw_clips.iter()
                                     .chain(extra_clip.iter())
                                     .filter(|&&(_, ref clip_info)| {
            match clip_info.bounds.inner {
                Some(ref inner) if !inner.device_rect.is_empty() => {
                    inner_rect = inner_rect.and_then(|r| r.intersection(&inner.device_rect));
                    !inner.device_rect.contains_rect(&task_rect)
                }
                _ => {
                    inner_rect = None;
                    true
                }
            }
        }).cloned().collect();
@glennw
Copy link
Member

@glennw glennw commented Dec 1, 2017

@kvark @mrobinson Is this still relevant (I think it is)?

@mrobinson
Copy link
Member

@mrobinson mrobinson commented Dec 2, 2017

I think as part of handling multiple ClipChains (#1964) we are going to need to do something like this in order to avoid masking in every situation. So maybe we should just close this bug in favor of that one.

@glennw
Copy link
Member

@glennw glennw commented Jan 24, 2018

I believe this is handled now (based on the comment above). Please re-open if work remains here.

@glennw glennw closed this Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.