mirror of
https://github.com/servo/servo.git
synced 2025-09-27 23:30:08 +01:00
script: Generate only a single frame during "update the rendering" (#38858)
Instead of generating a frame for every display list, which might be one rendered frame per `<iframe>`, generate only a single frame per call to "update the rendering." This should make rendering more efficient when there are `<iframe>`s present and also open up optimizations for non-display list frames. Testing: This could potentially reduce flashing of content during rendering updates, but that is very difficult to test. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
4f68508624
commit
e7a963cca0
6 changed files with 40 additions and 10 deletions
|
@ -111,6 +111,9 @@ pub enum CompositorMsg {
|
|||
/// An [ipc::IpcBytesReceiver] used to send the raw data of the display list.
|
||||
display_list_receiver: ipc::IpcBytesReceiver,
|
||||
},
|
||||
/// Ask the renderer to generate a frame for the current set of display lists that
|
||||
/// have been sent to the renderer.
|
||||
GenerateFrame,
|
||||
/// Create a new image key. The result will be returned via the
|
||||
/// provided channel sender.
|
||||
GenerateImageKey(IpcSender<ImageKey>),
|
||||
|
@ -244,6 +247,13 @@ impl CrossProcessCompositorApi {
|
|||
}
|
||||
}
|
||||
|
||||
/// Ask the Servo renderer to generate a new frame after having new display lists.
|
||||
pub fn generate_frame(&self) {
|
||||
if let Err(error) = self.0.send(CompositorMsg::GenerateFrame) {
|
||||
warn!("Error generating frame: {error}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new image key. Blocks until the key is available.
|
||||
pub fn generate_image_key_blocking(&self) -> Option<ImageKey> {
|
||||
let (sender, receiver) = ipc::channel().unwrap();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue