shaped-texture: Add get_width()/get_height() API

Add an API to retrieve the content size of a shaped texture.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/1022
This commit is contained in:
Olivier Fourdan 2020-02-03 14:18:57 +01:00
parent 840c50b00d
commit ebc07871eb
2 changed files with 23 additions and 0 deletions

View File

@ -63,4 +63,7 @@ gboolean meta_shaped_texture_update_area (MetaShapedTexture *stex,
int height,
cairo_rectangle_int_t *clip);
int meta_shaped_texture_get_width (MetaShapedTexture *stex);
int meta_shaped_texture_get_height (MetaShapedTexture *stex);
#endif

View File

@ -1437,3 +1437,23 @@ meta_shaped_texture_get_buffer_scale (MetaShapedTexture *stex)
return stex->buffer_scale;
}
int
meta_shaped_texture_get_width (MetaShapedTexture *stex)
{
g_return_val_if_fail (META_IS_SHAPED_TEXTURE (stex), 0);
ensure_size_valid (stex);
return stex->dst_width;
}
int
meta_shaped_texture_get_height (MetaShapedTexture *stex)
{
g_return_val_if_fail (META_IS_SHAPED_TEXTURE (stex), 0);
ensure_size_valid (stex);
return stex->dst_height;
}