summaryrefslogtreecommitdiff
path: root/clutter/clutter-offscreen-effect.c
diff options
context:
space:
mode:
Diffstat (limited to 'clutter/clutter-offscreen-effect.c')
-rw-r--r--clutter/clutter-offscreen-effect.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c
index cf0d07c0f..071b4156f 100644
--- a/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter-offscreen-effect.c
@@ -85,9 +85,17 @@ struct _ClutterOffscreenEffectPrivate
gfloat x_offset;
gfloat y_offset;
+ /* The size of the texture */
gfloat target_width;
gfloat target_height;
+ /* This is the calculated size of the fbo before being passed
+ through create_texture(). This needs to be tracked separately so
+ that we can detect when a different size is calculated and
+ regenerate the fbo */
+ int fbo_width;
+ int fbo_height;
+
gint old_opacity_override;
/* The matrix that was current the last time the fbo was updated. We
@@ -154,8 +162,8 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
return FALSE;
}
- if (priv->target_width == fbo_width &&
- priv->target_height == fbo_height &&
+ if (priv->fbo_width == fbo_width &&
+ priv->fbo_height == fbo_height &&
priv->offscreen != COGL_INVALID_HANDLE)
return TRUE;
@@ -187,6 +195,9 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
priv->target_width = cogl_texture_get_width (texture);
priv->target_height = cogl_texture_get_height (texture);
+ priv->fbo_width = fbo_width;
+ priv->fbo_height = fbo_height;
+
if (priv->offscreen != COGL_INVALID_HANDLE)
cogl_handle_unref (priv->offscreen);
@@ -200,6 +211,8 @@ update_fbo (ClutterEffect *effect, int fbo_width, int fbo_height)
priv->target_width = 0;
priv->target_height = 0;
+ priv->fbo_width = 0;
+ priv->fbo_height = 0;
return FALSE;
}