drivers/graphics: Add API to check if shadow buffer present

This commit is contained in:
Wildan M
2026-04-12 12:39:09 +07:00
parent 619c2798e4
commit c2f46bf383
+4
View File
@@ -82,6 +82,10 @@ impl CpuBackedBuffer {
&self.buffer
}
pub fn has_shadow_buf(&self) -> bool {
self.shadow.is_some()
}
pub fn shadow_buf(&mut self) -> &mut [u8] {
self.shadow.as_deref_mut().unwrap_or(&mut *self.map)
}