[mutter/wip/rstrode/rhel-8.0.0: 83/117] screen-cast-monitor-stream-src: Only send cursor bitmap when it changes
- From: Ray Strode <halfline src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/rstrode/rhel-8.0.0: 83/117] screen-cast-monitor-stream-src: Only send cursor bitmap when it changes
- Date: Sun, 17 Feb 2019 17:29:48 +0000 (UTC)
commit a7f2145965af7150ec0b54cdb99441f049cc44b9
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Jan 3 16:51:08 2019 +0100
screen-cast-monitor-stream-src: Only send cursor bitmap when it changes
To avoid unnecessary pixel copying, only send the cursor bitmap when it
changes. This also allows the receiver to know when the cursor bitmap
actually changed.
https://gitlab.gnome.org/GNOME/mutter/merge_requests/357
src/backends/meta-screen-cast-monitor-stream-src.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c
b/src/backends/meta-screen-cast-monitor-stream-src.c
index 6be477989..1d6aea242 100644
--- a/src/backends/meta-screen-cast-monitor-stream-src.c
+++ b/src/backends/meta-screen-cast-monitor-stream-src.c
@@ -40,6 +40,8 @@ struct _MetaScreenCastMonitorStreamSrc
{
MetaScreenCastStreamSrc parent;
+ gboolean cursor_bitmap_invalid;
+
gulong actors_painted_handler_id;
gulong paint_handler_id;
gulong cursor_moved_handler_id;
@@ -194,6 +196,7 @@ static void
cursor_changed (MetaCursorTracker *cursor_tracker,
MetaScreenCastMonitorStreamSrc *monitor_src)
{
+ monitor_src->cursor_bitmap_invalid = TRUE;
sync_cursor_state (monitor_src);
}
@@ -452,6 +455,16 @@ meta_screen_cast_monitor_stream_src_set_cursor_metadata (MetaScreenCastStreamSrc
spa_meta_cursor->id = 1;
spa_meta_cursor->position.x = (int32_t) roundf (cursor_position.x);
spa_meta_cursor->position.y = (int32_t) roundf (cursor_position.y);
+
+ if (!monitor_src->cursor_bitmap_invalid)
+ {
+ spa_meta_cursor->hotspot.x = 0;
+ spa_meta_cursor->hotspot.y = 0;
+ spa_meta_cursor->bitmap_offset = 0;
+ return;
+ }
+ monitor_src->cursor_bitmap_invalid = FALSE;
+
spa_meta_cursor->bitmap_offset = sizeof (struct spa_meta_cursor);
spa_meta_bitmap = SPA_MEMBER (spa_meta_cursor,
@@ -551,6 +564,7 @@ meta_screen_cast_monitor_stream_src_new (MetaScreenCastMonitorStream *monitor_s
static void
meta_screen_cast_monitor_stream_src_init (MetaScreenCastMonitorStreamSrc *monitor_src)
{
+ monitor_src->cursor_bitmap_invalid = TRUE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]