From fa381cc36194fbefd26717b1b3031018d5a1400e Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 10 Jun 2010 17:35:56 +0100 Subject: [PATCH] offscreen-effect: Traslate the modelview with the offsets Instead of using the stage offsets when painting we can simply traslate the current modelview. This allows sub-classes to fully override the paint_target() virtual function without chaining up. --- clutter/clutter-offscreen-effect.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c index e3ce81752..009d44d80 100644 --- a/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter-offscreen-effect.c @@ -316,12 +316,12 @@ clutter_offscreen_effect_real_paint_target (ClutterOffscreenEffect *effect) /* paint the texture at the same position as the actor would be, * in Stage coordinates, since we set up the modelview matrix to - * be exactly as the stage sets it up + * be exactly as the stage sets it up, plus the eventual offsets + * due to offscreen effects stacking */ - cogl_rectangle_with_texture_coords (priv->x_offset, - priv->y_offset, - priv->x_offset + priv->target_width, - priv->y_offset + priv->target_height, + cogl_rectangle_with_texture_coords (0, 0, + priv->target_width, + priv->target_height, 0.0, 0.0, 1.0, 1.0); } @@ -364,6 +364,8 @@ clutter_offscreen_effect_post_paint (ClutterEffect *effect) cogl_push_matrix (); + cogl_translate (priv->x_offset, priv->y_offset, 0.0f); + /* paint the target material; this is virtualized for * sub-classes that require special hand-holding */