mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Dirty canvas when exiting immersive sessions
This commit is contained in:
parent
37023b24f2
commit
d146303f1d
2 changed files with 17 additions and 1 deletions
|
@ -503,7 +503,7 @@ impl WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mark_as_dirty(&self) {
|
pub fn mark_as_dirty(&self) {
|
||||||
// If we have a bound framebuffer, then don't mark the canvas as dirty.
|
// If we have a bound framebuffer, then don't mark the canvas as dirty.
|
||||||
if self.bound_draw_framebuffer.get().is_some() {
|
if self.bound_draw_framebuffer.get().is_some() {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,8 +3,13 @@
|
||||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
|
use crate::dom::bindings::codegen::Bindings::XRRenderStateBinding::XRRenderStateMethods;
|
||||||
|
use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XRSessionMethods;
|
||||||
use crate::dom::bindings::codegen::Bindings::XRSystemBinding::XRSessionInit;
|
use crate::dom::bindings::codegen::Bindings::XRSystemBinding::XRSessionInit;
|
||||||
use crate::dom::bindings::codegen::Bindings::XRSystemBinding::{XRSessionMode, XRSystemMethods};
|
use crate::dom::bindings::codegen::Bindings::XRSystemBinding::{XRSessionMode, XRSystemMethods};
|
||||||
|
use crate::dom::bindings::codegen::Bindings::XRWebGLLayerBinding::{
|
||||||
|
XRWebGLLayerMethods, XRWebGLRenderingContext,
|
||||||
|
};
|
||||||
use crate::dom::bindings::conversions::{ConversionResult, FromJSValConvertible};
|
use crate::dom::bindings::conversions::{ConversionResult, FromJSValConvertible};
|
||||||
use crate::dom::bindings::error::Error;
|
use crate::dom::bindings::error::Error;
|
||||||
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||||
|
@ -81,6 +86,17 @@ impl XRSystem {
|
||||||
if let Some(active) = self.active_immersive_session.get() {
|
if let Some(active) = self.active_immersive_session.get() {
|
||||||
if Dom::from_ref(&*active) == Dom::from_ref(session) {
|
if Dom::from_ref(&*active) == Dom::from_ref(session) {
|
||||||
self.active_immersive_session.set(None);
|
self.active_immersive_session.set(None);
|
||||||
|
|
||||||
|
// Dirty the canvas, since it has been skipping this step whilst in immersive
|
||||||
|
// mode
|
||||||
|
if let Some(layer) = session.RenderState().GetBaseLayer() {
|
||||||
|
match layer.Context() {
|
||||||
|
XRWebGLRenderingContext::WebGLRenderingContext(c) => c.mark_as_dirty(),
|
||||||
|
XRWebGLRenderingContext::WebGL2RenderingContext(c) => {
|
||||||
|
c.base_context().mark_as_dirty()
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.active_inline_sessions
|
self.active_inline_sessions
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue