diff options
author | Eric Anholt <eric@anholt.net> | 2016-01-27 10:24:17 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-01-29 18:52:41 -0800 |
commit | 20cb5b2d65ce63ea7934b77f1520387550c778a8 (patch) | |
tree | 201cfd889b69812b332b18299d43dd7095938595 | |
parent | 07f0d90e4a8b05ef968b1ef47acda7c9f4580340 (diff) |
glamor: Clarify some logic in RepeatFix handling.
wh ratios are != 1.0 only when large, so with that we can simplify
down how we end up with RepeatFix being used.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r-- | glamor/glamor_render.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c index ec757b314..4fbf84294 100644 --- a/glamor/glamor_render.c +++ b/glamor/glamor_render.c @@ -565,22 +565,15 @@ glamor_set_composite_texture(glamor_screen_private *glamor_priv, int unit, * GLES2 doesn't support RepeatNone. We need to fix it anyway. * **/ - if (repeat_type != RepeatNone) - repeat_type += RepeatFix; - else if (glamor_priv->gl_flavor == GLAMOR_GL_ES2 - || glamor_pixmap_priv_is_large(pixmap_priv)) { - if (picture->transform) - repeat_type += RepeatFix; - } - if (repeat_type >= RepeatFix) { + if (glamor_pixmap_priv_is_large(pixmap_priv) || + (glamor_priv->gl_flavor == GLAMOR_GL_ES2 && repeat_type == RepeatNone && + picture->transform)) { glamor_pixmap_fbo_fix_wh_ratio(wh, pixmap, pixmap_priv); - if ((wh[0] != 1.0 || wh[1] != 1.0) - || (glamor_priv->gl_flavor == GLAMOR_GL_ES2 - && repeat_type == RepeatFix)) - glUniform4fv(wh_location, 1, wh); - else - repeat_type -= RepeatFix; + glUniform4fv(wh_location, 1, wh); + + repeat_type += RepeatFix; } + glUniform1i(repeat_location, repeat_type); } |