mirror of
https://github.com/servo/servo.git
synced 2025-07-23 23:33:43 +01:00
Switch Arc<Box<Image>> to Arc<Image> for perf boost.
Image used to be a trait, but no longer is, so boxing it is no longer necessary.
This commit is contained in:
parent
a8b0fb1e79
commit
5b593a3d32
7 changed files with 13 additions and 13 deletions
|
@ -110,7 +110,7 @@ enum ImageState {
|
|||
Prefetching(AfterPrefetch),
|
||||
Prefetched(Vec<u8>),
|
||||
Decoding,
|
||||
Decoded(Arc<Box<Image>>),
|
||||
Decoded(Arc<Image>),
|
||||
Failed
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ impl ImageCache {
|
|||
load_from_memory(&data)
|
||||
});
|
||||
|
||||
let image = image.map(|image| Arc::new(box image));
|
||||
let image = image.map(|image| Arc::new(image));
|
||||
to_cache.send(Msg::StoreImage(url.clone(), image)).unwrap();
|
||||
debug!("image_cache_task: ended image decode for {}", url.serialize());
|
||||
});
|
||||
|
@ -317,7 +317,7 @@ impl ImageCache {
|
|||
}
|
||||
}
|
||||
|
||||
fn store_image(&mut self, url: Url, image: Option<Arc<Box<Image>>>) {
|
||||
fn store_image(&mut self, url: Url, image: Option<Arc<Image>>) {
|
||||
|
||||
match self.get_state(&url) {
|
||||
ImageState::Decoding => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue