mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
servoshell: fix lockups while animating (#30322)
* servoshell: fix lockups while animating * move comment to external_present declaration * disable needs_recomposite optimisation for now due to breakage * fix compile error that only happens on ci * fix more compile errors
This commit is contained in:
parent
aad2dccc9c
commit
1bbd0c1e6e
4 changed files with 80 additions and 25 deletions
|
@ -1540,6 +1540,7 @@ impl<Window: WindowMethods + ?Sized> IOCompositor<Window> {
|
|||
rect: Option<Rect<f32, CSSPixel>>,
|
||||
) -> Result<Option<Image>, UnableToComposite> {
|
||||
if self.waiting_on_present {
|
||||
debug!("tried to composite while waiting on present");
|
||||
return Err(UnableToComposite::NotReadyToPaintImage(
|
||||
NotReadyToPaint::WaitingOnConstellation,
|
||||
));
|
||||
|
|
|
@ -62,7 +62,7 @@ use gaol::sandbox::{ChildSandbox, ChildSandboxMethods};
|
|||
use gfx::font_cache_thread::FontCacheThread;
|
||||
pub use gleam::gl;
|
||||
use ipc_channel::ipc::{self, IpcSender};
|
||||
use log::{error, warn, Log, Metadata, Record};
|
||||
use log::{error, trace, warn, Log, Metadata, Record};
|
||||
use media::{GLPlayerThreads, WindowGLContext};
|
||||
pub use msg::constellation_msg::TopLevelBrowsingContextId as BrowserId;
|
||||
use msg::constellation_msg::{PipelineNamespace, PipelineNamespaceId};
|
||||
|
@ -717,6 +717,7 @@ where
|
|||
}
|
||||
let mut need_resize = false;
|
||||
for event in events {
|
||||
trace!("servo <- embedder EmbedderEvent {:?}", event);
|
||||
need_resize |= self.handle_window_event(event);
|
||||
}
|
||||
if self.compositor.shutdown_state != ShutdownState::FinishedShuttingDown {
|
||||
|
@ -764,6 +765,10 @@ where
|
|||
pub fn present(&mut self) {
|
||||
self.compositor.present();
|
||||
}
|
||||
|
||||
pub fn recomposite(&mut self) {
|
||||
self.compositor.composite();
|
||||
}
|
||||
}
|
||||
|
||||
fn create_embedder_channel(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue