[clutter/clutter-1.10] canvas: avoid emission of "draw" signal when the size is zero



commit 25abc0bd739a127e7f6eb13485b99f85f1d3d4d8
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Thu Mar 29 14:35:50 2012 +0200

    canvas: avoid emission of "draw" signal when the size is zero
    
    This also avoids the warning
    
      Cogl-WARNING **: ./cogl-buffer.c:215: GL error (1285): Out of memory
    
    generated by cogl_buffer_map when the CoglBuffer has zero length.

 clutter/clutter-canvas.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter-canvas.c b/clutter/clutter-canvas.c
index 7913936..b77af55 100644
--- a/clutter/clutter-canvas.c
+++ b/clutter/clutter-canvas.c
@@ -333,7 +333,7 @@ clutter_canvas_emit_draw (ClutterCanvas *self)
   gboolean res;
   cairo_t *cr;
 
-  g_assert (priv->width >= 0 && priv->width >= 0);
+  g_assert (priv->width > 0 && priv->width > 0);
 
   if (priv->buffer == NULL)
     {
@@ -411,7 +411,7 @@ clutter_canvas_invalidate (ClutterContent *content)
       priv->buffer = NULL;
     }
 
-  if (priv->width < 0 || priv->height < 0)
+  if (priv->width <= 0 || priv->height <= 0)
     return;
 
   clutter_canvas_emit_draw (self);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]