tessera_ui_basic_components/pipelines/image/
command.rs1use std::{
2 hash::{Hash, Hasher},
3 sync::Arc,
4};
5
6use tessera_ui::DrawCommand;
7
8#[derive(Debug, Clone)]
21pub struct ImageData {
22 pub data: Arc<Vec<u8>>,
23 pub width: u32,
24 pub height: u32,
25}
26
27impl Hash for ImageData {
28 fn hash<H: Hasher>(&self, state: &mut H) {
29 self.data.as_ref().hash(state);
30 self.width.hash(state);
31 self.height.hash(state);
32 }
33}
34
35impl PartialEq for ImageData {
36 fn eq(&self, other: &Self) -> bool {
37 self.width == other.width
38 && self.height == other.height
39 && self.data.as_ref() == other.data.as_ref()
40 }
41}
42
43impl Eq for ImageData {}
44
45#[derive(Debug, Clone, Hash, PartialEq, Eq)]
53pub struct ImageCommand {
54 pub data: Arc<ImageData>,
55}
56
57impl DrawCommand for ImageCommand {
58 fn barrier(&self) -> Option<tessera_ui::BarrierRequirement> {
59 None
61 }
62}