mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 13:51:13 +00:00
Fix alpha blending in the gl renderer
This commit is contained in:
parent
8896364809
commit
c41cb3e179
1 changed files with 6 additions and 3 deletions
|
@ -192,6 +192,9 @@ impl GraphicsFrame for GLFrame {
|
||||||
fn render_primitive(&mut self, primitive: &OpaqueRenderingPrimitive, transform: &Matrix4<f32>) {
|
fn render_primitive(&mut self, primitive: &OpaqueRenderingPrimitive, transform: &Matrix4<f32>) {
|
||||||
let matrix: [[f32; 4]; 4] = (self.root_matrix * transform).into();
|
let matrix: [[f32; 4]; 4] = (self.root_matrix * transform).into();
|
||||||
|
|
||||||
|
let draw_params =
|
||||||
|
glium::DrawParameters { blend: glium::Blend::alpha_blending(), ..Default::default() };
|
||||||
|
|
||||||
match &primitive.0 {
|
match &primitive.0 {
|
||||||
GLRenderingPrimitive::FillPath { ref vertices, ref indices, style } => {
|
GLRenderingPrimitive::FillPath { ref vertices, ref indices, style } => {
|
||||||
let (r, g, b, a) = match style {
|
let (r, g, b, a) = match style {
|
||||||
|
@ -203,7 +206,7 @@ impl GraphicsFrame for GLFrame {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.glium_frame
|
self.glium_frame
|
||||||
.draw(vertices, indices, &self.path_program, &uniforms, &Default::default())
|
.draw(vertices, indices, &self.path_program, &uniforms, &draw_params)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
GLRenderingPrimitive::Texture { texture, vertices } => {
|
GLRenderingPrimitive::Texture { texture, vertices } => {
|
||||||
|
@ -215,7 +218,7 @@ impl GraphicsFrame for GLFrame {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.glium_frame
|
self.glium_frame
|
||||||
.draw(vertices, &indices, &self.image_program, &uniforms, &Default::default())
|
.draw(vertices, &indices, &self.image_program, &uniforms, &draw_params)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue