From d45f351aafd87aa6ea99da3a3f37762784add240 Mon Sep 17 00:00:00 2001 From: totaam Date: Wed, 29 Mar 2023 22:59:27 +0700 Subject: [PATCH] #3796 show paint stats on window info --- xpra/client/gtk_base/window_info.py | 3 ++- xpra/client/gui/window_backing_base.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/xpra/client/gtk_base/window_info.py b/xpra/client/gtk_base/window_info.py index 4227477ba3..d143b61cba 100644 --- a/xpra/client/gtk_base/window_info.py +++ b/xpra/client/gtk_base/window_info.py @@ -255,7 +255,7 @@ def pv(value): if isinstance(value, (tuple, list)): return csv(value) if isinstance(value, dict): - return dict_to_str(dict((k,v) for k,v in value.items() if k in ("type", "encoding", )), ", ", ":") + return dict_to_str(value, ", ", ":") return str(value) def dict_to_str(d, sep="\n", eq="=", exclude=()): strdict = dict((k,pv(v)) for k,v in d.items() if k not in exclude) @@ -268,6 +268,7 @@ def dict_to_str(d, sep="\n", eq="=", exclude=()): "fps", "mmap", "type", + "bit-depth", ) )) else: diff --git a/xpra/client/gui/window_backing_base.py b/xpra/client/gui/window_backing_base.py index ab95ca3e77..b3a767bfb5 100644 --- a/xpra/client/gui/window_backing_base.py +++ b/xpra/client/gui/window_backing_base.py @@ -168,10 +168,14 @@ def __init__(self, wid : int, window_alpha : bool): self.fps_buffer_update_time = 0 self.fps_value = 0 self.fps_refresh_timer = 0 + self.paint_stats = {} def idle_add(self, *_args, **_kwargs): raise NotImplementedError() + def recpaint(self, encoding): + self.paint_stats[encoding] = self.paint_stats.get(encoding, 0) + 1 + def get_rgb_formats(self): if self._alpha_enabled: return self.RGB_MODES @@ -188,6 +192,7 @@ def get_info(self): "render-size" : self.render_size, "offsets" : self.offsets, "fps" : self.fps_value, + "paint" : self.paint_stats, } vd = self._video_decoder if vd: @@ -879,6 +884,7 @@ def paint_scroll(self, img_data, options, callbacks): def draw_region(self, x, y, width, height, coding, img_data, rowstride, options, callbacks): """ dispatches the paint to one of the paint_XXXX methods """ + self.recpaint(coding) try: assert self._backing is not None log("draw_region(%s, %s, %s, %s, %s, %s bytes, %s, %s, %s)",