backends/native: Add set/get_damage functions to MetaFrameNative
(cherry picked from commit 90f5ce55a9b6a3addf82a32a0ea920aa5c969c07) Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441> Signed-off-by: Mingi Sung <sungmg@saltyming.net>
This commit is contained in:
parent
83f32de4a7
commit
f78c6603d2
2 changed files with 40 additions and 0 deletions
|
@ -31,6 +31,11 @@ struct _MetaFrameNative
|
||||||
CoglScanout *scanout;
|
CoglScanout *scanout;
|
||||||
|
|
||||||
MetaKmsUpdate *kms_update;
|
MetaKmsUpdate *kms_update;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
int n_rectangles;
|
||||||
|
int *rectangles; /* 4 x n_rectangles */
|
||||||
|
} damage;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -38,6 +43,7 @@ meta_frame_native_release (ClutterFrame *frame)
|
||||||
{
|
{
|
||||||
MetaFrameNative *frame_native = meta_frame_native_from_frame (frame);
|
MetaFrameNative *frame_native = meta_frame_native_from_frame (frame);
|
||||||
|
|
||||||
|
g_clear_pointer (&frame_native->damage.rectangles, g_free);
|
||||||
g_clear_object (&frame_native->buffer);
|
g_clear_object (&frame_native->buffer);
|
||||||
g_clear_object (&frame_native->scanout);
|
g_clear_object (&frame_native->scanout);
|
||||||
|
|
||||||
|
@ -108,3 +114,28 @@ meta_frame_native_get_scanout (MetaFrameNative *frame_native)
|
||||||
{
|
{
|
||||||
return frame_native->scanout;
|
return frame_native->scanout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_frame_native_set_damage (MetaFrameNative *frame_native,
|
||||||
|
const int *rectangles,
|
||||||
|
int n_rectangles)
|
||||||
|
{
|
||||||
|
size_t rectangles_size;
|
||||||
|
|
||||||
|
rectangles_size = n_rectangles * 4 * sizeof (int);
|
||||||
|
|
||||||
|
frame_native->damage.rectangles =
|
||||||
|
g_realloc (frame_native->damage.rectangles, rectangles_size);
|
||||||
|
memcpy (frame_native->damage.rectangles, rectangles, rectangles_size);
|
||||||
|
frame_native->damage.n_rectangles = n_rectangles;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
meta_frame_native_get_damage (MetaFrameNative *frame_native,
|
||||||
|
int **rectangles)
|
||||||
|
{
|
||||||
|
if (rectangles)
|
||||||
|
*rectangles = frame_native->damage.rectangles;
|
||||||
|
|
||||||
|
return frame_native->damage.n_rectangles;
|
||||||
|
}
|
||||||
|
|
|
@ -47,3 +47,12 @@ void meta_frame_native_set_scanout (MetaFrameNative *frame_native,
|
||||||
CoglScanout *scanout);
|
CoglScanout *scanout);
|
||||||
|
|
||||||
CoglScanout * meta_frame_native_get_scanout (MetaFrameNative *frame_native);
|
CoglScanout * meta_frame_native_get_scanout (MetaFrameNative *frame_native);
|
||||||
|
|
||||||
|
void
|
||||||
|
meta_frame_native_set_damage (MetaFrameNative *frame_native,
|
||||||
|
const int *rectangles,
|
||||||
|
int n_rectangles);
|
||||||
|
|
||||||
|
int
|
||||||
|
meta_frame_native_get_damage (MetaFrameNative *frame_native,
|
||||||
|
int **rectangles);
|
||||||
|
|
Loading…
Reference in a new issue