object list API elements

This commit is contained in:
bunnie 2025-03-04 19:01:47 +08:00
parent 5d4d009e64
commit 15f41a5f5b
2 changed files with 14 additions and 0 deletions

View file

@ -94,6 +94,8 @@ pub enum GfxOpcode {
/// V2 API for claiming ownership of screen for modal operation
AcquireModal,
ReleaseModal,
/// V2 API for fast drawing of multiple objects
UnclippedObjectList,
/// Gutter for invalid calls
InvalidCall,

View file

@ -705,6 +705,18 @@ impl Gfx {
pub fn release_modal(&self) -> Result<xous::Result, xous::Error> {
send_message(self.conn, Message::new_scalar(GfxOpcode::ReleaseModal.to_usize().unwrap(), 0, 0, 0, 0))
}
/// V2-only API
pub fn draw_object_list(&self, list: ObjectList) -> Result<(), xous::Error> {
let buf = match Buffer::into_buf(list) {
Ok(b) => b,
Err(e) => {
log::error!("err: {:?}", e);
panic!("error")
}
};
buf.lend(self.conn, GfxOpcode::UnclippedObjectList.to_u32().unwrap()).map(|_| ())
}
}
use core::sync::atomic::{AtomicU32, Ordering};