Signed-off-by: Yonit Halperin <yhalp...@redhat.com> --- common/rect.h | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/common/rect.h b/common/rect.h index 655e9e8..0e4b01e 100644 --- a/common/rect.h +++ b/common/rect.h @@ -80,6 +80,11 @@ static INLINE int rect_contains(const SpiceRect *big, const SpiceRect *small) big->top <= small->top && big->bottom >= small->bottom; } +static INLINE int rect_get_area(const SpiceRect *r) +{ + return (r->right - r->left) * (r->bottom - r->top); +} + SPICE_END_DECLS #ifdef __cplusplus @@ -124,6 +129,11 @@ static inline int rect_contains(const SpiceRect& big, const SpiceRect& small) return rect_contains(&big, &small); } +static inline int rect_get_area(const SpiceRect& r) +{ + return rect_contains(&r); +} + #endif /* __cplusplus */ #endif -- 1.7.7.6 _______________________________________________ Spice-devel mailing list Spice-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/spice-devel