summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2016-05-13 04:25:43 -0700
committerAdam Jackson <ajax@redhat.com>2016-07-06 13:21:27 -0400
commite63e9b8f197889b6c162ba36988d6e5656cb0c10 (patch)
tree02a14c4e87b3644ef3480ea54b41b9354a8ca21a
parentd37329cba42fa8e72fe4be8a7be18e512268b5bd (diff)
glamor: Disable logic ops when doing compositing [v4]
If the logic op gets left enabled, it overrides the blending operation, causing incorrect contents on the display. v2: Disable only on non-ES2, but disable even for PictOpSrc v3: Found another place this is needed in glamor_composite_set_shader_blend v4: Remove change dependent on new glamor_set_composite_texture API. This belongs in a different patch. Found by Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (cherry picked from commit 743b6f231e999d8b2909228412266dc13cc433c5)
-rw-r--r--glamor/glamor_program.c4
-rw-r--r--glamor/glamor_render.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/glamor/glamor_program.c b/glamor/glamor_program.c
index 0a94de62f..322d1983d 100644
--- a/glamor/glamor_program.c
+++ b/glamor/glamor_program.c
@@ -445,6 +445,7 @@ static struct blendinfo composite_op_info[] = {
static void
glamor_set_blend(CARD8 op, glamor_program_alpha alpha, PicturePtr dst)
{
+ glamor_screen_private *glamor_priv = glamor_get_screen_private(dst->pDrawable->pScreen);
GLenum src_blend, dst_blend;
struct blendinfo *op_info;
@@ -459,6 +460,9 @@ glamor_set_blend(CARD8 op, glamor_program_alpha alpha, PicturePtr dst)
break;
}
+ if (glamor_priv->gl_flavor != GLAMOR_GL_ES2)
+ glDisable(GL_COLOR_LOGIC_OP);
+
if (op == PictOpSrc)
return;
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 375617f41..8bdccd96d 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1096,6 +1096,9 @@ glamor_composite_set_shader_blend(glamor_screen_private *glamor_priv,
}
}
+ if (glamor_priv->gl_flavor != GLAMOR_GL_ES2)
+ glDisable(GL_COLOR_LOGIC_OP);
+
if (op_info->source_blend == GL_ONE && op_info->dest_blend == GL_ZERO) {
glDisable(GL_BLEND);
}