mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 18:46:57 -06:00
Fix up merged PRs: main's newer textures (document window, SmartArt previews, show grid) go through textures::upload so they stay within the GPU max texture side (#652)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
e225e4eec1
commit
2a410e54fa
@@ -164,7 +164,7 @@ fn ensure_texture(
|
||||
slide,
|
||||
&RenderOpts { scale: w as f64 / doc.slide_size.width.max(1.0), size: Some((w, h)), edit: true, threads: 0, ..Default::default() },
|
||||
);
|
||||
let tex = ctx.load_texture("doc-window-slide", crate::textures::to_color_image(&img, grayscale), egui::TextureOptions::LINEAR);
|
||||
let tex = crate::textures::upload(ctx, "doc-window-slide", crate::textures::to_color_image(&img, grayscale));
|
||||
if let Some(win) = app.doc_window.as_mut() {
|
||||
win.key = Some(key);
|
||||
win.tex = Some(tex.clone());
|
||||
|
||||
@@ -1689,7 +1689,7 @@ fn render_thumb(ctx: &egui::Context, show: &mut Show, doc: &Presentation, i: usi
|
||||
i,
|
||||
&RenderOpts { scale: w / doc.slide_size.width.max(1.0), size: Some((w as u32, h as u32)), ..Default::default() },
|
||||
);
|
||||
let tex = ctx.load_texture(format!("show-grid-{i}"), crate::textures::to_color_image(&img, false), egui::TextureOptions::LINEAR);
|
||||
let tex = crate::textures::upload(ctx, format!("show-grid-{i}"), crate::textures::to_color_image(&img, false));
|
||||
show.thumbs.push((i, tex.clone()));
|
||||
Some(tex)
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ impl Textures {
|
||||
let id = g.id;
|
||||
s.shapes = vec![g];
|
||||
let img = deckcraft_render::render_shape(p, &s, id, width_px as f64 / 336.0)?;
|
||||
let tex = ctx.load_texture(format!("smartart-{key}"), to_color_image(&img, false), TextureOptions::LINEAR);
|
||||
let tex = upload(ctx, format!("smartart-{key}"), to_color_image(&img, false));
|
||||
if self.smartart.len() > 300 {
|
||||
self.smartart.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user