From 96f7bf28f15f0a43559d5197be773d125c62f494 Mon Sep 17 00:00:00 2001 From: Robert Mader Date: Fri, 29 Mar 2019 01:56:34 +0100 Subject: [PATCH] shaped-texture: Add checks to viewport reset functions The set and reset functions are unconditionally called on every commit. Add missings checks to the reset functions to bail out if nothing changed. https://gitlab.gnome.org/GNOME/mutter/merge_requests/504 --- src/compositor/meta-shaped-texture.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index d64e214e5..777e68632 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -1214,6 +1214,9 @@ meta_shaped_texture_set_viewport_src_rect (MetaShapedTexture *stex, void meta_shaped_texture_reset_viewport_src_rect (MetaShapedTexture *stex) { + if (!stex->has_viewport_src_rect) + return; + stex->has_viewport_src_rect = FALSE; invalidate_size (stex); } @@ -1237,6 +1240,9 @@ meta_shaped_texture_set_viewport_dst_size (MetaShapedTexture *stex, void meta_shaped_texture_reset_viewport_dst_size (MetaShapedTexture *stex) { + if (!stex->has_viewport_dst_size) + return; + stex->has_viewport_dst_size = FALSE; invalidate_size (stex); }