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
This commit is contained in:
Robert Mader 2019-03-29 01:56:34 +01:00 committed by Georges Basile Stavracas Neto
parent db486ad897
commit 96f7bf28f1

View File

@ -1214,6 +1214,9 @@ meta_shaped_texture_set_viewport_src_rect (MetaShapedTexture *stex,
void void
meta_shaped_texture_reset_viewport_src_rect (MetaShapedTexture *stex) meta_shaped_texture_reset_viewport_src_rect (MetaShapedTexture *stex)
{ {
if (!stex->has_viewport_src_rect)
return;
stex->has_viewport_src_rect = FALSE; stex->has_viewport_src_rect = FALSE;
invalidate_size (stex); invalidate_size (stex);
} }
@ -1237,6 +1240,9 @@ meta_shaped_texture_set_viewport_dst_size (MetaShapedTexture *stex,
void void
meta_shaped_texture_reset_viewport_dst_size (MetaShapedTexture *stex) meta_shaped_texture_reset_viewport_dst_size (MetaShapedTexture *stex)
{ {
if (!stex->has_viewport_dst_size)
return;
stex->has_viewport_dst_size = FALSE; stex->has_viewport_dst_size = FALSE;
invalidate_size (stex); invalidate_size (stex);
} }