mirror of
https://github.com/penpot/penpot.git
synced 2025-06-10 13:01:40 +02:00
🎉 Improve tile caching
This commit is contained in:
parent
f3d13005b2
commit
5c7a1fb407
5 changed files with 95 additions and 225 deletions
|
@ -146,7 +146,7 @@ impl RenderState {
|
|||
}
|
||||
|
||||
pub fn add_image(&mut self, id: Uuid, image_data: &[u8]) -> Result<(), String> {
|
||||
self.images.add(id, image_data)
|
||||
self.images.add(id, image_data, &mut self.gpu_state.context)
|
||||
}
|
||||
|
||||
pub fn has_image(&mut self, id: &Uuid) -> bool {
|
||||
|
@ -193,9 +193,7 @@ impl RenderState {
|
|||
let x = self.current_tile.unwrap().0;
|
||||
let y = self.current_tile.unwrap().1;
|
||||
|
||||
// This caches the current surface into the corresponding tile.
|
||||
self.surfaces
|
||||
.cache_tile_surface((x, y), SurfaceId::Current, self.background_color);
|
||||
self.surfaces.cache_current_tile_texture((x, y));
|
||||
|
||||
self.surfaces
|
||||
.draw_cached_tile_surface(self.current_tile.unwrap(), rect);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue