mirror of
https://github.com/brl/mutter.git
synced 2024-11-24 09:00:42 -05:00
shaped-texture: Add priv pointer to _get_image()
The MetaShapedTexturePrivate is accessed more than once, so keep a pointer to it. https://gitlab.gnome.org/GNOME/mutter/merge_requests/362
This commit is contained in:
parent
06be60bc72
commit
a53eb8dcbd
@ -924,13 +924,14 @@ cairo_surface_t *
|
|||||||
meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
||||||
cairo_rectangle_int_t *clip)
|
cairo_rectangle_int_t *clip)
|
||||||
{
|
{
|
||||||
|
MetaShapedTexturePrivate *priv = stex->priv;
|
||||||
CoglTexture *texture, *mask_texture;
|
CoglTexture *texture, *mask_texture;
|
||||||
cairo_rectangle_int_t texture_rect = { 0, 0, 0, 0 };
|
cairo_rectangle_int_t texture_rect = { 0, 0, 0, 0 };
|
||||||
cairo_surface_t *surface;
|
cairo_surface_t *surface;
|
||||||
|
|
||||||
g_return_val_if_fail (META_IS_SHAPED_TEXTURE (stex), NULL);
|
g_return_val_if_fail (META_IS_SHAPED_TEXTURE (stex), NULL);
|
||||||
|
|
||||||
texture = COGL_TEXTURE (stex->priv->texture);
|
texture = COGL_TEXTURE (priv->texture);
|
||||||
|
|
||||||
if (texture == NULL)
|
if (texture == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -964,7 +965,7 @@ meta_shaped_texture_get_image (MetaShapedTexture *stex,
|
|||||||
if (clip != NULL)
|
if (clip != NULL)
|
||||||
cogl_object_unref (texture);
|
cogl_object_unref (texture);
|
||||||
|
|
||||||
mask_texture = stex->priv->mask_texture;
|
mask_texture = priv->mask_texture;
|
||||||
if (mask_texture != NULL)
|
if (mask_texture != NULL)
|
||||||
{
|
{
|
||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
|
Loading…
Reference in New Issue
Block a user