From 2a990cc140c7b5782e76a172e229e75d98b34264 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Fri, 4 Oct 2019 11:53:36 +0200 Subject: [PATCH] kms/update: Add helper to turn fixed point rect into int rect Currently unused, but will in the following commit. https://gitlab.gnome.org/GNOME/mutter/merge_requests/826 --- src/backends/native/meta-kms-update.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/backends/native/meta-kms-update.h b/src/backends/native/meta-kms-update.h index fc7d83f33..1b6942f27 100644 --- a/src/backends/native/meta-kms-update.h +++ b/src/backends/native/meta-kms-update.h @@ -27,6 +27,7 @@ #include "backends/meta-monitor-transform.h" #include "backends/native/meta-kms-types.h" +#include "meta/boxes.h" struct _MetaKmsPageFlipFeedback { @@ -89,4 +90,15 @@ meta_fixed_16_to_int (MetaFixed16 fixed) return fixed / 65536; } +static inline MetaRectangle +meta_fixed_16_rectangle_to_rectangle (MetaFixed16Rectangle fixed_rect) +{ + return (MetaRectangle) { + .x = meta_fixed_16_to_int (fixed_rect.x), + .y = meta_fixed_16_to_int (fixed_rect.y), + .width = meta_fixed_16_to_int (fixed_rect.width), + .height = meta_fixed_16_to_int (fixed_rect.height), + }; +} + #endif /* META_KMS_UPDATE_H */