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

Inactive pages in session history with webgl content keep running #22977

Closed
jdm opened this issue Mar 6, 2019 · 2 comments
Closed

Inactive pages in session history with webgl content keep running #22977

jdm opened this issue Mar 6, 2019 · 2 comments

Comments

@jdm
Copy link
Member

@jdm jdm commented Mar 6, 2019

For example, if you visit https://threejs.org/examples/, choose a demo, watch it for a bit, then go backwards in history, the console output shows that the page is still executing. At minimum we should not be sending triggering rAF callbacks on pages that are not displaying to the user; possibly we should take even more drastic steps in order to conserve resources (such as automatically discarding any page with a webgl canvas when it becomes inactive).

@jdm
Copy link
Member Author

@jdm jdm commented Mar 6, 2019

This can make the ML demos look worse if you look at several in a row.

@jdm
Copy link
Member Author

@jdm jdm commented Mar 6, 2019

The compositor already checks for whether a pipeline is visible or not, so we just need to make #22986 more sensible to get this for free.

bors-servo added a commit that referenced this issue Mar 8, 2019
Make webgl behave better with session history

This prevents the compositor from animating pages that are not actually visible, so pages using webgl do not needlessly impact the performance of the rest of the browser. Additionally, this fixes a problem that was alluded to in [this code](https://github.com/servo/rust-offscreen-rendering-context/blob/b5228c098b889a9806a5f93582903e192b3939ef/src/draw_buffer.rs#L282-L285), causing Servo to delete arbitrary resources when a GC occurred in content that used three.js.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22987 and fix #22977 and fix #20934 and fix #20953 and fix #20930 and fix #20950 and fix #20924
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23000)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Mar 8, 2019
Make webgl behave better with session history

This prevents the compositor from animating pages that are not actually visible, so pages using webgl do not needlessly impact the performance of the rest of the browser. Additionally, this fixes a problem that was alluded to in [this code](https://github.com/servo/rust-offscreen-rendering-context/blob/b5228c098b889a9806a5f93582903e192b3939ef/src/draw_buffer.rs#L282-L285), causing Servo to delete arbitrary resources when a GC occurred in content that used three.js.

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #22987 and fix #22977 and fix #20934 and fix #20953 and fix #20930 and fix #20950 and fix #20924
- [x] There are tests for these changes

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23000)
<!-- Reviewable:end -->
@atouchet atouchet added this to Done in Magic Leap Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Magic Leap
  
Done
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.