mirror of
https://github.com/penpot/penpot.git
synced 2025-06-09 04:01:45 +02:00
🐛 Fix not enough surfaces
This commit is contained in:
parent
f04229d8cb
commit
ca202711e1
1 changed files with 4 additions and 1 deletions
|
@ -7,6 +7,7 @@ use super::{gpu_state::GpuState, tiles::Tile};
|
||||||
use base64::{engine::general_purpose, Engine as _};
|
use base64::{engine::general_purpose, Engine as _};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
|
const POOL_CAPACITY_MINIMUM: i32 = 32;
|
||||||
const POOL_CAPACITY_THRESHOLD: i32 = 4;
|
const POOL_CAPACITY_THRESHOLD: i32 = 4;
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, Copy)]
|
#[derive(Debug, PartialEq, Clone, Copy)]
|
||||||
|
@ -68,7 +69,9 @@ impl Surfaces {
|
||||||
let debug = target.new_surface_with_dimensions((width, height)).unwrap();
|
let debug = target.new_surface_with_dimensions((width, height)).unwrap();
|
||||||
|
|
||||||
let pool_capacity =
|
let pool_capacity =
|
||||||
(width / tile_dims.width) * (height / tile_dims.height) * POOL_CAPACITY_THRESHOLD;
|
((width / tile_dims.width) * (height / tile_dims.height) * POOL_CAPACITY_THRESHOLD)
|
||||||
|
.max(POOL_CAPACITY_MINIMUM);
|
||||||
|
|
||||||
let pool = SurfacePool::with_capacity(&mut target, tile_dims, pool_capacity as usize);
|
let pool = SurfacePool::with_capacity(&mut target, tile_dims, pool_capacity as usize);
|
||||||
let tiles = TileSurfaceCache::new(pool);
|
let tiles = TileSurfaceCache::new(pool);
|
||||||
Surfaces {
|
Surfaces {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue