Forráskód Böngészése

app/gfx: cleanup unused fields and fix warnings

darkfi 8 hónapja
szülő
commit
81f160df1b

+ 31 - 82
bin/app/src/gfx/mod.rs

@@ -39,7 +39,6 @@ use std::{
         Arc,
     },
 };
-use tracing::{debug, span, Level};
 
 pub mod anim;
 use anim::{Frame as AnimFrame, GfxSeqAnim};
@@ -50,11 +49,12 @@ mod shader;
 mod trax;
 use trax::get_trax;
 
+#[cfg(target_os = "android")]
+use crate::ExecutorPtr;
 use crate::{
-    error::{Error, Result},
     prop::{BatchGuardId, PropertyAtomicGuard},
     util::unixtime,
-    ExecutorPtr, GOD,
+    GOD,
 };
 
 // This is very noisy so suppress output by default
@@ -74,7 +74,6 @@ pub type DebugTag = Option<&'static str>;
 
 macro_rules! d { ($($arg:tt)*) => { debug!(target: "gfx", $($arg)*); } }
 macro_rules! t { ($($arg:tt)*) => { trace!(target: "gfx", $($arg)*); } }
-macro_rules! e { ($($arg:tt)*) => { error!(target: "gfx", $($arg)*); } }
 
 #[cfg(target_os = "android")]
 pub fn get_window_size_filename() -> PathBuf {
@@ -325,13 +324,8 @@ impl RenderApi {
         self.send_with_epoch(method, epoch);
     }
 
-    pub fn replace_draw_calls(
-        &self,
-        batch_id: BatchGuardId,
-        timest: Timestamp,
-        dcs: Vec<(DcId, DrawCall)>,
-    ) {
-        let method = GraphicsMethod::ReplaceGfxDrawCalls { batch_id, timest, dcs };
+    pub fn replace_draw_calls(&self, batch_id: BatchGuardId, dcs: Vec<(DcId, DrawCall)>) {
+        let method = GraphicsMethod::ReplaceGfxDrawCalls { batch_id, dcs };
         self.send(method);
     }
 
@@ -748,7 +742,7 @@ pub enum GraphicsMethod {
     NewSeqAnim { id: AnimId, frames_len: usize, oneshot: bool, tag: DebugTag },
     UpdateSeqAnim { id: AnimId, frame_idx: usize, frame: AnimFrame, tag: DebugTag },
     DeleteSeqAnim((AnimId, DebugTag)),
-    ReplaceGfxDrawCalls { batch_id: BatchGuardId, timest: Timestamp, dcs: Vec<(DcId, DrawCall)> },
+    ReplaceGfxDrawCalls { batch_id: BatchGuardId, dcs: Vec<(DcId, DrawCall)> },
     StartBatch { batch_id: BatchGuardId, tag: DebugTag },
     EndBatch { batch_id: BatchGuardId, timest: Timestamp },
     Noop,
@@ -765,7 +759,7 @@ impl std::fmt::Debug for GraphicsMethod {
             Self::NewSeqAnim { .. } => write!(f, "NewSeqAnim"),
             Self::UpdateSeqAnim { .. } => write!(f, "UpdateSeqAnim"),
             Self::DeleteSeqAnim(_) => write!(f, "DeleteSeqAnim"),
-            Self::ReplaceGfxDrawCalls { batch_id: bid, timest: _, dcs: _ } => {
+            Self::ReplaceGfxDrawCalls { batch_id: bid, dcs: _ } => {
                 write!(f, "ReplaceGfxDrawCalls({bid})")
             }
             Self::StartBatch { batch_id, tag } => write!(f, "StartBatch({batch_id}, {tag:?})"),
@@ -1084,7 +1078,9 @@ impl Stage {
                 }
             }
             GraphicsMethod::StartBatch { batch_id, tag } => {
-                t!("Start batch {batch_id}: {tag:?}");
+                if DEBUG_GFXAPI {
+                    t!("Start batch {batch_id}: {tag:?}");
+                }
                 if !self.pending_batches.insert(*batch_id, vec![]).is_none() {
                     panic!("batch {batch_id} already open!")
                 }
@@ -1094,16 +1090,20 @@ impl Stage {
             }
             GraphicsMethod::EndBatch { batch_id, timest } => {
                 if self.dropped_batches.remove(batch_id) {
-                    t!("End batch {batch_id} was dropped");
+                    if DEBUG_GFXAPI {
+                        t!("End batch {batch_id} was dropped");
+                    }
                     return
                 }
-                t!("End batch {batch_id}");
+                if DEBUG_GFXAPI {
+                    t!("End batch {batch_id}");
+                }
                 let Some(batch) = self.pending_batches.remove(batch_id) else {
                     panic!("unknown batch {batch_id}")
                 };
                 for mut method in batch {
                     match &mut method {
-                        GraphicsMethod::ReplaceGfxDrawCalls { batch_id: _, timest: _, dcs } => {
+                        GraphicsMethod::ReplaceGfxDrawCalls { batch_id: _, dcs } => {
                             let dcs = std::mem::take(dcs);
                             self.method_replace_draw_calls(*timest, dcs)
                         }
@@ -1300,8 +1300,8 @@ impl Stage {
             GraphicsMethod::DeleteSeqAnim(..) => {
                 //trax.del_buf(epoch, *gbuff_id, *tag, *buftype);
             }
-            GraphicsMethod::ReplaceGfxDrawCalls { batch_id, timest, dcs } => {
-                trax.put_dcs(epoch, *batch_id, *timest, dcs);
+            GraphicsMethod::ReplaceGfxDrawCalls { batch_id, dcs } => {
+                trax.put_dcs(epoch, *batch_id, dcs);
             }
             GraphicsMethod::StartBatch { batch_id, tag } => {
                 trax.put_start_batch(epoch, *batch_id, *tag);
@@ -1323,10 +1323,8 @@ impl Stage {
         false
     }
 
+    #[instrument(skip_all, target = "gfx::process")]
     fn process_methods(&mut self) {
-        let span = span!(Level::TRACE, "process");
-        let _enter = span.enter();
-
         // Process as many methods as we can
         let methods = std::mem::take(&mut *self.method_queue.lock());
         for (epoch, method) in methods {
@@ -1340,7 +1338,10 @@ impl Stage {
                     trax.flush();
                 }
                 // Discard old rubbish
-                trace!(target: "gfx", "Discard method with old epoch: {epoch} curr: {} [method={method:?}]", self.epoch);
+                t!(
+                    "Discard method with old epoch: {epoch} curr: {} [method={method:?}]",
+                    self.epoch
+                );
                 continue
             }
             assert_eq!(epoch, self.epoch);
@@ -1351,10 +1352,8 @@ impl Stage {
         }
     }
 
+    #[instrument(skip_all, target = "gfx::pruner")]
     fn prime_screen(&mut self) {
-        let span = span!(Level::TRACE, "pruner");
-        let _enter = span.enter();
-
         let methods = self.pruner.recv_all();
         assert!(self.pending_batches.is_empty());
         // Process all cached methods by the pruner from while the screen was off.
@@ -1435,8 +1434,6 @@ struct PruneMethodHeap {
     new_tex: HashMap<TextureId, GraphicsMethod>,
     /// Deleted objects
     del: Vec<GraphicsMethod>,
-    /// Draw calls
-    dcs: HashMap<DcId, (BatchGuardId, Timestamp, DrawCall)>,
 
     epoch: EpochIndex,
 
@@ -1451,7 +1448,6 @@ impl PruneMethodHeap {
             new_buf: HashMap::new(),
             new_tex: HashMap::new(),
             del: vec![],
-            dcs: HashMap::new(),
             epoch,
             textures: std::ptr::null(),
             buffers: std::ptr::null(),
@@ -1524,24 +1520,14 @@ impl PruneMethodHeap {
                     t!("Discard ellided buffer {gbuff_id}");
                 }
             }
-            GraphicsMethod::NewSeqAnim { .. } => {
-                //self.new_buf.insert(gbuff_id, method);
-            }
-            GraphicsMethod::UpdateSeqAnim { .. } => {
-                //self.new_buf.insert(gbuff_id, method);
-            }
-            GraphicsMethod::DeleteSeqAnim(..) => {
-                //if self.new_buf.remove(&gbuff_id).is_none() {
-                //    self.del.push(method);
-                //}
-            }
-            GraphicsMethod::ReplaceGfxDrawCalls { batch_id, timest, dcs } => {
-                //self.method_replace_draw_calls(batch_id, timest, dcs)
-            }
+            GraphicsMethod::NewSeqAnim { .. } => {}
+            GraphicsMethod::UpdateSeqAnim { .. } => {}
+            GraphicsMethod::DeleteSeqAnim(..) => {}
+            GraphicsMethod::ReplaceGfxDrawCalls { .. } => {}
             // Discard batches since we will apply everything all at once anyway
             // once the screen is switched on.
             GraphicsMethod::StartBatch { batch_id, tag } => {
-                t!("Pruner drop start batch {batch_id}");
+                t!("Pruner drop start batch {batch_id} debug={tag:?}");
                 if !self.dropped_batches().insert(*batch_id) {
                     panic!("dropped batch {batch_id} already exits!");
                 }
@@ -1568,47 +1554,15 @@ impl PruneMethodHeap {
         unsafe { &mut *self.dropped_batches }
     }
 
-    fn method_replace_draw_calls(
-        &mut self,
-        batch_id: BatchGuardId,
-        timest: Timestamp,
-        dcs: Vec<(DcId, DrawCall)>,
-    ) {
-        for (key, val) in dcs {
-            match self.dcs.get_mut(&key) {
-                Some(old_val) => {
-                    // Only replace the draw call if it is more recent
-                    if old_val.1 < timest {
-                        *old_val = (batch_id, timest, val);
-                    } else {
-                        t!("Rejected stale draw_call {key}: {val:?}");
-                    }
-                }
-                None => {
-                    self.dcs.insert(key, (batch_id, timest, val));
-                }
-            }
-        }
-    }
-
     /// Collect everything now the screen is on
     fn recv_all(&mut self) -> Vec<GraphicsMethod> {
         // Inhale that smoke deep
-        let mut meth = Vec::with_capacity(
-            self.new_buf.len() + self.new_tex.len() + self.del.len() + self.dcs.len(),
-        );
+        let mut meth = Vec::with_capacity(self.new_buf.len() + self.new_tex.len() + self.del.len());
         let new_buf = std::mem::take(&mut self.new_buf);
         let new_tex = std::mem::take(&mut self.new_tex);
         meth.extend(new_buf.into_values());
         meth.extend(new_tex.into_values());
         meth.append(&mut self.del);
-        for (dc_id, (batch_id, timest, dc)) in std::mem::take(&mut self.dcs) {
-            meth.push(GraphicsMethod::ReplaceGfxDrawCalls {
-                batch_id,
-                timest,
-                dcs: vec![(dc_id, dc)],
-            });
-        }
         meth
     }
 }
@@ -1627,8 +1581,6 @@ enum ScreenState {
     PrimedOn,
     // Second update ready to process pruned buffered allocs
     SwitchOn,
-    // Invalid state
-    Noop,
 }
 
 impl ScreenState {
@@ -1639,7 +1591,6 @@ impl ScreenState {
                 On | ReadyOn | PrimedOn | SwitchOn => SwitchOff,
                 SwitchOff => Off,
                 Off => Off,
-                Noop => panic!("noop"),
             }
         } else {
             match self {
@@ -1648,7 +1599,6 @@ impl ScreenState {
                 PrimedOn => SwitchOn,
                 SwitchOn => On,
                 On => On,
-                Noop => panic!("noop"),
             }
         };
     }
@@ -1723,7 +1673,6 @@ impl EventHandler for Stage {
 
                 self.process_methods();
             }
-            ScreenState::Noop => panic!("noop screen state"),
         }
     }
 

+ 1 - 3
bin/app/src/gfx/trax.rs

@@ -51,14 +51,12 @@ impl Trax {
         &mut self,
         epoch: EpochIndex,
         batch_id: BatchGuardId,
-        timest: u64,
         dcs: &Vec<(u64, DrawCall)>,
     ) {
-        d!("put_dcs({epoch}, {batch_id}, {timest}, {dcs:?})");
+        d!("put_dcs({epoch}, {batch_id}, {dcs:?})");
         0u8.encode(&mut self.buf).unwrap();
         epoch.encode(&mut self.buf).unwrap();
         batch_id.encode(&mut self.buf).unwrap();
-        timest.encode(&mut self.buf).unwrap();
         dcs.encode(&mut self.buf).unwrap();
     }
 

+ 2 - 8
bin/app/src/ui/chatview/mod.rs

@@ -46,7 +46,6 @@ use crate::{
     },
     scene::{MethodCallSub, Pimpl, SceneNodeWeak},
     text::TextShaperPtr,
-    util::unixtime,
     ExecutorPtr,
 };
 
@@ -677,7 +676,6 @@ impl ChatView {
 
     #[instrument(skip(msgbuf), target = "ui::chatview")]
     async fn redraw_cached(&self, batch_id: BatchGuardId, msgbuf: &mut MessageBuffer) {
-        let timest = unixtime();
         let rect = self.rect.get();
 
         let mut mesh_instrs = self.get_meshes(msgbuf, &rect).await;
@@ -688,7 +686,7 @@ impl ChatView {
         let draw_calls =
             vec![(self.dc_key, DrawCall::new(instrs, vec![], self.z_index.get(), "chatview"))];
 
-        self.render_api.replace_draw_calls(batch_id, timest, draw_calls);
+        self.render_api.replace_draw_calls(batch_id, draw_calls);
     }
 
     /// Invalidates cache and redraws everything
@@ -1031,11 +1029,7 @@ impl UIObject for ChatView {
 impl Drop for ChatView {
     fn drop(&mut self) {
         let atom = self.render_api.make_guard(gfxtag!("ChatView::drop"));
-        self.render_api.replace_draw_calls(
-            atom.batch_id,
-            unixtime(),
-            vec![(self.dc_key, Default::default())],
-        );
+        self.render_api.replace_draw_calls(atom.batch_id, vec![(self.dc_key, Default::default())]);
     }
 }
 

+ 6 - 14
bin/app/src/ui/edit/mod.rs

@@ -47,7 +47,6 @@ use crate::{
     },
     scene::{MethodCallSub, Pimpl, SceneNodePtr, SceneNodeWeak},
     text2::{self, Editor},
-    util::unixtime,
     ExecutorPtr,
 };
 
@@ -1013,14 +1012,12 @@ impl BaseEdit {
 
     #[instrument(target = "ui::edit")]
     async fn redraw(&self, atom: &mut PropertyAtomicGuard) {
-        let timest = unixtime();
         let draw_update = self.make_draw_calls().await;
-        self.render_api.replace_draw_calls(atom.batch_id, timest, draw_update.draw_calls);
+        self.render_api.replace_draw_calls(atom.batch_id, draw_update.draw_calls);
     }
 
     /// Called when scroll changes. Moves content up or down. Nothing more.
     async fn redraw_scroll(&self, batch_id: BatchGuardId) {
-        let timest = unixtime();
         let rect = self.rect.get();
 
         let mut content_instrs = vec![DrawInstruction::ApplyView(rect.with_zero_pos())];
@@ -1042,18 +1039,16 @@ impl BaseEdit {
                 "chatedit_content",
             ),
         )];
-        self.render_api.replace_draw_calls(batch_id, timest, draw_main);
+        self.render_api.replace_draw_calls(batch_id, draw_main);
     }
 
     async fn redraw_cursor(&self, batch_id: BatchGuardId) {
-        let timest = unixtime();
         let instrs = self.get_cursor_instrs().await;
         let draw_calls = vec![(self.cursor_dc_key, DrawCall::new(instrs, vec![], 2, "curs_redr"))];
-        self.render_api.replace_draw_calls(batch_id, timest, draw_calls);
+        self.render_api.replace_draw_calls(batch_id, draw_calls);
     }
 
     async fn redraw_select(&self, batch_id: BatchGuardId) {
-        let timest = unixtime();
         let sel_instrs = self.regen_select_mesh().await;
         let phone_sel_instrs = self.regen_phone_select_handle_mesh().await;
         let draw_calls = vec![
@@ -1063,7 +1058,7 @@ impl BaseEdit {
                 DrawCall::new(phone_sel_instrs, vec![], 1, "chatedit_phone_sel_redraw_sel"),
             ),
         ];
-        self.render_api.replace_draw_calls(batch_id, timest, draw_calls);
+        self.render_api.replace_draw_calls(batch_id, draw_calls);
     }
 
     async fn get_cursor_instrs(&self) -> Vec<DrawInstruction> {
@@ -1357,11 +1352,8 @@ impl BaseEdit {
 impl Drop for BaseEdit {
     fn drop(&mut self) {
         let atom = self.render_api.make_guard(gfxtag!("BaseEdit::drop"));
-        self.render_api.replace_draw_calls(
-            atom.batch_id,
-            unixtime(),
-            vec![(self.text_dc_key, Default::default())],
-        );
+        self.render_api
+            .replace_draw_calls(atom.batch_id, vec![(self.text_dc_key, Default::default())]);
     }
 }
 

+ 2 - 8
bin/app/src/ui/emoji_picker/mod.rs

@@ -32,7 +32,6 @@ use crate::{
         BatchGuardPtr, PropertyAtomicGuard, PropertyFloat32, PropertyRect, PropertyUint32, Role,
     },
     scene::{Pimpl, SceneNodeWeak},
-    util::unixtime,
     ExecutorPtr,
 };
 
@@ -186,14 +185,13 @@ impl EmojiPicker {
 
     #[instrument(target = "ui::emoji_picker")]
     fn redraw(&self, atom: &mut PropertyAtomicGuard) {
-        let timest = unixtime();
         let Some(parent_rect) = self.parent_rect.lock().clone() else { return };
 
         let Some(draw_update) = self.get_draw_calls(parent_rect, atom) else {
             error!(target: "ui:emoji_picker", "Emoji picker failed to draw");
             return
         };
-        self.render_api.replace_draw_calls(atom.batch_id, timest, draw_update.draw_calls);
+        self.render_api.replace_draw_calls(atom.batch_id, draw_update.draw_calls);
     }
 
     fn get_draw_calls(
@@ -389,11 +387,7 @@ impl UIObject for EmojiPicker {
 impl Drop for EmojiPicker {
     fn drop(&mut self) {
         let atom = self.render_api.make_guard(gfxtag!("EmojiPicker::drop"));
-        self.render_api.replace_draw_calls(
-            atom.batch_id,
-            unixtime(),
-            vec![(self.dc_key, Default::default())],
-        );
+        self.render_api.replace_draw_calls(atom.batch_id, vec![(self.dc_key, Default::default())]);
     }
 }
 

+ 2 - 8
bin/app/src/ui/image.rs

@@ -28,7 +28,6 @@ use crate::{
     mesh::{MeshBuilder, MeshInfo, COLOR_WHITE},
     prop::{BatchGuardPtr, PropertyAtomicGuard, PropertyRect, PropertyStr, PropertyUint32, Role},
     scene::{Pimpl, SceneNodeWeak},
-    util::unixtime,
     ExecutorPtr,
 };
 
@@ -122,7 +121,6 @@ impl Image {
 
     #[instrument(target = "ui::button")]
     async fn redraw(self: Arc<Self>, batch: BatchGuardPtr) {
-        let timest = unixtime();
         let Some(parent_rect) = self.parent_rect.lock().clone() else { return };
 
         let atom = &mut batch.spawn();
@@ -130,7 +128,7 @@ impl Image {
             error!(target: "ui::image", "Image failed to draw");
             return
         };
-        self.render_api.replace_draw_calls(batch.id, timest, draw_update.draw_calls);
+        self.render_api.replace_draw_calls(batch.id, draw_update.draw_calls);
     }
 
     /// Called whenever any property changes.
@@ -219,11 +217,7 @@ impl UIObject for Image {
 impl Drop for Image {
     fn drop(&mut self) {
         let atom = self.render_api.make_guard(gfxtag!("Image::drop"));
-        self.render_api.replace_draw_calls(
-            atom.batch_id,
-            unixtime(),
-            vec![(self.dc_key, Default::default())],
-        );
+        self.render_api.replace_draw_calls(atom.batch_id, vec![(self.dc_key, Default::default())]);
     }
 }
 

+ 2 - 3
bin/app/src/ui/layer.rs

@@ -27,7 +27,7 @@ use crate::{
     gfx::{DrawCall, DrawInstruction, Point, Rectangle, RenderApi},
     prop::{BatchGuardPtr, PropertyAtomicGuard, PropertyBool, PropertyRect, PropertyUint32, Role},
     scene::{Pimpl, SceneNodePtr, SceneNodeWeak},
-    util::{i18n::I18nBabelFish, unixtime},
+    util::i18n::I18nBabelFish,
     ExecutorPtr,
 };
 
@@ -86,7 +86,6 @@ impl Layer {
 
     #[instrument(target = "ui::layer")]
     async fn redraw(self: Arc<Self>, batch: BatchGuardPtr) {
-        let timest = unixtime();
         let Some(parent_rect) = self.parent_rect.lock().clone() else { return };
 
         let atom = &mut batch.spawn();
@@ -94,7 +93,7 @@ impl Layer {
             error!(target: "ui:layer", "Layer failed to draw");
             return
         };
-        self.render_api.replace_draw_calls(batch.id, timest, draw_update.draw_calls);
+        self.render_api.replace_draw_calls(batch.id, draw_update.draw_calls);
     }
 
     async fn get_draw_calls(

+ 3 - 8
bin/app/src/ui/text.rs

@@ -30,7 +30,7 @@ use crate::{
     },
     scene::{Pimpl, SceneNodeWeak},
     text2::{self, TEXT_CTX},
-    util::{i18n::I18nBabelFish, unixtime},
+    util::i18n::I18nBabelFish,
     ExecutorPtr,
 };
 
@@ -139,7 +139,6 @@ impl Text {
 
     #[instrument(target = "ui::text")]
     async fn redraw(self: Arc<Self>, batch: BatchGuardPtr) {
-        let timest = unixtime();
         let Some(parent_rect) = self.parent_rect.lock().clone() else { return };
 
         let atom = &mut batch.spawn();
@@ -147,7 +146,7 @@ impl Text {
             error!(target: "ui::text", "Text failed to draw");
             return
         };
-        self.render_api.replace_draw_calls(batch.id, timest, draw_update.draw_calls);
+        self.render_api.replace_draw_calls(batch.id, draw_update.draw_calls);
     }
 
     async fn get_draw_calls(
@@ -214,11 +213,7 @@ impl UIObject for Text {
 impl Drop for Text {
     fn drop(&mut self) {
         let atom = self.render_api.make_guard(gfxtag!("Text::drop"));
-        self.render_api.replace_draw_calls(
-            atom.batch_id,
-            unixtime(),
-            vec![(self.dc_key, Default::default())],
-        );
+        self.render_api.replace_draw_calls(atom.batch_id, vec![(self.dc_key, Default::default())]);
     }
 }
 

+ 2 - 8
bin/app/src/ui/vector_art/mod.rs

@@ -26,7 +26,6 @@ use crate::{
     gfx::{gfxtag, DrawCall, DrawInstruction, DrawMesh, Rectangle, RenderApi},
     prop::{BatchGuardPtr, PropertyAtomicGuard, PropertyBool, PropertyRect, PropertyUint32, Role},
     scene::{Pimpl, SceneNodeWeak},
-    util::unixtime,
     ExecutorPtr,
 };
 
@@ -86,7 +85,6 @@ impl VectorArt {
 
     #[instrument(target = "ui::vector_art")]
     async fn redraw(self: Arc<Self>, batch: BatchGuardPtr) {
-        let timest = unixtime();
         let Some(parent_rect) = self.parent_rect.lock().clone() else { return };
 
         let atom = &mut batch.spawn();
@@ -94,7 +92,7 @@ impl VectorArt {
             error!(target: "ui:vector_art", "Mesh failed to draw");
             return
         };
-        self.render_api.replace_draw_calls(batch.id, timest, draw_update.draw_calls);
+        self.render_api.replace_draw_calls(batch.id, draw_update.draw_calls);
     }
 
     fn get_draw_instrs(&self) -> Vec<DrawInstruction> {
@@ -172,11 +170,7 @@ impl UIObject for VectorArt {
 impl Drop for VectorArt {
     fn drop(&mut self) {
         let atom = self.render_api.make_guard(gfxtag!("VectorArt::drop"));
-        self.render_api.replace_draw_calls(
-            atom.batch_id,
-            unixtime(),
-            vec![(self.dc_key, Default::default())],
-        );
+        self.render_api.replace_draw_calls(atom.batch_id, vec![(self.dc_key, Default::default())]);
     }
 }
 

+ 3 - 8
bin/app/src/ui/video.rs

@@ -33,7 +33,7 @@ use crate::{
     mesh::{MeshBuilder, MeshInfo, COLOR_WHITE},
     prop::{BatchGuardPtr, PropertyAtomicGuard, PropertyRect, PropertyStr, PropertyUint32, Role},
     scene::{Pimpl, SceneNodeWeak},
-    util::{spawn_thread, unixtime},
+    util::spawn_thread,
     ExecutorPtr,
 };
 
@@ -220,7 +220,6 @@ impl Video {
 
     #[instrument(target = "ui::video")]
     async fn redraw(self: Arc<Self>, batch: BatchGuardPtr) {
-        let timest = unixtime();
         let Some(parent_rect) = self.parent_rect.lock().clone() else { return };
 
         let atom = &mut batch.spawn();
@@ -228,7 +227,7 @@ impl Video {
             error!(target: "ui:video", "Video failed to draw");
             return
         };
-        self.render_api.replace_draw_calls(batch.id, timest, draw_update.draw_calls);
+        self.render_api.replace_draw_calls(batch.id, draw_update.draw_calls);
     }
 
     /// Called whenever any property changes.
@@ -386,11 +385,7 @@ impl UIObject for Video {
 impl Drop for Video {
     fn drop(&mut self) {
         let atom = self.render_api.make_guard(gfxtag!("Video::drop"));
-        self.render_api.replace_draw_calls(
-            atom.batch_id,
-            unixtime(),
-            vec![(self.dc_key, Default::default())],
-        );
+        self.render_api.replace_draw_calls(atom.batch_id, vec![(self.dc_key, Default::default())]);
     }
 }
 

+ 2 - 3
bin/app/src/ui/win.rs

@@ -33,7 +33,7 @@ use crate::{
         BatchGuardPtr, PropertyAtomicGuard, PropertyDimension, PropertyFloat32, PropertyStr, Role,
     },
     scene::{Pimpl, SceneNodePtr, SceneNodeWeak},
-    util::{i18n::I18nBabelFish, unixtime},
+    util::i18n::I18nBabelFish,
     ExecutorPtr,
 };
 
@@ -443,7 +443,6 @@ impl Window {
 
     #[instrument(target = "ui::win")]
     pub async fn draw(&self, atom: &mut PropertyAtomicGuard) {
-        let timest = unixtime();
         let virt_size = self.screen_size.get() / self.scale.get();
         let rect = Rectangle::from([0., 0., virt_size.w, virt_size.h]);
 
@@ -466,7 +465,7 @@ impl Window {
         draw_calls.push((0, dc));
         //t!("  => {:?}", draw_calls);
 
-        self.render_api.replace_draw_calls(atom.batch_id, timest, draw_calls);
+        self.render_api.replace_draw_calls(atom.batch_id, draw_calls);
     }
 
     async fn reload_locale(&self, atom: &mut PropertyAtomicGuard) {