-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
134 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use std::ops::{ | ||
Deref, | ||
DerefMut, | ||
}; | ||
|
||
use freya_engine::prelude::Image; | ||
use rustc_hash::FxHashMap; | ||
|
||
#[derive(Default, PartialEq, Eq, Hash, Clone, Debug)] | ||
pub struct ImageCacheKey(pub String); | ||
|
||
#[derive(Default)] | ||
pub struct ImagesCache { | ||
cache: FxHashMap<ImageCacheKey, Image>, | ||
} | ||
|
||
impl Deref for ImagesCache { | ||
type Target = FxHashMap<ImageCacheKey, Image>; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
&self.cache | ||
} | ||
} | ||
|
||
impl DerefMut for ImagesCache { | ||
fn deref_mut(&mut self) -> &mut Self::Target { | ||
&mut self.cache | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
mod accessibility; | ||
mod compositor_dirty_nodes; | ||
mod images_cache; | ||
mod layers; | ||
mod layout; | ||
mod paragraphs; | ||
|
||
pub use accessibility::*; | ||
pub use compositor_dirty_nodes::*; | ||
pub use images_cache::*; | ||
pub use layers::*; | ||
pub use layout::*; | ||
pub use paragraphs::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,6 @@ def_attribute!( | |
/// } | ||
/// ``` | ||
aspect_ratio, | ||
|
||
cache_key, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -488,6 +488,7 @@ def_element!( | |
// Image | ||
image_data, | ||
aspect_ratio, | ||
cache_key, | ||
|
||
// Reference | ||
reference, | ||
|
Oops, something went wrong.