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.
This commit is contained in:
Stefano Facchini 2012-03-29 14:35:50 +02:00
parent 97dcfe5bf1
commit 2c46baf30c

View File

@ -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);