From 1d14e7468bcf999cc3cd3847eb41372bce6483c4 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Tue, 15 Mar 2011 16:20:34 +0000 Subject: [PATCH] clutter-offscreen-effect: Paint with 'nearest' texture filter mode The texture containing the image for the redirected actor will always be painted at a 1:1 texel:pixel ratio so there's no need to use linear filtering. This should also counteract some of the effects of rounding errors when calculating the geometry for the quad. --- clutter/clutter-offscreen-effect.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c index d17dd5cbb..a8658f913 100644 --- a/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter-offscreen-effect.c @@ -150,7 +150,17 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height) return TRUE; if (priv->target == COGL_INVALID_HANDLE) - priv->target = cogl_material_new (); + { + priv->target = cogl_material_new (); + + /* We're always going to render the texture at a 1:1 texel:pixel + ratio so we can use 'nearest' filtering to decrease the + effects of rounding errors in the geometry calculation */ + cogl_material_set_layer_filters (priv->target, + 0, /* layer_index */ + COGL_MATERIAL_FILTER_NEAREST, + COGL_MATERIAL_FILTER_NEAREST); + } texture = clutter_offscreen_effect_create_texture (self, fbo_width, fbo_height);