Merge lp:~3v1n0/gnome-shell/bionic-patches-picks-reorder into lp:~ubuntu-desktop/gnome-shell/ubuntu

Proposed by Marco Trevisan (Treviño)
Status: Merged
Merged at revision: 145
Proposed branch: lp:~3v1n0/gnome-shell/bionic-patches-picks-reorder
Merge into: lp:~ubuntu-desktop/gnome-shell/ubuntu
Diff against target: 243 lines (+168/-25)
4 files modified
debian/changelog (+3/-0)
debian/patches/js-ui-Choose-some-actors-to-cache-on-the-GPU.patch (+133/-0)
debian/patches/series (+6/-3)
debian/patches/ui-Theme-lookup-should-respect-XDG_DATA_DIRS.patch (+26/-22)
To merge this branch: bzr merge lp:~3v1n0/gnome-shell/bionic-patches-picks-reorder
Reviewer Review Type Date Requested Status
Jeremy Bícha Pending
Review via email: mp+343479@code.launchpad.net

Commit message

debian/patches/series: reorder patches, reimport xdg dir patch add GPU caching

Description of the change

Ideally I wanted to put them as first in the list, but then some don't apply anymore, so let's stick to this.

To post a comment you must log in.
146. By Marco Trevisan (Treviño)

debian/patches/ui-Theme-lookup-should-respect-XDG_DATA_DIRS.patch: actually cherry-pick from upstream

147. By Marco Trevisan (Treviño)

debian/patches/js-ui-Choose-some-actors-to-cache-on-the-GPU.patch: include duflu change

Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

In the previous version I didn't properly cherry-picked the XDG dirs support patch

Plus added MP from Daniel

Revision history for this message
Jeremy Bícha (jbicha) wrote :

Sorry, it's late to be adding yet more patches to our patch queue.

The upstream comments on https://bugzilla.gnome.org/792633 were skeptical that this was the right thing to do in gnome-shell master itself. Therefore, I merged the other changes but not the js-ui-Choose-some-actors-to-cache-on-the-GPU.patch and uploaded to bionic now.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2018-04-17 18:21:56 +0000
+++ debian/changelog 2018-04-18 07:28:06 +0000
@@ -30,6 +30,9 @@
30 - Fix possible crash on cache loading30 - Fix possible crash on cache loading
31 * st-texture-cache-Don-t-add-NULL-textures-to-cache.patch:31 * st-texture-cache-Don-t-add-NULL-textures-to-cache.patch:
32 - Fix crash when deleting NULL textures from cache (LP: #1754445)32 - Fix crash when deleting NULL textures from cache (LP: #1754445)
33 * js-ui-Choose-some-actors-to-cache-on-the-GPU.patch:
34 - Improve rendering of shell elements moving rendering to GPU
35 (LP: #1744001)
3336
34 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Tue, 17 Apr 2018 14:40:17 -040037 -- Marco Trevisan (Treviño) <marco@ubuntu.com> Tue, 17 Apr 2018 14:40:17 -0400
3538
3639
=== added file 'debian/patches/js-ui-Choose-some-actors-to-cache-on-the-GPU.patch'
--- debian/patches/js-ui-Choose-some-actors-to-cache-on-the-GPU.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/js-ui-Choose-some-actors-to-cache-on-the-GPU.patch 2018-04-18 07:28:06 +0000
@@ -0,0 +1,133 @@
1From: Daniel van Vugt <daniel.van.vugt@canonical.com>
2Date: Fri, 6 Apr 2018 05:26:58 -0500
3Subject: js/ui: Choose some actors to cache on the GPU
4
5Adds a wrapper function to flag actors that are good candidates for
6caching in texture memory (what Clutter calls "offscreen redirect"),
7thereby mostly eliminating their repaint overhead.
8
9This isn't exactly groundbreaking, it's how you're meant to use
10OpenGL in the first place. But the difficulty is in the design of
11Clutter which has some peculiarities making universal caching
12inefficient at the moment:
13
14 * Repainting an offscreen actor is measurably slower than repainting
15 the same actor if it was uncached. But only by less than 100%,
16 so if an actor can avoid changing every frame then caching is usually
17 more efficient over that timeframe.
18
19 * The cached painting from a container typically includes its children,
20 so you can't cache containers whose children are usually animating at
21 full frame rate. That results in a performance loss.
22 This could be remedied in future by Clutter explicitly separating a
23 container's background painting from its child painting and always
24 caching the background (as StWidget tries to in some cases already).
25
26So this commit selects just a few areas where caching has been verified
27to be beneficial, and many use cases now see their CPU usage halved:
28
29One small window active...... 10% -> 7% (-30%)
30...under a panel menu........ 23% -> 9% (-61%)
31One maximized window active.. 12% -> 9% (-25%)
32...under a panel menu........ 23% -> 11% (-52%)
33...under a shell dialog...... 22% -> 12% (-45%)
34...in activities overview.... 32% -> 17% (-47%)
35(on an i7-7700)
36
37Also a couple of bugs are fixed by this:
38
39https://bugzilla.gnome.org/show_bug.cgi?id=792634
40https://bugzilla.gnome.org/show_bug.cgi?id=792633
41
42Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=792634
43Bug-GNOME: https://bugzilla.gnome.org/show_bug.cgi?id=792633
44Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/1744001
45Forwarded: yes, https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/73
46---
47 js/ui/boxpointer.js | 1 +
48 js/ui/dash.js | 1 +
49 js/ui/dialog.js | 2 ++
50 js/ui/main.js | 16 ++++++++++++++++
51 js/ui/panel.js | 1 +
52 5 files changed, 21 insertions(+)
53
54diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js
55index 47f718a..602646a 100644
56--- a/js/ui/boxpointer.js
57+++ b/js/ui/boxpointer.js
58@@ -44,6 +44,7 @@ var BoxPointer = new Lang.Class({
59 y_fill: true });
60 this._container = new Shell.GenericContainer();
61 this.actor.set_child(this._container);
62+ Main.hintActorSeldomChanges(this.actor);
63 this._container.connect('get-preferred-width', this._getPreferredWidth.bind(this));
64 this._container.connect('get-preferred-height', this._getPreferredHeight.bind(this));
65 this._container.connect('allocate', this._allocate.bind(this));
66diff --git a/js/ui/dash.js b/js/ui/dash.js
67index 5ee2476..14864f1 100644
68--- a/js/ui/dash.js
69+++ b/js/ui/dash.js
70@@ -402,6 +402,7 @@ var Dash = new Lang.Class({
71 clip_to_allocation: true });
72 this._box._delegate = this;
73 this._container.add_actor(this._box);
74+ Main.hintActorSeldomChanges(this._container);
75
76 this._showAppsIcon = new ShowAppsIcon();
77 this._showAppsIcon.childScale = 1;
78diff --git a/js/ui/dialog.js b/js/ui/dialog.js
79index cfa192d..89db963 100644
80--- a/js/ui/dialog.js
81+++ b/js/ui/dialog.js
82@@ -6,6 +6,7 @@ const GObject = imports.gi.GObject;
83 const Pango = imports.gi.Pango;
84 const St = imports.gi.St;
85 const Lang = imports.lang;
86+const Main = imports.ui.main;
87
88 var Dialog = new Lang.Class({
89 Name: 'Dialog',
90@@ -40,6 +41,7 @@ var Dialog = new Lang.Class({
91 // mode accordingly so wrapped labels are handled correctly during
92 // size requests.
93 this._dialog.request_mode = Clutter.RequestMode.HEIGHT_FOR_WIDTH;
94+ Main.hintActorSeldomChanges(this._dialog);
95
96 this.contentLayout = new St.BoxLayout({ vertical: true,
97 style_class: "modal-dialog-content-box" });
98diff --git a/js/ui/main.js b/js/ui/main.js
99index d86cf9e..5277cf7 100644
100--- a/js/ui/main.js
101+++ b/js/ui/main.js
102@@ -716,3 +716,19 @@ function showRestartMessage(message) {
103 let restartMessage = new RestartMessage(message);
104 restartMessage.open();
105 }
106+
107+/**
108+ * hintActorSeldomChanges:
109+ * @actor: A clutter actor
110+ *
111+ * Flag an actor as known to not need repainting very often. Such actors can
112+ * have their painting cached in GPU memory so that future repaints triggered
113+ * by other actors don't incur a repaint of @actor. This can provide dramatic
114+ * performance benefits if used wisely.
115+ *
116+ * This hint needs to be provided manually because clutter presently lacks
117+ * a good enough heuristic to toggle the optimization automatically.
118+ */
119+function hintActorSeldomChanges(actor) {
120+ actor.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);
121+}
122diff --git a/js/ui/panel.js b/js/ui/panel.js
123index 2f59324..2237ead 100644
124--- a/js/ui/panel.js
125+++ b/js/ui/panel.js
126@@ -772,6 +772,7 @@ var Panel = new Lang.Class({
127 this.actor = new Shell.GenericContainer({ name: 'panel',
128 reactive: true });
129 this.actor._delegate = this;
130+ Main.hintActorSeldomChanges(this.actor);
131
132 this._sessionStyle = null;
133
0134
=== modified file 'debian/patches/series'
--- debian/patches/series 2018-04-17 10:25:59 +0000
+++ debian/patches/series 2018-04-18 07:28:06 +0000
@@ -11,16 +11,19 @@
11ubuntu_background_login.patch11ubuntu_background_login.patch
12ubuntu_gdm_alternatives.patch12ubuntu_gdm_alternatives.patch
13ubuntu_block_mode_extension_update.patch13ubuntu_block_mode_extension_update.patch
14# Cherry picks from upstream
14ui-Theme-lookup-should-respect-XDG_DATA_DIRS.patch15ui-Theme-lookup-should-respect-XDG_DATA_DIRS.patch
15workaround_crasher_fractional_scaling.patch
16shell-ignore-invalid-window-monitor-index.patch
17workspaceThumbnail-only-update-_porthole-if-the-overview-.patch16workspaceThumbnail-only-update-_porthole-if-the-overview-.patch
18workspaceThumbnail-rebuild-thumbnails-if-workareas-size-c.patch17workspaceThumbnail-rebuild-thumbnails-if-workareas-size-c.patch
19workspaceThumbnail-initialize-porthole-based-on-workArea.patch18workspaceThumbnail-initialize-porthole-based-on-workArea.patch
20popupMenu-Fix-wrong-call-to-clutter_actor_add_child.patch19popupMenu-Fix-wrong-call-to-clutter_actor_add_child.patch
20volume-Add-back-sound-feedback-on-scroll.patch
21# End of Cherry-picked patches
22workaround_crasher_fractional_scaling.patch
23shell-ignore-invalid-window-monitor-index.patch
21StIcon-only-compute-shadow-pipeline-when-the-texture-is-p.patch24StIcon-only-compute-shadow-pipeline-when-the-texture-is-p.patch
22volume-Add-back-sound-feedback-on-scroll.patch
23js-fix-invalid-access-errors.patch25js-fix-invalid-access-errors.patch
24workspace-fix-repositioned-windows-in-activities.patch26workspace-fix-repositioned-windows-in-activities.patch
25st-texture-cache-Cancel-sliced-image-loading-on-target-ac.patch27st-texture-cache-Cancel-sliced-image-loading-on-target-ac.patch
26st-texture-cache-Don-t-add-NULL-textures-to-cache.patch28st-texture-cache-Don-t-add-NULL-textures-to-cache.patch
29js-ui-Choose-some-actors-to-cache-on-the-GPU.patch
2730
=== modified file 'debian/patches/ui-Theme-lookup-should-respect-XDG_DATA_DIRS.patch'
--- debian/patches/ui-Theme-lookup-should-respect-XDG_DATA_DIRS.patch 2018-04-17 18:09:32 +0000
+++ debian/patches/ui-Theme-lookup-should-respect-XDG_DATA_DIRS.patch 2018-04-18 07:28:06 +0000
@@ -1,34 +1,38 @@
1Description: ui: Theme lookup should respect XDG_DATA_DIRS1From: Didier Roche <didrocks@ubuntu.com>
2 mods, extensions and others GNOME Shell assets lookup into each dir, relative2Date: Fri, 30 Mar 2018 01:44:14 -0600
3 to XDG_DATA_DIRS. However, this isn't the case for themes (which can be3Subject: ui: Theme lookup should respect XDG_DATA_DIRS
4 referenced by a mod in a different XDG_DATA_DIR), hardcoding global.datadir.4
5 The fix is to have the theme finding pattern following the same logic than5Modes, extensions and other GNOME Shell assets are searched in appropriate
6 other elements.6subdirectories of each directory in XDG_DATA_DIRS, falling back
7Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/17600397to global.datadir.
8Forwarded: https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/708However, this isn't the case for themes, which are currently always expected
9Author: Didier Roche <didrocks@ubuntu.com>9in global.datadir, even when referenced by a mode in a different XDG_DATA_DIR.
10
11The fix is to have the theme finding pattern follow the same logic as other
12elements.
13Fixes #167.
14
15Origin: https://gitlab.gnome.org/GNOME/gnome-shell/commit/d6d09fd
16---
17 js/ui/main.js | 8 ++++++++
18 1 file changed, 8 insertions(+)
19
10diff --git a/js/ui/main.js b/js/ui/main.js20diff --git a/js/ui/main.js b/js/ui/main.js
11index 7c1214e0a..99edd28d7 10064421index 2cfe941..d86cf9e 100644
12--- a/js/ui/main.js22--- a/js/ui/main.js
13+++ b/js/ui/main.js23+++ b/js/ui/main.js
14@@ -254,9 +254,14 @@ function _getStylesheet(name) {24@@ -256,6 +256,14 @@ function _getStylesheet(name) {
15 if (stylesheet.query_exists(null))25 if (stylesheet.query_exists(null))
16 return stylesheet;26 return stylesheet;
17 27
18- stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + name);
19- if (stylesheet.query_exists(null))
20- return stylesheet;
21+ let dataDirs = GLib.get_system_data_dirs();28+ let dataDirs = GLib.get_system_data_dirs();
22+ for (let i = 0; i < dataDirs.length; i++) {29+ for (let i = 0; i < dataDirs.length; i++) {
23+ let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);30+ let path = GLib.build_filenamev([dataDirs[i], 'gnome-shell', 'theme', name]);
24+ let stylesheet = Gio.file_new_for_path(path);31+ let stylesheet = Gio.file_new_for_path(path);
25+ if (stylesheet.query_exists(null)) {32+ if (stylesheet.query_exists(null))
26+ return stylesheet;33+ return stylesheet;
27+ }
28+ }34+ }
29 35+
30 return null;36 stylesheet = Gio.File.new_for_path(global.datadir + '/theme/' + name);
31 }37 if (stylesheet.query_exists(null))
32-- 38 return stylesheet;
332.15.1
34

Subscribers

People subscribed via source and target branches