From 420c99609b4ebd676134199a2d258f2024fa688b Mon Sep 17 00:00:00 2001 From: Glenn Watson Date: Fri, 5 Feb 2016 12:09:33 +1000 Subject: [PATCH] Fix text antialiasing issue with opacity < 1. Fixes #166. --- src/renderer.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/renderer.rs b/src/renderer.rs index 627bbdd930..012112a649 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -1102,21 +1102,18 @@ impl Renderer { &DrawCommand::Batch(ref info) => { // TODO: probably worth sorting front to back to minimize overdraw (if profiling shows fragment / rop bound) - gl::enable(gl::BLEND); - if self.enable_msaa { gl::enable(gl::MULTISAMPLE); } if layer.texture_id.is_some() { - gl::blend_func_separate(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA, - gl::ONE, gl::ONE); + gl::disable(gl::BLEND); } else { + gl::enable(gl::BLEND); gl::blend_func(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA); + gl::blend_equation(gl::FUNC_ADD); } - gl::blend_equation(gl::FUNC_ADD); - self.device.bind_program(self.quad_program_id, &projection);