gfx: attach color descriptions
This commit is contained in:
parent
82085a3858
commit
a174881138
24 changed files with 291 additions and 62 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue