1
0
Fork 0
forked from wry/wry

render: remove clear OP

This commit is contained in:
Julian Orth 2023-10-29 22:53:45 +01:00
parent e0ed29038e
commit 1500b10de3
4 changed files with 18 additions and 38 deletions

View file

@ -25,7 +25,6 @@ use {
pub enum GfxApiOpt {
Sync,
Clear(Clear),
FillRect(FillRect),
CopyTexture(CopyTexture),
}
@ -87,10 +86,6 @@ pub struct AbsoluteRect {
pub y2: f32,
}
pub struct Clear {
pub color: Color,
}
pub struct FillRect {
pub rect: AbsoluteRect,
pub color: Color,
@ -175,7 +170,12 @@ impl dyn GfxFramebuffer {
self.render(ops, clear);
}
pub fn render_custom(&self, scale: Scale, f: &mut dyn FnMut(&mut RendererBase)) {
pub fn render_custom(
&self,
scale: Scale,
clear: Option<&Color>,
f: &mut dyn FnMut(&mut RendererBase),
) {
let mut ops = self.take_render_ops();
let mut renderer = RendererBase {
ops: &mut ops,
@ -184,7 +184,7 @@ impl dyn GfxFramebuffer {
scalef: scale.to_f64(),
};
f(&mut renderer);
self.render(ops, None);
self.render(ops, clear);
}
pub fn render_node(