From a53eb8dcbdc0fbed2859f61e941200e216a7a61a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Thu, 20 Dec 2018 17:22:37 +0100 Subject: [PATCH] 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 --- src/compositor/meta-shaped-texture.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index 6cde86390..0fa5fa92f 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -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;