use crate::{layout::quad::ClipRect, node::color::Color};

pub struct RenderList {
  pub clear_color: Color,
  pub rects: Vec<RectCmd>,
  pub glyphs: Vec<GlyphCmd>,
  #[cfg(feature = "image")]
  pub images: Vec<crate::images::ImageCmd>,
  #[cfg(feature = "svg")]
  pub svgs: Vec<crate::svg::SvgCmd>,
  pub atlas: GlyphAtlas,
}

pub struct RectCmd {
  pub order: usize,
  pub x: f32,
  pub y: f32,
  pub width: f32,
  pub height: f32,
  pub color: Color,
  pub radii: [f32; 4],
  pub stroke: [f32; 4],
  pub stroke_color: Color,
  pub transform: [f32; 4],
  pub transform_origin: [f32; 2],
  pub clip: ClipRect,
}

pub struct GlyphCmd {
  pub order: usize,
  pub x: f32,
  pub y: f32,
  pub width: f32,
  pub height: f32,
  pub color: [f32; 4],
  pub uv_min: [f32; 2],
  pub uv_max: [f32; 2],
  pub transform: [f32; 4],
  pub transform_origin: [f32; 2],
  pub sharpness: f32,
  pub clip: ClipRect,
}

pub struct GlyphAtlas {
  pub data: Vec<u8>,
  pub width: u32,
  pub height: u32,
  pub version: u64,
}
