1
0
Fork 0
forked from wry/wry

gfx: attach color descriptions

This commit is contained in:
Julian Orth 2025-03-01 14:06:42 +01:00
parent 82085a3858
commit a174881138
24 changed files with 291 additions and 62 deletions

View file

@ -69,7 +69,7 @@ use {
crate::{
cmm::cmm_transfer_function::TransferFunction,
gfx_api::{
AcquireSync, CopyTexture, FillRect, GfxApiOpt, GfxContext, GfxError, GfxTexture,
AcquireSync, CopyTexture, FramebufferRect, GfxApiOpt, GfxContext, GfxError, GfxTexture,
ReleaseSync, SyncFile,
},
gfx_apis::gl::{
@ -205,10 +205,15 @@ enum RenderError {
#[derive(Default)]
struct GfxGlState {
triangles: RefCell<Vec<[f32; 2]>>,
fill_rect: VecStorage<FillRect>,
fill_rect: VecStorage<GlFillRect>,
copy_tex: VecStorage<&'static CopyTexture>,
}
struct GlFillRect {
pub rect: FramebufferRect,
pub color: Color,
}
fn run_ops(fb: &Framebuffer, ops: &[GfxApiOpt]) -> Option<SyncFile> {
let mut state = fb.ctx.gl_state.borrow_mut();
let state = &mut *state;
@ -236,10 +241,9 @@ fn run_ops(fb: &Framebuffer, ops: &[GfxApiOpt]) -> Option<SyncFile> {
}
}
GfxApiOpt::FillRect(f) => {
fill_rect.push(FillRect {
fill_rect.push(GlFillRect {
rect: f.rect,
color: f.effective_color(),
alpha: None,
});
i += 1;
}