mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
net: Raed RippyPNG resource once at startup. (#34954)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
716fa9387d
commit
2115b6a6db
4 changed files with 18 additions and 4 deletions
|
@ -115,6 +115,7 @@ use devtools_traits::{
|
|||
ChromeToDevtoolsControlMsg, DevtoolsControlMsg, DevtoolsPageInfo, NavigationState,
|
||||
ScriptToDevtoolsControlMsg,
|
||||
};
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use embedder_traits::{
|
||||
Cursor, EmbedderMsg, EmbedderProxy, MediaSessionEvent, MediaSessionPlaybackState,
|
||||
};
|
||||
|
@ -479,6 +480,11 @@ pub struct Constellation<STF, SWF> {
|
|||
|
||||
/// User agent string to report in network requests.
|
||||
user_agent: Cow<'static, str>,
|
||||
|
||||
/// The image bytes associated with the RippyPNG embedder resource.
|
||||
/// Read during startup and provided to image caches that are created
|
||||
/// on an as-needed basis, rather than retrieving it every time.
|
||||
rippy_data: Vec<u8>,
|
||||
}
|
||||
|
||||
/// State needed to construct a constellation.
|
||||
|
@ -693,6 +699,8 @@ where
|
|||
wgpu_image_map: state.wgpu_image_map,
|
||||
};
|
||||
|
||||
let rippy_data = resources::read_bytes(Resource::RippyPNG);
|
||||
|
||||
let mut constellation: Constellation<STF, SWF> = Constellation {
|
||||
namespace_receiver,
|
||||
namespace_ipc_sender,
|
||||
|
@ -759,6 +767,7 @@ where
|
|||
player_context: state.player_context,
|
||||
active_media_session: None,
|
||||
user_agent: state.user_agent,
|
||||
rippy_data,
|
||||
};
|
||||
|
||||
constellation.run();
|
||||
|
@ -1007,6 +1016,7 @@ where
|
|||
webxr_registry: self.webxr_registry.clone(),
|
||||
player_context: self.player_context.clone(),
|
||||
user_agent: self.user_agent.clone(),
|
||||
rippy_data: self.rippy_data.clone(),
|
||||
});
|
||||
|
||||
let pipeline = match result {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue