aboutsummaryrefslogtreecommitdiffstats
path: root/ports/servoshell/egl/servo_glue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ports/servoshell/egl/servo_glue.rs')
-rw-r--r--ports/servoshell/egl/servo_glue.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/ports/servoshell/egl/servo_glue.rs b/ports/servoshell/egl/servo_glue.rs
index ca1397f6747..7986388b35b 100644
--- a/ports/servoshell/egl/servo_glue.rs
+++ b/ports/servoshell/egl/servo_glue.rs
@@ -405,7 +405,9 @@ impl ServoGlue {
}
pub fn pause_compositor(&mut self) {
- self.active_webview().invalidate_native_surface();
+ if let Err(e) = self.rendering_context.unbind_native_surface_from_context() {
+ warn!("Unbinding native surface from context failed ({:?})", e);
+ }
self.maybe_perform_updates();
}
@@ -413,8 +415,17 @@ impl ServoGlue {
if native_surface.is_null() {
panic!("null passed for native_surface");
}
- self.active_webview()
- .replace_native_surface(native_surface, coords.framebuffer);
+ let connection = self.rendering_context.connection();
+ let native_widget = unsafe {
+ connection
+ .create_native_widget_from_ptr(native_surface, coords.framebuffer.to_untyped())
+ };
+ if let Err(e) = self
+ .rendering_context
+ .bind_native_surface_to_context(native_widget)
+ {
+ warn!("Binding native surface to context failed ({:?})", e);
+ }
self.maybe_perform_updates()
}