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:
Jonas Ådahl 2018-12-20 17:22:37 +01:00 committed by Ray Strode
parent 06be60bc72
commit a53eb8dcbd

View File

@ -924,13 +924,14 @@ cairo_surface_t *
meta_shaped_texture_get_image (MetaShapedTexture *stex,
cairo_rectangle_int_t *clip)
{
MetaShapedTexturePrivate *priv = stex->priv;
CoglTexture *texture, *mask_texture;
cairo_rectangle_int_t texture_rect = { 0, 0, 0, 0 };
cairo_surface_t *surface;
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)
return NULL;
@ -964,7 +965,7 @@ meta_shaped_texture_get_image (MetaShapedTexture *stex,
if (clip != NULL)
cogl_object_unref (texture);
mask_texture = stex->priv->mask_texture;
mask_texture = priv->mask_texture;
if (mask_texture != NULL)
{
cairo_t *cr;