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
This commit is contained in:
Jonas Ådahl 2019-10-04 11:53:36 +02:00
parent 3e41568074
commit 2a990cc140

View File

@ -27,6 +27,7 @@
#include "backends/meta-monitor-transform.h" #include "backends/meta-monitor-transform.h"
#include "backends/native/meta-kms-types.h" #include "backends/native/meta-kms-types.h"
#include "meta/boxes.h"
struct _MetaKmsPageFlipFeedback struct _MetaKmsPageFlipFeedback
{ {
@ -89,4 +90,15 @@ meta_fixed_16_to_int (MetaFixed16 fixed)
return fixed / 65536; 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 */ #endif /* META_KMS_UPDATE_H */