mirror of
https://github.com/brl/mutter.git
synced 2025-07-05 18:39:52 +00:00
[MutterShapedTexture] Use cogl multitexture API
The older code relied on Clutter providing default texture coords for any
layers for which texture coords were not specified, which does not work as
of Clutter 1.1.6 (due to commit 8b950bdc87
).
https://bugzilla.gnome.org/show_bug.cgi?id=609657
This commit is contained in:
@ -427,24 +427,34 @@ mutter_shaped_texture_paint (ClutterActor *actor)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float coords[MAX_RECTS * 8];
|
float coords[8];
|
||||||
|
float x1, y1, x2, y2;
|
||||||
|
|
||||||
for (i = 0; i < n_rects; i++)
|
for (i = 0; i < n_rects; i++)
|
||||||
{
|
{
|
||||||
GdkRectangle *rect = &rects[i];
|
GdkRectangle *rect = &rects[i];
|
||||||
|
|
||||||
coords[i * 8 + 0] = rect->x;
|
x1 = rect->x;
|
||||||
coords[i * 8 + 1] = rect->y;
|
y1 = rect->y;
|
||||||
coords[i * 8 + 2] = rect->x + rect->width;
|
x2 = rect->x + rect->width;
|
||||||
coords[i * 8 + 3] = rect->y + rect->height;
|
y2 = rect->y + rect->height;
|
||||||
coords[i * 8 + 4] = rect->x / (alloc.x2 - alloc.x1);
|
|
||||||
coords[i * 8 + 5] = rect->y / (alloc.y2 - alloc.y1);
|
coords[0] = rect->x / (alloc.x2 - alloc.x1);
|
||||||
coords[i * 8 + 6] = (rect->x + rect->width) / (alloc.x2 - alloc.x1);
|
coords[1] = rect->y / (alloc.y2 - alloc.y1);
|
||||||
coords[i * 8 + 7] = (rect->y + rect->height) / (alloc.y2 - alloc.y1);
|
coords[2] = (rect->x + rect->width) / (alloc.x2 - alloc.x1);
|
||||||
}
|
coords[3] = (rect->y + rect->height) / (alloc.y2 - alloc.y1);
|
||||||
|
|
||||||
|
coords[4] = coords[0];
|
||||||
|
coords[5] = coords[1];
|
||||||
|
coords[6] = coords[2];
|
||||||
|
coords[7] = coords[3];
|
||||||
|
|
||||||
|
cogl_rectangle_with_multitexture_coords (x1, y1, x2, y2,
|
||||||
|
&coords[0], 8);
|
||||||
|
}
|
||||||
|
|
||||||
g_free (rects);
|
g_free (rects);
|
||||||
|
|
||||||
cogl_rectangles_with_texture_coords (coords, n_rects);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user