[clutter/clutter-1.6] texture: Add some safeguards for paint volumes of empty textures
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/clutter-1.6] texture: Add some safeguards for paint volumes of empty textures
- Date: Fri, 1 Apr 2011 13:54:53 +0000 (UTC)
commit 8459edb60da8381c2b73a68ba8496f4d0ae77700
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Fri Apr 1 11:42:41 2011 +0100
texture: Add some safeguards for paint volumes of empty textures
If the Texture has no material, and the image size is 0x0 then the actor
doesn't have any paint volume.
(cherry picked from commit 7e6bf1612b686f42ec82666ddb91b2d6ca7dbb0c)
Signed-off-by: Emmanuele Bassi <ebassi linux intel com>
clutter/clutter-texture.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c
index 4080c43..e6a0c03 100644
--- a/clutter/clutter-texture.c
+++ b/clutter/clutter-texture.c
@@ -689,6 +689,16 @@ static gboolean
clutter_texture_get_paint_volume (ClutterActor *self,
ClutterPaintVolume *volume)
{
+ ClutterTexturePrivate *priv;
+
+ priv = CLUTTER_TEXTURE (self)->priv;
+
+ if (priv->material == NULL)
+ return FALSE;
+
+ if (priv->image_width == 0 || priv->image_height == 0)
+ return FALSE;
+
return _clutter_actor_set_default_paint_volume (self,
CLUTTER_TYPE_TEXTURE,
volume);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]