mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Auto merge of #23000 - jdm:invisible-webgl, r=nox
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](b5228c098b/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 -->
This commit is contained in:
commit
34a5a824b8
6 changed files with 145 additions and 0 deletions
|
@ -380,6 +380,10 @@ impl<VR: WebVRRenderHandler + 'static> WebGLThread<VR> {
|
|||
self.webrender_api.update_resources(txn.resource_updates)
|
||||
}
|
||||
|
||||
// We need to make the context current so its resources can be disposed of.
|
||||
let _ =
|
||||
Self::make_current_if_needed(context_id, &self.contexts, &mut self.bound_context_id);
|
||||
|
||||
// Release GL context.
|
||||
self.contexts.remove(&context_id);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue