on xenial help sign in
CardCreator: Remove ShaderEffectSource

Seems we don't really need it (can't see any regression without it) and it fixes the weird flickering of the appstore card when changing departments Fixes: #1544875 Approved by: Josh Arenson

commitb7c493a0f525bde3905b81396eedf2deeec43fb0 authorAlbert Astals Cid <albert.astals@canonical.com> dateWed 27 Apr 2016, 14:59 (10 years ago) parent09963e8f0a35c4
9 files changed+29−92
plugins/Dash/CardCreator.js+4−11 tests/plugins/Dash/cardcreator/1.res+4−11 tests/plugins/Dash/cardcreator/1.res.cardcreator+3−10 tests/plugins/Dash/cardcreator/11.res+3−10 tests/plugins/Dash/cardcreator/11.res.cardcreator+3−10 tests/plugins/Dash/cardcreator/3.res+3−10 tests/plugins/Dash/cardcreator/3.res.cardcreator+3−10 tests/plugins/Dash/cardcreator/5.res+3−10 tests/plugins/Dash/cardcreator/5.res.cardcreator+3−10
plugins/Dash/CardCreator.js+4−11
@@ -62,7 +62,7 @@ var kBackgroundLoaderCode = 'Loader {\n\
6262// %1 is used as anchors of artShapeHolder
6363// %2 is used as image width
6464// %3 is used as image height
65−// %4 is used for artShapeSource.hideSource and inner Loader visible
65+// %4 is whether the image or the Loader with the UbuntuShape/ProportionalShape should be visible
6666// %5 is used as aspect ratio fallback
6767// %6 is whether the loader should be asynchronous or not
6868// %7 is injected as code to artImage
@@ -84,14 +84,6 @@ var kArtShapeHolderCode = 'Item { \n\
8484 objectName: "artShape"; \n\
8585 visible: image.status == Image.Ready; \n\
8686 readonly property alias image: artImage; \n\
87− ShaderEffectSource { \n\
88− id: artShapeSource; \n\
89− sourceItem: artImage; \n\
90− anchors.centerIn: parent; \n\
91− width: 1; \n\
92− height: 1; \n\
93− hideSource: %4; \n\
94− } \n\
9587 Loader { \n\
9688 anchors.fill: parent; \n\
9789 visible: %4; \n\
@@ -99,7 +91,7 @@ var kArtShapeHolderCode = 'Item { \n\
9991 Component { \n\
10092 id: artShapeShapeComponent; \n\
10193 UbuntuShape { \n\
102− source: artShapeSource; \n\
94+ source: artImage; \n\
10395 sourceFillMode: UbuntuShape.PreserveAspectCrop; \n\
10496 radius: "medium"; \n\
10597 aspect: { \n\
@@ -114,7 +106,7 @@ var kArtShapeHolderCode = 'Item { \n\
114106 } \n\
115107 Component { \n\
116108 id: artShapeIconComponent; \n\
117− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; } \n\
109+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; } \n\
118110 } \n\
119111 } \n\
120112 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
@@ -135,6 +127,7 @@ var kArtShapeHolderCode = 'Item { \n\
135127 objectName: "artImage"; \n\
136128 source: artShapeLoader.cardArt; \n\
137129 asynchronous: %6; \n\
130+ visible: !%4; \n\
138131 width: %2; \n\
139132 height: %3; \n\
140133 %7 \n\
tests/plugins/Dash/cardcreator/1.res+4−11
@@ -30,14 +30,6 @@ Item {
3030 objectName: "artShape";
3131 visible: image.status == Image.Ready;
3232 readonly property alias image: artImage;
33− ShaderEffectSource {
34− id: artShapeSource;
35− sourceItem: artImage;
36− anchors.centerIn: parent;
37− width: 1;
38− height: 1;
39− hideSource: true;
40− }
4133 Loader {
4234 anchors.fill: parent;
4335 visible: true;
@@ -45,7 +37,7 @@ Item {
4537 Component {
4638 id: artShapeShapeComponent;
4739 UbuntuShape {
48− source: artShapeSource;
40+ source: artImage;
4941 sourceFillMode: UbuntuShape.PreserveAspectCrop;
5042 radius: "medium";
5143 aspect: {
@@ -60,7 +52,7 @@ Item {
6052 }
6153 Component {
6254 id: artShapeIconComponent;
63− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
55+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
6456 }
6557 }
6658 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -81,7 +73,8 @@ Item {
8173 objectName: "artImage";
8274 source: artShapeLoader.cardArt;
8375 asynchronous: true;
84− width: root.width;
76+ visible: !true;
77+ width: root.width;
8578 height: width / artShape.aspect;
8679 }
8780 }
tests/plugins/Dash/cardcreator/1.res.cardcreator+3−10
@@ -29,14 +29,6 @@ Item {
2929 objectName: "artShape";
3030 visible: image.status == Image.Ready;
3131 readonly property alias image: artImage;
32− ShaderEffectSource {
33− id: artShapeSource;
34− sourceItem: artImage;
35− anchors.centerIn: parent;
36− width: 1;
37− height: 1;
38− hideSource: true;
39− }
4032 Loader {
4133 anchors.fill: parent;
4234 visible: true;
@@ -44,7 +36,7 @@ Item {
4436 Component {
4537 id: artShapeShapeComponent;
4638 UbuntuShape {
47− source: artShapeSource;
39+ source: artImage;
4840 sourceFillMode: UbuntuShape.PreserveAspectCrop;
4941 radius: "medium";
5042 aspect: {
@@ -59,7 +51,7 @@ Item {
5951 }
6052 Component {
6153 id: artShapeIconComponent;
62− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
54+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
6355 }
6456 }
6557 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -80,6 +72,7 @@ Item {
8072 objectName: "artImage";
8173 source: artShapeLoader.cardArt;
8274 asynchronous: false;
75+ visible: !true;
8376 width: root.width;
8477 height: width / artShape.aspect;
8578 }
tests/plugins/Dash/cardcreator/11.res+3−10
@@ -68,14 +68,6 @@ Item {
6868 objectName: "artShape";
6969 visible: image.status == Image.Ready;
7070 readonly property alias image: artImage;
71− ShaderEffectSource {
72− id: artShapeSource;
73− sourceItem: artImage;
74− anchors.centerIn: parent;
75− width: 1;
76− height: 1;
77− hideSource: true;
78− }
7971 Loader {
8072 anchors.fill: parent;
8173 visible: true;
@@ -83,7 +75,7 @@ Item {
8375 Component {
8476 id: artShapeShapeComponent;
8577 UbuntuShape {
86− source: artShapeSource;
78+ source: artImage;
8779 sourceFillMode: UbuntuShape.PreserveAspectCrop;
8880 radius: "medium";
8981 aspect: {
@@ -98,7 +90,7 @@ Item {
9890 }
9991 Component {
10092 id: artShapeIconComponent;
101− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
93+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
10294 }
10395 }
10496 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -119,6 +111,7 @@ Item {
119111 objectName: "artImage";
120112 source: artShapeLoader.cardArt;
121113 asynchronous: true;
114+ visible: !true;
122115 width: root.width;
123116 height: width / artShape.aspect;
124117 onStatusChanged: if (status === Image.Error) source = decodeURI("%5C");
tests/plugins/Dash/cardcreator/11.res.cardcreator+3−10
@@ -67,14 +67,6 @@ Item {
6767 objectName: "artShape";
6868 visible: image.status == Image.Ready;
6969 readonly property alias image: artImage;
70− ShaderEffectSource {
71− id: artShapeSource;
72− sourceItem: artImage;
73− anchors.centerIn: parent;
74− width: 1;
75− height: 1;
76− hideSource: true;
77− }
7870 Loader {
7971 anchors.fill: parent;
8072 visible: true;
@@ -82,7 +74,7 @@ Item {
8274 Component {
8375 id: artShapeShapeComponent;
8476 UbuntuShape {
85− source: artShapeSource;
77+ source: artImage;
8678 sourceFillMode: UbuntuShape.PreserveAspectCrop;
8779 radius: "medium";
8880 aspect: {
@@ -97,7 +89,7 @@ Item {
9789 }
9890 Component {
9991 id: artShapeIconComponent;
100− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
92+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
10193 }
10294 }
10395 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -118,6 +110,7 @@ Item {
118110 objectName: "artImage";
119111 source: artShapeLoader.cardArt;
120112 asynchronous: false;
113+ visible: !true;
121114 width: root.width;
122115 height: width / artShape.aspect;
123116 }
tests/plugins/Dash/cardcreator/3.res+3−10
@@ -30,14 +30,6 @@ Item {
3030 objectName: "artShape";
3131 visible: image.status == Image.Ready;
3232 readonly property alias image: artImage;
33− ShaderEffectSource {
34− id: artShapeSource;
35− sourceItem: artImage;
36− anchors.centerIn: parent;
37− width: 1;
38− height: 1;
39− hideSource: true;
40− }
4133 Loader {
4234 anchors.fill: parent;
4335 visible: true;
@@ -45,7 +37,7 @@ Item {
4537 Component {
4638 id: artShapeShapeComponent;
4739 UbuntuShape {
48− source: artShapeSource;
40+ source: artImage;
4941 sourceFillMode: UbuntuShape.PreserveAspectCrop;
5042 radius: "medium";
5143 aspect: {
@@ -60,7 +52,7 @@ Item {
6052 }
6153 Component {
6254 id: artShapeIconComponent;
63− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
55+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
6456 }
6557 }
6658 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -81,6 +73,7 @@ Item {
8173 objectName: "artImage";
8274 source: artShapeLoader.cardArt;
8375 asynchronous: true;
76+ visible: !true;
8477 width: root.width;
8578 height: width / artShape.aspect;
8679 onStatusChanged: if (status === Image.Error) source = decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
tests/plugins/Dash/cardcreator/3.res.cardcreator+3−10
@@ -29,14 +29,6 @@ Item {
2929 objectName: "artShape";
3030 visible: image.status == Image.Ready;
3131 readonly property alias image: artImage;
32− ShaderEffectSource {
33− id: artShapeSource;
34− sourceItem: artImage;
35− anchors.centerIn: parent;
36− width: 1;
37− height: 1;
38− hideSource: true;
39− }
4032 Loader {
4133 anchors.fill: parent;
4234 visible: true;
@@ -44,7 +36,7 @@ Item {
4436 Component {
4537 id: artShapeShapeComponent;
4638 UbuntuShape {
47− source: artShapeSource;
39+ source: artImage;
4840 sourceFillMode: UbuntuShape.PreserveAspectCrop;
4941 radius: "medium";
5042 aspect: {
@@ -59,7 +51,7 @@ Item {
5951 }
6052 Component {
6153 id: artShapeIconComponent;
62− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
54+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
6355 }
6456 }
6557 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -80,6 +72,7 @@ Item {
8072 objectName: "artImage";
8173 source: artShapeLoader.cardArt;
8274 asynchronous: false;
75+ visible: !true;
8376 width: root.width;
8477 height: width / artShape.aspect;
8578 }
tests/plugins/Dash/cardcreator/5.res+3−10
@@ -30,14 +30,6 @@ Item {
3030 objectName: "artShape";
3131 visible: image.status == Image.Ready;
3232 readonly property alias image: artImage;
33− ShaderEffectSource {
34− id: artShapeSource;
35− sourceItem: artImage;
36− anchors.centerIn: parent;
37− width: 1;
38− height: 1;
39− hideSource: false;
40− }
4133 Loader {
4234 anchors.fill: parent;
4335 visible: false;
@@ -45,7 +37,7 @@ Item {
4537 Component {
4638 id: artShapeShapeComponent;
4739 UbuntuShape {
48− source: artShapeSource;
40+ source: artImage;
4941 sourceFillMode: UbuntuShape.PreserveAspectCrop;
5042 radius: "medium";
5143 aspect: {
@@ -60,7 +52,7 @@ Item {
6052 }
6153 Component {
6254 id: artShapeIconComponent;
63− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
55+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
6456 }
6557 }
6658 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -81,6 +73,7 @@ Item {
8173 objectName: "artImage";
8274 source: artShapeLoader.cardArt;
8375 asynchronous: true;
76+ visible: !false;
8477 width: root.width;
8578 height: width / artShape.aspect;
8679 }
tests/plugins/Dash/cardcreator/5.res.cardcreator+3−10
@@ -29,14 +29,6 @@ Item {
2929 objectName: "artShape";
3030 visible: image.status == Image.Ready;
3131 readonly property alias image: artImage;
32− ShaderEffectSource {
33− id: artShapeSource;
34− sourceItem: artImage;
35− anchors.centerIn: parent;
36− width: 1;
37− height: 1;
38− hideSource: false;
39− }
4032 Loader {
4133 anchors.fill: parent;
4234 visible: false;
@@ -44,7 +36,7 @@ Item {
4436 Component {
4537 id: artShapeShapeComponent;
4638 UbuntuShape {
47− source: artShapeSource;
39+ source: artImage;
4840 sourceFillMode: UbuntuShape.PreserveAspectCrop;
4941 radius: "medium";
5042 aspect: {
@@ -59,7 +51,7 @@ Item {
5951 }
6052 Component {
6153 id: artShapeIconComponent;
62− ProportionalShape { source: artShapeSource; aspect: UbuntuShape.DropShadow; }
54+ ProportionalShape { source: artImage; aspect: UbuntuShape.DropShadow; }
6355 }
6456 }
6557 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
@@ -80,6 +72,7 @@ Item {
8072 objectName: "artImage";
8173 source: artShapeLoader.cardArt;
8274 asynchronous: false;
75+ visible: !false;
8376 width: root.width;
8477 height: width / artShape.aspect;
8578 }