Commit be7067bc authored by Owen Taylor's avatar Owen Taylor

Handle 0x0 textures by skipping paint/pick

Before we've retrieved a pixmap for a window, the shaped texture
has a 0x0 texture, which will cause mutter_shaped_texture_ensure_mask()
to crash. Just skip all of paint/pick in this case.

http://bugzilla.openedhand.com/show_bug.cgi?id=1283
parent af8d2815
......@@ -366,6 +366,17 @@ mutter_shaped_texture_paint (ClutterActor *actor)
ClutterActorBox alloc;
static const ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
if (!CLUTTER_ACTOR_IS_REALIZED (CLUTTER_ACTOR (stex)))
clutter_actor_realize (CLUTTER_ACTOR (stex));
paint_tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex));
tex_width = cogl_texture_get_width (paint_tex);
tex_height = cogl_texture_get_height (paint_tex);
if (tex_width == 0 || tex_width == 0) /* no contents yet */
return;
/* If there are no rectangles or multi-texturing isn't supported,
fallback to the regular paint method */
if (priv->rectangles->len < 1
......@@ -376,11 +387,6 @@ mutter_shaped_texture_paint (ClutterActor *actor)
return;
}
if (!CLUTTER_ACTOR_IS_REALIZED (CLUTTER_ACTOR (stex)))
clutter_actor_realize (CLUTTER_ACTOR (stex));
paint_tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex));
if (paint_tex == COGL_INVALID_HANDLE)
return;
......@@ -392,9 +398,6 @@ mutter_shaped_texture_paint (ClutterActor *actor)
return;
}
tex_width = cogl_texture_get_width (paint_tex);
tex_height = cogl_texture_get_height (paint_tex);
mutter_shaped_texture_ensure_mask (stex);
cogl_texture_get_gl_texture (paint_tex, &paint_gl_tex, &paint_target);
......@@ -512,12 +515,19 @@ mutter_shaped_texture_pick (ClutterActor *actor,
{
CoglHandle paint_tex;
ClutterActorBox alloc;
guint tex_width, tex_height;
paint_tex = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (stex));
if (paint_tex == COGL_INVALID_HANDLE)
return;
tex_width = cogl_texture_get_width (paint_tex);
tex_height = cogl_texture_get_height (paint_tex);
if (tex_width == 0 || tex_width == 0) /* no contents yet */
return;
mutter_shaped_texture_ensure_mask (stex);
cogl_color (color);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment