diff options
author | Robert Bragg <robert@linux.intel.com> | 2011-03-10 18:51:51 +0000 |
---|---|---|
committer | Robert Bragg <robert@linux.intel.com> | 2011-03-10 21:02:29 +0000 |
commit | 49ca9e8f121db77f3b7aa75b9f2e30150b86eb9b (patch) | |
tree | d8aa46e19aa40b25b209d4be28c32a3299584f5a | |
parent | 5ce13b58fe9166e00384114983eaea8a07ca935a (diff) | |
download | clutter-49ca9e8f121db77f3b7aa75b9f2e30150b86eb9b.tar.gz |
culling: Don't cull actors not being painted on the stage
Previously we were applying the culling optimization to any actor
painted without considering that we may be painting to an offscreen
framebuffer where the stage clip isn't applicable.
For now we simply expose a getter for the current draw framebuffer
and we can assume that a return value of NULL corresponds to the
stage.
Note: This will need to be updated as stages start to be backed by real
CoglFramebuffer objects and so we won't get NULL in those cases.
-rw-r--r-- | clutter/clutter-actor.c | 8 | ||||
-rw-r--r-- | clutter/cogl/cogl/cogl.h | 3 |
2 files changed, 11 insertions, 0 deletions
diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index d90b2131a..2630a52fa 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -2524,6 +2524,14 @@ cull_actor (ClutterActor *self) const ClutterPlane *stage_clip; ClutterCullResult result; + if (_cogl_get_draw_buffer () != NULL) + { + CLUTTER_NOTE (CLIPPING, "Bail from cull_actor without culling (%s): " + "Current framebuffer doesn't correspond to stage", + G_OBJECT_TYPE_NAME (self)); + return FALSE; + } + if (!priv->last_paint_volume_valid) { CLUTTER_NOTE (CLIPPING, "Bail from cull_actor without culling (%s): " diff --git a/clutter/cogl/cogl/cogl.h b/clutter/cogl/cogl/cogl.h index a7f9ea722..e3df2ebd2 100644 --- a/clutter/cogl/cogl/cogl.h +++ b/clutter/cogl/cogl/cogl.h @@ -1282,6 +1282,9 @@ _cogl_onscreen_clutter_backend_set_size (int width, int height); void _cogl_swap_buffers_notify (void); +CoglFramebuffer * +_cogl_get_draw_buffer (void); + G_END_DECLS #undef __COGL_H_INSIDE__ |