Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable blending on render targets. #288

Merged
merged 1 commit into from Jun 10, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Enable blending on render targets.

It was disabled as a fix for #166, but that caused regressions on pages
that depend on blending. The issues related to the blur on box shadows
discussed in that issue seem to be resolved now, so the clear-color
solution works fine.

Addresses browserhtml/browserhtml#1068.
  • Loading branch information
pcwalton committed Jun 10, 2016
commit 629c514969327a1756f0ff2f4ad49b8a4ff09ccf
@@ -1195,12 +1195,7 @@ impl Renderer {
set_scissor_or_viewport(&layer_viewport, render_context, layer.texture_id, gl::scissor);
set_scissor_or_viewport(&layer_viewport, render_context, layer.texture_id, gl::viewport);

let clear_color = if layer.texture_id.is_some() {
ColorF::new(0.0, 0.0, 0.0, 0.0)
} else {
ColorF::new(1.0, 1.0, 1.0, 0.0)
};
gl::clear_color(clear_color.r, clear_color.g, clear_color.b, clear_color.a);
gl::clear_color(1.0, 1.0, 1.0, 0.0);
gl::clear(gl::COLOR_BUFFER_BIT | gl::DEPTH_BUFFER_BIT | gl::STENCIL_BUFFER_BIT);

let projection = Matrix4D::ortho(0.0,
@@ -1230,17 +1225,12 @@ impl Renderer {

self.enable_msaa(true);

if layer.texture_id.is_some() {
gl::disable(gl::BLEND);
} else {
gl::enable(gl::BLEND);
gl::blend_func_separate(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA,
gl::ONE, gl::ONE);
gl::blend_equation(gl::FUNC_ADD);
}
gl::enable(gl::BLEND);
gl::blend_func_separate(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA,
gl::ONE, gl::ONE);
gl::blend_equation(gl::FUNC_ADD);

self.device.bind_program(self.quad_program_id,
&projection);
self.device.bind_program(self.quad_program_id, &projection);

if !info.offset_palette.is_empty() {
// TODO(gw): Avoid alloc here...
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.