[clutter] cairo-texture: Skip ::draw emission for 0x0 surfaces
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] cairo-texture: Skip ::draw emission for 0x0 surfaces
- Date: Fri, 18 Nov 2011 17:24:48 +0000 (UTC)
commit 90f37d5636f5a1cec3e8423625647f774af7141f
Author: Emmanuele Bassi <ebassi gnome org>
Date: Fri Nov 18 17:22:12 2011 +0000
cairo-texture: Skip ::draw emission for 0x0 surfaces
This also avoids an assertion failure.
clutter/clutter-cairo-texture.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-cairo-texture.c b/clutter/clutter-cairo-texture.c
index 199f212..c8f165a 100644
--- a/clutter/clutter-cairo-texture.c
+++ b/clutter/clutter-cairo-texture.c
@@ -330,6 +330,12 @@ clutter_cairo_texture_emit_draw (ClutterCairoTexture *self,
gboolean result;
cairo_t *cr;
+ /* 0x0 surfaces don't need a ::draw */
+ if (self->priv->surface_width == 0 ||
+ self->priv->surface_height == 0)
+ return;
+
+ /* if the size is !0 then we must have a surface */
g_assert (self->priv->cr_surface != NULL);
cr = cairo_create (self->priv->cr_surface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]