use std::sync::Arc;
use agg_gui::color::Color;
use crate::custom_render::SharedCustomRenderer;
use crate::gradient;
use crate::LayerRoundedClip;
pub(crate) enum DrawCommand {
Solid {
verts: Vec<[f32; 2]>,
indices: Vec<u32>,
color: Color,
global_alpha: f32,
clip: Option<[i32; 4]>,
},
AaSolid {
verts: Vec<[f32; 3]>,
indices: Vec<u32>,
color: Color,
global_alpha: f32,
clip: Option<[i32; 4]>,
},
AaTexture {
verts: Vec<agg_gui::gl_renderer::AaTexVertex>,
indices: Vec<u32>,
color: Color,
global_alpha: f32,
clip: Option<[i32; 4]>,
},
Gradient {
verts: Vec<[f32; 3]>,
indices: Vec<u32>,
uniforms: gradient::GradientUniforms,
ramp: Vec<u8>,
clip: Option<[i32; 4]>,
},
Textured {
verts: [f32; 24],
texture: Arc<wgpu::Texture>,
view: wgpu::TextureView,
nearest: bool,
tint: [f32; 4],
clip: Option<[i32; 4]>,
},
LcdMask {
verts: [f32; 16],
texture: Arc<wgpu::Texture>,
view: wgpu::TextureView,
color: Color,
clip: Option<[i32; 4]>,
flatten: bool,
},
LcbMask {
verts: [f32; 16],
color_tex: Arc<wgpu::Texture>,
color_view: wgpu::TextureView,
alpha_tex: Arc<wgpu::Texture>,
alpha_view: wgpu::TextureView,
clip: Option<[i32; 4]>,
global_alpha: f32,
flatten: bool,
},
Clear(Color),
PushLayer {
texture: Arc<wgpu::Texture>,
view: wgpu::TextureView,
width: u32,
height: u32,
},
PopLayer {
texture: Arc<wgpu::Texture>,
view: wgpu::TextureView,
origin_x: f32,
origin_y: f32,
layer_w: u32,
layer_h: u32,
alpha: f32,
rounded_clip: Option<LayerRoundedClip>,
parent_clip: Option<[i32; 4]>,
},
CompositeLayer {
texture: Arc<wgpu::Texture>,
view: wgpu::TextureView,
origin_x: f32,
origin_y: f32,
layer_w: u32,
layer_h: u32,
alpha: f32,
rounded_clip: Option<LayerRoundedClip>,
parent_clip: Option<[i32; 4]>,
},
Custom {
renderer: SharedCustomRenderer,
screen_rect: agg_gui::Rect,
parent_clip: Option<[i32; 4]>,
},
}