mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Keep transient surface generations out of content diagnostics
This commit is contained in:
1 parent
eb67d8f066
commit
0d2ed110e8
1 file changed
+9
-1
@@ -309,7 +309,7 @@ impl PruneCursor {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone)]
|
||||
pub struct Surface {
|
||||
generation: u64,
|
||||
format: PixelFormat,
|
||||
@@ -317,6 +317,14 @@ pub struct Surface {
|
||||
tiles: BTreeMap<TileCoord, Arc<Tile>>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for Surface {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
// The generation identifies an edit history. Independently opened copies of the same
|
||||
// document should retain the same content representation.
|
||||
f.debug_struct("Surface").field("format", &self.format).field("default_pixel", &self.default_pixel).field("tiles", &self.tiles).finish()
|
||||
}
|
||||
}
|
||||
|
||||
/// Use stack storage when it fits, otherwise reuse a dynamically sized sample buffer.
|
||||
fn sample_buffer<'a>(channels: usize, stack: &'a mut [f32], heap: &'a mut Vec<f32>) -> &'a mut [f32] {
|
||||
if let Some(samples) = stack.get_mut(..channels) {
|
||||
|
||||
Reference in new issue
Block a user