mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -7,7 +7,6 @@ use std::collections::HashMap;
|
|||
use std::sync::{Arc, Mutex};
|
||||
use std::{mem, thread};
|
||||
|
||||
use embedder_traits::resources::{self, Resource};
|
||||
use imsz::imsz_from_reader;
|
||||
use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
|
||||
use log::{debug, warn};
|
||||
|
@ -415,10 +414,9 @@ pub struct ImageCacheImpl {
|
|||
}
|
||||
|
||||
impl ImageCache for ImageCacheImpl {
|
||||
fn new(compositor_api: CrossProcessCompositorApi) -> ImageCacheImpl {
|
||||
fn new(compositor_api: CrossProcessCompositorApi, rippy_data: Vec<u8>) -> ImageCacheImpl {
|
||||
debug!("New image cache");
|
||||
|
||||
let rippy_data = resources::read_bytes(Resource::RippyPNG);
|
||||
// Uses an estimate of the system cpus to decode images
|
||||
// See https://doc.rust-lang.org/stable/std/thread/fn.available_parallelism.html
|
||||
// If no information can be obtained about the system, uses 4 threads as a default
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue