summaryrefslogtreecommitdiff
path: root/clutter/clutter-offscreen-effect.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2011-03-04 17:04:02 +0000
committerNeil Roberts <neil@linux.intel.com>2011-03-04 17:04:02 +0000
commit9e11aa38207173aaa6669ea98211174a13139db1 (patch)
tree6954c67638ac2a5161ec100daf9404fea3936c29 /clutter/clutter-offscreen-effect.c
parentd306b4bb7d7a9c8b0b02c7e940b66f51ec62e18d (diff)
downloadclutter-9e11aa38207173aaa6669ea98211174a13139db1.tar.gz
clutter-offscreen-effect: Use 0,0 as the offset if no actor box
clutter_offscreen_effect_pre_paint was using the unitialized value of the ‘box’ variable whenever the actor doesn't have a paint volume. This patch makes it just set the offset to 0,0 instead.
Diffstat (limited to 'clutter/clutter-offscreen-effect.c')
-rw-r--r--clutter/clutter-offscreen-effect.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c
index be2c2d19a..d17dd5cbb 100644
--- a/clutter/clutter-offscreen-effect.c
+++ b/clutter/clutter-offscreen-effect.c
@@ -211,13 +211,18 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
* we need to redirect its rendering offscreen and its position will
* be used to setup an offset viewport */
if (clutter_actor_get_paint_box (priv->actor, &box))
- clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
+ {
+ clutter_actor_box_get_size (&box, &fbo_width, &fbo_height);
+ clutter_actor_box_get_origin (&box, &priv->x_offset, &priv->y_offset);
+ }
else
{
/* If we can't get a valid paint box then we fallback to
* creating a full stage size fbo. */
ClutterActor *stage = _clutter_actor_get_stage_internal (priv->actor);
clutter_actor_get_size (stage, &fbo_width, &fbo_height);
+ priv->x_offset = 0.0f;
+ priv->y_offset = 0.0f;
}
/* First assert that the framebuffer is the right size... */
@@ -236,7 +241,6 @@ clutter_offscreen_effect_pre_paint (ClutterEffect *effect)
* but offset it so that the actor of interest lands on our
* framebuffer. */
clutter_actor_get_size (priv->stage, &width, &height);
- clutter_actor_box_get_origin (&box, &priv->x_offset, &priv->y_offset);
/* Expand the viewport if the actor is partially off-stage,
* otherwise the actor will end up clipped to the stage viewport