Flag some actors that are good candidates for caching in texture memory
(what Clutter calls "offscreen redirect"), thereby mostly eliminating
their repaint overhead.
This isn't exactly groundbreaking, it's how you're meant to use
OpenGL in the first place. But the difficulty is in the design of
Clutter which has some peculiarities making universal caching
inefficient at the moment:
* Repainting an offscreen actor is measurably slower than repainting
the same actor if it was uncached. But only by less than 100%,
so if an actor can avoid changing every frame then caching is usually
more efficient over that timeframe.
* The cached painting from a container typically includes its children,
so you can't cache containers whose children are usually animating at
full frame rate. That results in a performance loss.
This could be remedied in future by Clutter explicitly separating a
container's background painting from its child painting and always
caching the background (as StWidget tries to in some cases already).
So this commit selects just a few areas where caching has been verified
to be beneficial, and many use cases now see their CPU usage halved:
One small window active...... 10% -> 7% (-30%)
...under a panel menu........ 23% -> 9% (-61%)
One maximized window active.. 12% -> 9% (-25%)
...under a panel menu........ 23% -> 11% (-52%)
...under a shell dialog...... 22% -> 12% (-45%)
...in activities overview.... 32% -> 17% (-47%)
(on an i7-7700)
Also a couple of bugs are fixed by this:
https://bugzilla.gnome.org/show_bug.cgi?id=792634https://bugzilla.gnome.org/show_bug.cgi?id=792633
When not using arrow notation with anonymous functions, we use Lang.bind()
to bind `this` to named callbacks. However since ES5, this functionality
is already provided by Function.prototype.bind() - in fact, Lang.bind()
itself uses it when no extra arguments are specified. Just use the built-in
function directly where possible, and use arrow notation in the few places
where we pass additional arguments.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
Since 0b02f757f8 we track the button that should have key focus
when the dialog is opened. However when the dialog is reused, the
button may get destroyed - clear the initial focus in that case to
allow setButton() to set a new one.
https://bugzilla.gnome.org/show_bug.cgi?id=788542
Commit 1c7a3ee61b broke setting the initial key focus for default
buttons added via addButton(). Fix this by allowing the dialog class
to provide a different default widget to ModalDialog than the entire
dialog itself.
https://bugzilla.gnome.org/show_bug.cgi?id=788282
Any symbols (including class properties) that should be visible
outside the module it's defined in need to be defined as global.
For now gjs still allows the access for 'const', but get rid of
the warnings spill now by changing it.
https://bugzilla.gnome.org/show_bug.cgi?id=785084
A lot of our modal dialogs share a similar structure:
[Icon] Some title
Maybe a subtitle
And sometimes even a body for stuff like
longer descriptions.
A dedicated widget with a common style will allow us to significantly
reduce duplication of both code and CSS.
https://bugzilla.gnome.org/show_bug.cgi?id=784985
This is the basic dialog actor implementation, which will allow us to
use the same implementation on the session-global modal dialogs. The
ModalDialog class now uses it underneath, and so do all users of it.
https://bugzilla.gnome.org/show_bug.cgi?id=762083