summaryrefslogtreecommitdiff
path: root/glamor/glamor_render.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-12-27 09:00:58 -1000
committerEric Anholt <eric@anholt.net>2015-03-24 12:43:34 -0700
commit6ba6cc57e17aefb7db0201a1f3180ab55076eb48 (patch)
tree3c09ed398b8e3bf751c918ea101fb0a68d8ece3b /glamor/glamor_render.c
parent8102927282d5134493e5009a876a6b01a68d1f97 (diff)
glamor: Just set the logic op to what we want at the start of all rendering.
By dropping the unconditional logic op disable at the end of rendering, this fixes GL errors being thrown in GLES2 contexts (which don't have logic ops). On desktop, this also means a little less overhead per draw call from taking one less trip through the glEnable/glDisable switch statement of doom in Mesa. The exchange here is that we end up taking a trip through it in the XV, Render, and gradient-generation paths. If the glEnable() is actually costly, we should probably cache our logic op state in our screen, since there's no way the GL could make that switch statement as cheap as the caller caching it would be. v2: Don't forget to set the logic op in Xephyr's drawing. Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor/glamor_render.c')
-rw-r--r--glamor/glamor_render.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 6669f487e..27c09fd48 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -1172,6 +1172,7 @@ glamor_composite_with_shader(CARD8 op,
glamor_set_destination_pixmap_priv_nc(glamor_priv, dest_pixmap, dest_pixmap_priv);
glamor_composite_set_shader_blend(glamor_priv, dest_pixmap_priv, &key, shader, &op_info);
+ glamor_set_alu(screen, GXcopy);
glamor_make_current(glamor_priv);