on xenial help sign in
Use a ShaderEffectSource instead of changing Dash parent

Much faster rendering

commitf2fbd5d50320c4a335abecf9fc3b36f7aa14322f authorAlbert Astals <albert.astals@canonical.com> dateWed 30 Jul 2014, 13:26 (12 years ago) parent0707502
1 file changed+20−3
qml/Dash/Dash.qml+20−3
qml/Dash/Dash.qml+20−3
@@ -98,10 +98,12 @@ Showable {
9898 }
9999 onFavoriteSelected: {
100100 setCurrentScope(scopeId, false, false);
101+ dashContentCache.scheduleUpdate();
101102 hide();
102103 }
103104 onAllFavoriteSelected: {
104105 setCurrentScope(scopeId, false, false);
106+ dashContentCache.scheduleUpdate();
105107 animateDashFromAll(dashContent.currentScopeId);
106108 hide();
107109 }
@@ -110,6 +112,7 @@ Showable {
110112 if (scopeIndex >= 0) {
111113 // Is a favorite one
112114 setCurrentScope(scopeId, false, false);
115+ dashContentCache.scheduleUpdate();
113116 showDashFromPos(pos, size);
114117 hide();
115118 } else {
@@ -128,12 +131,23 @@ Showable {
128131 }
129132 }
130133
134+ ShaderEffectSource {
135+ id: dashContentCache
136+ parent: scopesOverview.dashItemEater
137+ z: 1
138+ sourceItem: dashContent
139+ height: sourceItem.height
140+ width: sourceItem.width
141+ opacity: 1 - overviewController.progress
142+ visible: overviewController.progress != 0
143+ live: false
144+ }
145+
131146 DashContent {
132147 id: dashContent
133148
134149 property var scopeThatOpenedScope: null
135150
136− parent: overviewController.progress == 0 ? dash : scopesOverview.dashItemEater
137151 objectName: "dashContent"
138152 width: dash.width
139153 height: dash.height
@@ -174,8 +188,8 @@ Showable {
174188 }
175189 }
176190
177− enabled: opacity == 1
178− opacity: scopesOverview.growingDashFromPos ? 1 : 1 - overviewController.progress
191+ enabled: overviewController.progress == 0
192+ opacity: enabled ? 1 : 0
179193 }
180194
181195 DashBackground
@@ -247,6 +261,9 @@ Showable {
247261 height: units.gu(2)
248262
249263 onSceneDistanceChanged: {
264+ if (overviewController.enableAnimation) {
265+ dashContentCache.scheduleUpdate();
266+ }
250267 overviewController.enableAnimation = false;
251268 overviewController.progress = Math.max(0, Math.min(1, sceneDistance / fullMovement));
252269 }