clapper icon indicating copy to clipboard operation
clapper copied to clipboard

Clapper does not set an opaque region (or unsets it)

Open rmader opened this issue 2 years ago • 4 comments
trafficstars

In short: this is a performance issue that forces compositors like Mutter to do extra work when displaying the app. It can be tested in Gnome-Shell by alt+f2 -> lg -> "Flags" -> "OPAQUE_REGION".

You'll see that the Clapper window will get a purple overlay, while it should have a green one. This might be related to a similar issue in Console. image

Would love to see it fixed :)

Related:

  • https://gitlab.gnome.org/GNOME/gtk/-/issues/5612

rmader avatar Feb 26 '23 14:02 rmader

Hi. Let me start with saying that I haven't tried if this is still an issue in GTK4 (not tested this anymore recently), but this (removing background) was done on purpose. Back then GTK4 renderer did not have any textures overlapping/visibility detection making it redraw background for each video frame. Removing background reduced time spend on GPU draws by almost half making it able to play videos at higher framerates on weak GPUs in especially fullscreen (tested on Atom z3785 tablet). So unless situation changed, the overhead on the GTK4 side (by redrawing fully covered app background for each frame) was much bigger then overhead on the compositor side.

Rafostar avatar Feb 26 '23 18:02 Rafostar

Off, that sounds pretty bad - I couldn't find any gtk issue off-hand, do you recall if this was raised upstream?

rmader avatar Feb 26 '23 18:02 rmader

do you recall if this was raised upstream?

Since I was able to workaround this by setting CSS background to "none", I kinda went with it then. I myself did not report this upstream under assumption that this is just how their renderer works. Did not expect "OPAQUE_REGION" flags to be unset by simply editing CSS :man_shrugging:

I will probably need to check if nowadays this performance problem is still there.

Rafostar avatar Feb 27 '23 20:02 Rafostar

I assume the current behavior will break GtkGraphicsOffload once that is implemented here (or at least make it inefficient), no?

I will try to tackle and test your issue together with implementing GtkGraphicsOffload, which will be next thing to do after #374 is done and merged. Sorry it takes this long, but I have been really busy with reworking Clapper guts for a while.

Rafostar avatar Dec 03 '23 10:12 Rafostar