Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-shape-texture-ref-counting into lp:ubuntu-ui-toolkit

Proposed by Michał Sawicz
Status: Merged
Merged at revision: 1342
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-shape-texture-ref-counting
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 1250 lines (+404/-190)
41 files modified
components.api (+6/-0)
export_qml_dir.sh (+2/-0)
src/Ubuntu/Components/1.3/AdaptivePageLayout.qml (+3/-0)
src/Ubuntu/Components/1.3/PageHeader.qml (+2/-1)
src/Ubuntu/Components/1.3/TextArea.qml (+3/-4)
src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml (+1/-0)
src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml (+50/-0)
src/Ubuntu/Components/Styles/Styles.pro (+1/-3)
src/Ubuntu/Components/Styles/qmldir (+1/-0)
src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.2/ProgressionVisualStyle.qml (+2/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+10/-0)
src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressionVisualStyle.qml (+1/-1)
src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml (+2/-2)
src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml (+16/-30)
src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml (+6/-0)
src/Ubuntu/Components/Themes/ThemesModule.pro (+0/-3)
src/Ubuntu/Components/plugin/plugin.pri (+2/-1)
src/Ubuntu/Components/plugin/ucabstractbutton.cpp (+0/-3)
src/Ubuntu/Components/plugin/ucperformancemonitor.cpp (+24/-6)
src/Ubuntu/Components/plugin/ucubuntushape.cpp (+77/-90)
src/Ubuntu/Components/plugin/ucubuntushape.h (+7/-2)
src/Ubuntu/Components/plugin/ucubuntushapetextures.cpp (+5/-11)
src/Ubuntu/Components/plugin/ucubuntushapetextures.h (+17/-0)
tests/unit/add_qmlmakecheck.pri (+1/-1)
tests/unit/add_qmlmakecheck_x11.pri (+1/-1)
tests/unit/i18n/LocalizedApp/LocalizedApp.pro (+0/-1)
tests/unit/i18n/RelativeTime/RelativeTime.pro (+0/-1)
tests/unit/mainview/mainview.pro (+0/-2)
tests/unit/page/page.pro (+0/-2)
tests/unit/performance/TextArea13Grid.qml (+33/-0)
tests/unit/performance/tst_performance.cpp (+1/-0)
tests/unit/runtest.sh (+20/-15)
tests/unit/visual/gallery.qml (+78/-0)
tests/unit/visual/gallery.sh (+6/-0)
tests/unit/visual/tst_pageheader.qml (+2/-1)
tests/unit/visual/tst_picker13.qml (+1/-0)
tests/unit/visual/tst_popups_dialog13.qml (+13/-0)
tests/xvfb.sh (+7/-4)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-shape-texture-ref-counting
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu SDK team Pending
Review via email: mp+292397@code.launchpad.net

Commit message

[UbuntuShape] Use reference counting to handle shape textures.

The current shape textures handling system requires to search for the textures associated to the current graphics context by doing a search in an array for each item at each updatePaintNode() call. It also deletes the textures on OpenGLContext::aboutToBeDestroyed() signal emission, which appears in some cases to not have any OpenGL context bound.

We propose an alternative to create and destroy shape textures per material creation and destruction with a reference counting mechanism to minimise costly calls. We search for the shape textures (hash lookup with an OpenGL context pointer as the key) only when a texture material is created or deleted, which is much more occasional compared to updatePaintNode() calls. That also ensures textures are deleted with the proper OpenGL context bound.

The only drawback is that shape textures are deleted when there is no shape items anymore in a scene and recreated when there is a new one appearing. These operations being quite uncommon and relatively fast, the advantages seem to be higher than the drawbacks.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
1846. By Loïc Molinari

Merged lp:ubuntu-ui-toolkit/staging.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2016-05-20 17:33:56 +0000
+++ components.api 2016-06-16 09:57:10 +0000
@@ -1076,6 +1076,12 @@
1076 property list<Action> actions1076 property list<Action> actions
1077 property var model1077 property var model
1078 property int selectedIndex1078 property int selectedIndex
1079Ubuntu.Components.Styles.SectionsStyle 1.3: Item
1080 property color pressedBackgroundColor
1081 property color sectionColor
1082 property color selectedSectionColor
1083 property int textSize
1084 property color underlineColor
1079Ubuntu.Components.ServiceProperties 1.1 UCServiceProperties: QtObject1085Ubuntu.Components.ServiceProperties 1.1 UCServiceProperties: QtObject
1080 property string adaptorInterface 1.11086 property string adaptorInterface 1.1
1081 readonly property string error 1.11087 readonly property string error 1.1
10821088
=== modified file 'export_qml_dir.sh'
--- export_qml_dir.sh 2016-04-05 16:14:13 +0000
+++ export_qml_dir.sh 2016-06-16 09:57:10 +0000
@@ -28,6 +28,8 @@
28export LD_LIBRARY_PATH=$BUILD_DIR/lib:$UBUNTU_QML_DIRS$LD_LIBRARY_PATH28export LD_LIBRARY_PATH=$BUILD_DIR/lib:$UBUNTU_QML_DIRS$LD_LIBRARY_PATH
29# Build machines may not have initctl and don't need it29# Build machines may not have initctl and don't need it
30test -f /sbin/initctl || return 030test -f /sbin/initctl || return 0
31# initctl may be available but not working (for example in a lxd container without upstart)
32/sbin/initctl list > /dev/null || return 0
31/sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml33/sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml
32/sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml34/sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml
33/sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml35/sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
3436
=== modified file 'src/Ubuntu/Components/1.3/AdaptivePageLayout.qml'
--- src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-05-25 12:48:10 +0000
+++ src/Ubuntu/Components/1.3/AdaptivePageLayout.qml 2016-06-16 09:57:10 +0000
@@ -827,6 +827,9 @@
827 property color panelColor: layout.__propagated.header.panelColor827 property color panelColor: layout.__propagated.header.panelColor
828 property color backgroundColor: layout.__propagated.header.backgroundColor828 property color backgroundColor: layout.__propagated.header.backgroundColor
829829
830 // Enable red outline in the PageHeadStyle. See bug #1583636.
831 property bool showDeprecatedWarning: true
832
830 visible: !customHeader && holder.pageWrapper && holder.pageWrapper.active833 visible: !customHeader && holder.pageWrapper && holder.pageWrapper.active
831834
832 // The multiColumn, page and showBackButton properties are used in835 // The multiColumn, page and showBackButton properties are used in
833836
=== modified file 'src/Ubuntu/Components/1.3/PageHeader.qml'
--- src/Ubuntu/Components/1.3/PageHeader.qml 2016-05-25 12:48:10 +0000
+++ src/Ubuntu/Components/1.3/PageHeader.qml 2016-06-16 09:57:10 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2015 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
@@ -109,6 +109,7 @@
109 property Item previousContentsParent: null109 property Item previousContentsParent: null
110110
111 function updateContents() {111 function updateContents() {
112 if (!__styleInstance) return; // the style needs to be loaded first
112 if (previousContents) {113 if (previousContents) {
113 previousContents.parent = previousContentsParent;114 previousContents.parent = previousContentsParent;
114 }115 }
115116
=== modified file 'src/Ubuntu/Components/1.3/TextArea.qml'
--- src/Ubuntu/Components/1.3/TextArea.qml 2016-05-25 12:48:10 +0000
+++ src/Ubuntu/Components/1.3/TextArea.qml 2016-06-16 09:57:10 +0000
@@ -875,6 +875,9 @@
875 }875 }
876 }876 }
877 }877 }
878
879 /*! \internal */
880 property Item __rightScrollbar: rightScrollbar
878 Scrollbar {881 Scrollbar {
879 id: rightScrollbar882 id: rightScrollbar
880 flickableItem: flicker883 flickableItem: flicker
@@ -884,10 +887,6 @@
884 anchors.topMargin: -internal.frameSpacing887 anchors.topMargin: -internal.frameSpacing
885 anchors.rightMargin: -internal.frameSpacing888 anchors.rightMargin: -internal.frameSpacing
886 anchors.bottomMargin: -internal.frameSpacing889 anchors.bottomMargin: -internal.frameSpacing
887 Ubuntu.StyleHints {
888 // No background color
889 troughColorSteppersStyle: Qt.rgba(0, 0, 0, 0)
890 }
891 }890 }
892891
893 styleName: "TextAreaStyle"892 styleName: "TextAreaStyle"
894893
=== modified file 'src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml'
--- src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml 2015-09-22 14:39:47 +0000
+++ src/Ubuntu/Components/Styles/1.3/PageHeadStyle.qml 2016-06-16 09:57:10 +0000
@@ -17,6 +17,7 @@
1717
18/*!18/*!
19 \qmltype PageHeadStyle19 \qmltype PageHeadStyle
20 \deprecated
20 \inqmlmodule Ubuntu.Components.Styles 1.121 \inqmlmodule Ubuntu.Components.Styles 1.1
21 \ingroup style-api22 \ingroup style-api
22 \brief Style API for page header.23 \brief Style API for page header.
2324
=== added file 'src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml'
--- src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/Styles/1.3/SectionsStyle.qml 2016-06-16 09:57:10 +0000
@@ -0,0 +1,50 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16import QtQuick 2.4
17/*!
18 \qmltype SectionsStyle
19 \inqmlmodule Ubuntu.Components.Styles 1.3
20 \ingroup style-api
21 \brief Style API for Sections.
22
23 The component defines the style API for the \l Sections component.
24 */
25Item {
26 /*!
27 The foreground color of unselected sections.
28 */
29 property color sectionColor
30
31 /*!
32 The foreground color of underline of unselected sections.
33 */
34 property color underlineColor
35
36 /*!
37 The foreground color of the selected section.
38 */
39 property color selectedSectionColor
40
41 /*!
42 The background color for the pressed section button.
43 */
44 property color pressedBackgroundColor
45
46 /*!
47 The size of text in the buttons.
48 */
49 property int textSize
50}
051
=== modified file 'src/Ubuntu/Components/Styles/Styles.pro'
--- src/Ubuntu/Components/Styles/Styles.pro 2015-11-24 20:49:07 +0000
+++ src/Ubuntu/Components/Styles/Styles.pro 2016-06-16 09:57:10 +0000
@@ -1,7 +1,5 @@
1TARGETPATH = Ubuntu/Components/Styles1TARGETPATH = Ubuntu/Components/Styles
22
3ARTWORK_FILES = $$system(find artwork -type f)
4
5QML_FILES += 1.2/ComboButtonStyle.qml \3QML_FILES += 1.2/ComboButtonStyle.qml \
6 1.2/PageHeadStyle.qml \4 1.2/PageHeadStyle.qml \
7 1.2/PullToRefreshStyle.qml \5 1.2/PullToRefreshStyle.qml \
@@ -9,7 +7,7 @@
9 1.3/ActionBarStyle.qml \7 1.3/ActionBarStyle.qml \
10 1.3/PageHeaderStyle.qml \8 1.3/PageHeaderStyle.qml \
11 1.3/ToolbarStyle.qml \9 1.3/ToolbarStyle.qml \
12 $$ARTWORK_FILES10 1.3/SectionsStyle.qml \
1311
14load(ubuntu_qml_module)12load(ubuntu_qml_module)
1513
1614
=== modified file 'src/Ubuntu/Components/Styles/qmldir'
--- src/Ubuntu/Components/Styles/qmldir 2015-11-24 20:49:07 +0000
+++ src/Ubuntu/Components/Styles/qmldir 2016-06-16 09:57:10 +0000
@@ -9,3 +9,4 @@
9ActionBarStyle 1.3 1.3/ActionBarStyle.qml9ActionBarStyle 1.3 1.3/ActionBarStyle.qml
10PageHeaderStyle 1.3 1.3/PageHeaderStyle.qml10PageHeaderStyle 1.3 1.3/PageHeaderStyle.qml
11ToolbarStyle 1.3 1.3/ToolbarStyle.qml11ToolbarStyle 1.3 1.3/ToolbarStyle.qml
12SectionsStyle 1.3 1.3/SectionsStyle.qml
1213
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml 2015-04-24 14:43:08 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.2/PageHeadButton.qml 2016-06-16 09:57:10 +0000
@@ -43,7 +43,7 @@
43 // when the button is invisible by setting width and height to 043 // when the button is invisible by setting width and height to 0
44 width: visible ? button.iconWidth : 044 width: visible ? button.iconWidth : 0
45 height: visible ? button.iconHeight : 045 height: visible ? button.iconHeight : 0
46 source: button.iconSource46 source: visible ? button.iconSource : ""
47 color: Qt.rgba(0, 0, 0, 0)47 color: Qt.rgba(0, 0, 0, 0)
48 opacity: button.enabled ? 1.0 : 0.348 opacity: button.enabled ? 1.0 : 0.3
49 }49 }
5050
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.2/ProgressionVisualStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.2/ProgressionVisualStyle.qml 2015-04-24 14:52:19 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.2/ProgressionVisualStyle.qml 2016-06-16 09:57:10 +0000
@@ -27,7 +27,7 @@
2727
28 Image {28 Image {
29 id: progressIcon29 id: progressIcon
30 source: progressionIconSource30 source: visible ? progressionIconSource : ""
31 anchors {31 anchors {
32 verticalCenter: parent.verticalCenter32 verticalCenter: parent.verticalCenter
33 right: parent.right33 right: parent.right
@@ -46,7 +46,7 @@
46 right: progressIcon.left46 right: progressIcon.left
47 rightMargin: styledItem.splitMargin47 rightMargin: styledItem.splitMargin
48 }48 }
49 source: progressionDividerSource49 source: visible ? progressionDividerSource : ""
50 opacity: enabled ? 1.0 : 0.550 opacity: enabled ? 1.0 : 0.5
51 }51 }
52}52}
5353
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml 2015-09-21 14:44:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadButton.qml 2016-06-16 09:57:10 +0000
@@ -44,7 +44,7 @@
44 // when the button is invisible by setting width and height to 044 // when the button is invisible by setting width and height to 0
45 width: visible ? button.iconWidth : 045 width: visible ? button.iconWidth : 0
46 height: visible ? button.iconHeight : 046 height: visible ? button.iconHeight : 0
47 source: button.iconSource47 source: visible ? button.iconSource : ""
48 color: Qt.rgba(0, 0, 0, 0)48 color: Qt.rgba(0, 0, 0, 0)
49 opacity: button.enabled ? 1.0 : 0.349 opacity: button.enabled ? 1.0 : 0.3
50 }50 }
5151
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-02-29 16:02:50 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml 2016-06-16 09:57:10 +0000
@@ -50,8 +50,18 @@
50 */50 */
51 property color backgroundColor: styledItem.backgroundColor51 property color backgroundColor: styledItem.backgroundColor
52 Rectangle {52 Rectangle {
53 id: background
53 anchors.fill: parent54 anchors.fill: parent
54 color: headerStyle.backgroundColor55 color: headerStyle.backgroundColor
56
57 // The border is shown to warn the developer that the AppHeader
58 // is deprecated. See bug #1583636
59 property bool showBorder: styledItem.hasOwnProperty("showDeprecatedWarning") &&
60 styledItem.showDeprecatedWarning
61 border {
62 width: background.showBorder ? units.gu(0.5) : 0
63 color: background.showBorder ? UbuntuColors.red : "transparent"
64 }
55 }65 }
5666
57 // FIXME: When the three panel color properties below are removed,67 // FIXME: When the three panel color properties below are removed,
5868
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-05-06 08:53:16 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/PageHeaderStyle.qml 2016-06-16 09:57:10 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2015 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
66
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressionVisualStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressionVisualStyle.qml 2015-04-25 07:36:13 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ProgressionVisualStyle.qml 2016-06-16 09:57:10 +0000
@@ -46,7 +46,7 @@
46 right: progressIcon.left46 right: progressIcon.left
47 rightMargin: styledItem.splitMargin47 rightMargin: styledItem.splitMargin
48 }48 }
49 source: progressionDividerSource49 source: visible ? progressionDividerSource : ""
50 opacity: enabled ? 1.0 : 0.550 opacity: enabled ? 1.0 : 0.5
51 }51 }
52}52}
5353
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2016-04-22 03:43:33 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/ScrollbarStyle.qml 2016-06-16 09:57:10 +0000
@@ -939,7 +939,7 @@
939 anchors.centerIn: parent939 anchors.centerIn: parent
940 width: __stepperAssetWidth940 width: __stepperAssetWidth
941 rotation: isVertical ? 180 : 90941 rotation: isVertical ? 180 : 90
942 source: Qt.resolvedUrl("../artwork/toolkit_scrollbar-stepper.svg")942 source: visible ? Qt.resolvedUrl("../artwork/toolkit_scrollbar-stepper.svg") : ""
943 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,943 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,
944 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtBeginning])944 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtBeginning])
945 ? __stepperImgOpacityDisabled945 ? __stepperImgOpacityDisabled
@@ -982,7 +982,7 @@
982 anchors.centerIn: parent982 anchors.centerIn: parent
983 width: __stepperAssetWidth983 width: __stepperAssetWidth
984 rotation: isVertical ? 0 : -90984 rotation: isVertical ? 0 : -90
985 source: Qt.resolvedUrl("../artwork/toolkit_scrollbar-stepper.svg")985 source: visible ? Qt.resolvedUrl("../artwork/toolkit_scrollbar-stepper.svg") : ""
986 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,986 color: Qt.rgba(sliderColor.r, sliderColor.g, sliderColor.b,
987 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtEnd])987 sliderColor.a * ((flickableItem && flickableItem[scrollbarUtils.propAtEnd])
988 ? __stepperImgOpacityDisabled988 ? __stepperImgOpacityDisabled
989989
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-05-17 13:00:51 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/SectionsStyle.qml 2016-06-16 09:57:10 +0000
@@ -15,44 +15,30 @@
15 */15 */
16import QtQuick 2.416import QtQuick 2.4
17import QtQuick.Window 2.217import QtQuick.Window 2.2
18import QtGraphicalEffects 1.0
18import Ubuntu.Components 1.319import Ubuntu.Components 1.3
19import QtGraphicalEffects 1.0
20import Ubuntu.Components.Private 1.320import Ubuntu.Components.Private 1.3
21import Ubuntu.Components.Styles 1.3 as Style
2122
22Item {23Style.SectionsStyle {
23 id: sectionsStyle24 id: sectionsStyle
2425
25 implicitWidth: sectionsListView.contentWidth + 2 * listViewContainer.listViewMargins26 implicitWidth: sectionsListView.contentWidth + 2 * listViewContainer.listViewMargins
26 implicitHeight: Screen.height > units.gu(50) ? units.gu(4) : units.gu(3)27 implicitHeight: Screen.height > units.gu(50) ? units.gu(4) : units.gu(3)
2728
28 /*!29 sectionColor: enabled
29 The foreground color of unselected sections.30 ? theme.palette.normal.backgroundTertiaryText
30 */31 : theme.palette.disabled.backgroundTertiaryText
31 property color sectionColor: enabled32
32 ? theme.palette.normal.backgroundTertiaryText33 underlineColor: theme.palette.normal.base
33 : theme.palette.disabled.backgroundTertiaryText34
3435 selectedSectionColor: enabled
35 /*!36 ? theme.palette.selected.positionText
36 The foreground color of underline rectangle of unselected sections.37 : theme.palette.selectedDisabled.positionText
37 */38
38 property color underlineColor: theme.palette.normal.base39 pressedBackgroundColor: theme.palette.highlighted.background
3940
40 /*!41 textSize: Label.Medium
41 The foreground color of the selected section.
42 */
43 property color selectedSectionColor: enabled
44 ? theme.palette.selected.positionText
45 : theme.palette.selectedDisabled.positionText
46
47 /*!
48 The background color for the pressed section button.
49 */
50 property color pressedBackgroundColor: theme.palette.highlighted.background
51
52 /*!
53 The size of text in the buttons.
54 */
55 property int textSize: Label.Medium
5642
57 /*!43 /*!
58 The spacing on the left and right sides of the label44 The spacing on the left and right sides of the label
5945
=== modified file 'src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml'
--- src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-05-10 12:08:32 +0000
+++ src/Ubuntu/Components/Themes/Ambiance/1.3/TextAreaStyle.qml 2016-06-16 09:57:10 +0000
@@ -76,6 +76,12 @@
76 radius: units.gu(1.7)76 radius: units.gu(1.7)
77 backgroundColor: visuals.backgroundColor77 backgroundColor: visuals.backgroundColor
78 aspect: UbuntuShape.Flat78 aspect: UbuntuShape.Flat
79 source: ShaderEffectSource {
80 sourceItem: styledItem.__rightScrollbar ? styledItem.__rightScrollbar : null
81 hideSource: true
82 }
83 sourceFillMode: UbuntuShape.Pad
84 sourceHorizontalAlignment: UbuntuShape.AlignRight
79 }85 }
80 }86 }
8187
8288
=== modified file 'src/Ubuntu/Components/Themes/ThemesModule.pro'
--- src/Ubuntu/Components/Themes/ThemesModule.pro 2015-05-19 09:23:01 +0000
+++ src/Ubuntu/Components/Themes/ThemesModule.pro 2016-06-16 09:57:10 +0000
@@ -1,12 +1,9 @@
1TARGETPATH = Ubuntu/Components/Themes1TARGETPATH = Ubuntu/Components/Themes
22
33
4ARTWORK_FILES = $$system(find artwork -type f)
5
6QML_FILES += 1.2/Palette.qml \4QML_FILES += 1.2/Palette.qml \
7 1.2/PaletteValues.qml \5 1.2/PaletteValues.qml \
8 1.3/Palette.qml \6 1.3/Palette.qml \
9 1.3/PaletteValues.qml \7 1.3/PaletteValues.qml \
10 $$ARTWORK_FILES
118
12load(ubuntu_qml_module)9load(ubuntu_qml_module)
1310
=== modified file 'src/Ubuntu/Components/plugin/plugin.pri'
--- src/Ubuntu/Components/plugin/plugin.pri 2016-06-02 12:50:02 +0000
+++ src/Ubuntu/Components/plugin/plugin.pri 2016-06-16 09:57:10 +0000
@@ -28,7 +28,7 @@
28 $$PWD/ucunits.h \28 $$PWD/ucunits.h \
29 $$PWD/ucqquickimageextension.h \29 $$PWD/ucqquickimageextension.h \
30 $$PWD/quickutils.h \30 $$PWD/quickutils.h \
31 $$PWD/ucubuntushapetexture.h \31 $$PWD/ucubuntushapetextures.h \
32 $$PWD/ucubuntushape.h \32 $$PWD/ucubuntushape.h \
33 $$PWD/ucubuntushapeoverlay.h \33 $$PWD/ucubuntushapeoverlay.h \
34 $$PWD/ucproportionalshape.h \34 $$PWD/ucproportionalshape.h \
@@ -126,6 +126,7 @@
126 $$PWD/ucunits.cpp \126 $$PWD/ucunits.cpp \
127 $$PWD/ucqquickimageextension.cpp \127 $$PWD/ucqquickimageextension.cpp \
128 $$PWD/quickutils.cpp \128 $$PWD/quickutils.cpp \
129 $$PWD/ucubuntushapetextures.cpp \
129 $$PWD/ucubuntushape.cpp \130 $$PWD/ucubuntushape.cpp \
130 $$PWD/ucubuntushapeoverlay.cpp \131 $$PWD/ucubuntushapeoverlay.cpp \
131 $$PWD/ucproportionalshape.cpp \132 $$PWD/ucproportionalshape.cpp \
132133
=== modified file 'src/Ubuntu/Components/plugin/ucabstractbutton.cpp'
--- src/Ubuntu/Components/plugin/ucabstractbutton.cpp 2016-05-30 09:48:54 +0000
+++ src/Ubuntu/Components/plugin/ucabstractbutton.cpp 2016-06-16 09:57:10 +0000
@@ -129,9 +129,6 @@
129{129{
130 UCActionItem::classBegin();130 UCActionItem::classBegin();
131131
132 // make sure we have the haptics set up!
133 HapticsProxy::instance()->initialize();
134
135 // set up mouse area132 // set up mouse area
136 Q_D(UCAbstractButton);133 Q_D(UCAbstractButton);
137 QQml_setParent_noEvent(d->mouseArea, this);134 QQml_setParent_noEvent(d->mouseArea, this);
138135
=== modified file 'src/Ubuntu/Components/plugin/ucperformancemonitor.cpp'
--- src/Ubuntu/Components/plugin/ucperformancemonitor.cpp 2016-03-15 13:46:27 +0000
+++ src/Ubuntu/Components/plugin/ucperformancemonitor.cpp 2016-06-16 09:57:10 +0000
@@ -21,10 +21,23 @@
2121
22Q_LOGGING_CATEGORY(ucPerformance, "[PERFORMANCE]")22Q_LOGGING_CATEGORY(ucPerformance, "[PERFORMANCE]")
2323
24const int singleFrameThreshold = 32;24static int singleFrameThreshold = 32;
25const int multipleFrameThreshold = 17;25static int multipleFrameThreshold = 17;
26const int framesCountThreshold = 10;26static int framesCountThreshold = 10;
27const int warningCountThreshold = 30;27static int warningCountThreshold = 30;
28
29// TODO Qt 5.5. switch to qEnvironmentVariableIntValue
30static int getenvInt(const char* name, int defaultValue)
31{
32 if (qEnvironmentVariableIsSet(name)) {
33 QByteArray stringValue = qgetenv(name);
34 bool ok;
35 int value = stringValue.toFloat(&ok);
36 return ok ? value : defaultValue;
37 } else {
38 return defaultValue;
39 }
40}
2841
29UCPerformanceMonitor::UCPerformanceMonitor(QObject* parent) :42UCPerformanceMonitor::UCPerformanceMonitor(QObject* parent) :
30 QObject(parent),43 QObject(parent),
@@ -34,6 +47,11 @@
34{47{
35 QObject::connect((QGuiApplication*)QGuiApplication::instance(), &QGuiApplication::applicationStateChanged,48 QObject::connect((QGuiApplication*)QGuiApplication::instance(), &QGuiApplication::applicationStateChanged,
36 this, &UCPerformanceMonitor::onApplicationStateChanged);49 this, &UCPerformanceMonitor::onApplicationStateChanged);
50
51 singleFrameThreshold = getenvInt("UC_PERFORMANCE_MONITOR_SINGLE_FRAME_THRESHOLD", singleFrameThreshold);
52 multipleFrameThreshold = getenvInt("UC_PERFORMANCE_MONITOR_MULTIPLE_FRAME_THRESHOLD", multipleFrameThreshold);
53 framesCountThreshold = getenvInt("UC_PERFORMANCE_MONITOR_FRAMES_COUNT_THRESHOLD", framesCountThreshold);
54 warningCountThreshold = getenvInt("UC_PERFORMANCE_MONITOR_WARNING_COUNT_THRESHOLD", warningCountThreshold);
37}55}
3856
39UCPerformanceMonitor::~UCPerformanceMonitor()57UCPerformanceMonitor::~UCPerformanceMonitor()
@@ -53,7 +71,7 @@
5371
54void UCPerformanceMonitor::onApplicationStateChanged(Qt::ApplicationState state)72void UCPerformanceMonitor::onApplicationStateChanged(Qt::ApplicationState state)
55{73{
56 if (m_warningCount >= warningCountThreshold) {74 if (m_warningCount >= warningCountThreshold && warningCountThreshold != -1) {
57 // do not monitor performance if the warning count threshold was reached75 // do not monitor performance if the warning count threshold was reached
58 return;76 return;
59 }77 }
@@ -124,7 +142,7 @@
124 m_framesAboveThreshold = 0;142 m_framesAboveThreshold = 0;
125 }143 }
126144
127 if (m_warningCount >= warningCountThreshold) {145 if (m_warningCount >= warningCountThreshold && warningCountThreshold != -1) {
128 qCWarning(ucPerformance, "Too many warnings were given. Performance monitoring stops.");146 qCWarning(ucPerformance, "Too many warnings were given. Performance monitoring stops.");
129 connectToWindow(NULL);147 connectToWindow(NULL);
130 }148 }
131149
=== modified file 'src/Ubuntu/Components/plugin/ucubuntushape.cpp'
--- src/Ubuntu/Components/plugin/ucubuntushape.cpp 2016-05-25 12:48:10 +0000
+++ src/Ubuntu/Components/plugin/ucubuntushape.cpp 2016-06-16 09:57:10 +0000
@@ -26,7 +26,6 @@
26// evaluated.26// evaluated.
2727
28#include "ucubuntushape.h"28#include "ucubuntushape.h"
29#include "ucubuntushapetexture.h"
30#include "ucunits.h"29#include "ucunits.h"
31#include "ucnamespace.h"30#include "ucnamespace.h"
32#include <QtCore/QPointer>31#include <QtCore/QPointer>
@@ -90,10 +89,11 @@
90{89{
91 Q_UNUSED(oldEffect);90 Q_UNUSED(oldEffect);
9291
93 const ShapeMaterial::Data* data = static_cast<ShapeMaterial*>(newEffect)->constData();92 ShapeMaterial* material = static_cast<ShapeMaterial*>(newEffect);
93 const ShapeMaterial::Data* data = material->constData();
9494
95 // Bind shape texture.95 // Bind shape texture.
96 glBindTexture(GL_TEXTURE_2D, data->shapeTextureId);96 glBindTexture(GL_TEXTURE_2D, material->textureIds()[data->shapeTextureIndex]);
9797
98 // Bind source texture on the 2nd texture unit and update uniforms.98 // Bind source texture on the 2nd texture unit and update uniforms.
99 bool textured = false;99 bool textured = false;
@@ -151,12 +151,82 @@
151151
152// --- Scene graph material ---152// --- Scene graph material ---
153153
154// Create and setup shape textures.
155static void createShapeTextures(QOpenGLContext* openglContext, quint32* ids)
156{
157 glGenTextures(shapeTextureCount, ids);
158
159 if (UCUbuntuShape::useDistanceFields(openglContext)) {
160 // Create distance field textures.
161 for (int i = 0; i < shapeTextureCount; i++) {
162 glBindTexture(GL_TEXTURE_2D, ids[i]);
163 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
164 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
165 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
166 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
167 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, shapeTextureWidth, shapeTextureHeight, 0,
168 GL_RGBA, GL_UNSIGNED_BYTE, shapeTextureData[i]);
169 }
170 } else {
171 // Create mipmap textures.
172 for (int i = 0; i < shapeTextureCount; i++) {
173 glBindTexture(GL_TEXTURE_2D, ids[i]);
174 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
175 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
176 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
177 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
178 for (int j = 0; j < shapeTextureMipmapCount; j++) {
179 glTexImage2D(GL_TEXTURE_2D, j, GL_RGBA, shapeTextureMipmapWidth >> j,
180 shapeTextureMipmapHeight >> j, 0, GL_RGBA, GL_UNSIGNED_BYTE,
181 &shapeTextureMipmapData[i][shapeTextureMipmapOffset[j]]);
182 }
183 }
184 }
185}
186
187class ShapeTextures {
188public:
189 ShapeTextures() : m_refCount(0) {}
190 quint32* ids() { return m_ids; }
191 quint32 ref() { Q_ASSERT(m_refCount < UINT_MAX); return ++m_refCount; }
192 quint32 unref() { Q_ASSERT(m_refCount > 0); return --m_refCount; }
193private:
194 quint32 m_refCount;
195 quint32 m_ids[shapeTextureCount];
196};
197
198static QHash<QOpenGLContext*, ShapeTextures> shapeTexturesHash;
199static QMutex shapeTexturesHashMutex;
200
154ShapeMaterial::ShapeMaterial()201ShapeMaterial::ShapeMaterial()
155{202{
156 // The whole struct (with the padding bytes) must be initialized for memcmp() to work as203 // The whole struct (with the padding bytes) must be initialized for memcmp() to work as
157 // expected in ShapeMaterial::compare().204 // expected in ShapeMaterial::compare().
158 memset(&m_data, 0x00, sizeof(Data));205 memset(&m_data, 0x00, sizeof(Data));
159 setFlag(Blending);206 setFlag(Blending);
207
208 // Get or create the set of textures associated with the current context. We assume that QtQuick
209 // associates the same graphics context to a material for its entire lifetime.
210 QOpenGLContext* context = QOpenGLContext::currentContext();
211 shapeTexturesHashMutex.lock();
212 ShapeTextures& textures = shapeTexturesHash[context];
213 if (textures.ref() == 1) {
214 createShapeTextures(context, textures.ids());
215 }
216 memcpy(m_shapeTexturesId, textures.ids(), shapeTextureCount * sizeof(quint32));
217 shapeTexturesHashMutex.unlock();
218}
219
220ShapeMaterial::~ShapeMaterial()
221{
222 shapeTexturesHashMutex.lock();
223 auto it = shapeTexturesHash.find(QOpenGLContext::currentContext());
224 Q_ASSERT(it != shapeTexturesHash.end());
225 if (it.value().unref() == 0) {
226 glDeleteTextures(shapeTextureCount, it.value().ids());
227 shapeTexturesHash.erase(it);
228 }
229 shapeTexturesHashMutex.unlock();
160}230}
161231
162QSGMaterialType* ShapeMaterial::type() const232QSGMaterialType* ShapeMaterial::type() const
@@ -246,12 +316,6 @@
246const float implicitWidthGU = 8.0f;316const float implicitWidthGU = 8.0f;
247const float implicitHeightGU = 8.0f;317const float implicitHeightGU = 8.0f;
248const float radiusGuMap[3] = { 1.45f, 2.55f, 3.65f };318const float radiusGuMap[3] = { 1.45f, 2.55f, 3.65f };
249const int maxShapeTextures = 16;
250
251static struct { QOpenGLContext* openglContext; quint32 textureId[shapeTextureCount]; }
252 shapeTextures[maxShapeTextures];
253
254static int getShapeTexturesIndex(const QOpenGLContext* openglContext);
255319
256/*! \qmltype UbuntuShape320/*! \qmltype UbuntuShape
257 \instantiates UCUbuntuShape321 \instantiates UCUbuntuShape
@@ -1041,67 +1105,6 @@
1041 m_flags |= DirtySourceTransform;1105 m_flags |= DirtySourceTransform;
1042}1106}
10431107
1044// Gets the shapeTextures' slot used by the given context, or -1 if not stored.
1045static int getShapeTexturesIndex(const QOpenGLContext* openglContext)
1046{
1047 int index = 0;
1048 while (shapeTextures[index].openglContext != openglContext) {
1049 index++;
1050 if (index == maxShapeTextures) {
1051 return -1;
1052 }
1053 }
1054 return index;
1055}
1056
1057// Gets an empty shapeTextures' slot.
1058static int getEmptyShapeTexturesIndex()
1059{
1060 int index = 0;
1061 while (shapeTextures[index].openglContext) {
1062 index++;
1063 if (index == maxShapeTextures) {
1064 // Don't bother with a dynamic array, let's just set a high enough maxShapeTextures and
1065 // increase the static array size if ever needed.
1066 qFatal("reached maximum number of OpenGL contexts supported by UbuntuShape");
1067 }
1068 }
1069 return index;
1070}
1071
1072// Create and setup shape textures.
1073static void createShapeTextures(QOpenGLContext* openglContext, int index)
1074{
1075 glGenTextures(shapeTextureCount, shapeTextures[index].textureId);
1076
1077 if (UCUbuntuShape::useDistanceFields(openglContext)) {
1078 // Create distance field textures.
1079 for (int i = 0; i < shapeTextureCount; i++) {
1080 glBindTexture(GL_TEXTURE_2D, shapeTextures[index].textureId[i]);
1081 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
1082 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
1083 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
1084 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
1085 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, shapeTextureWidth, shapeTextureHeight, 0,
1086 GL_RGBA, GL_UNSIGNED_BYTE, shapeTextureData[i]);
1087 }
1088 } else {
1089 // Create mipmap textures.
1090 for (int i = 0; i < shapeTextureCount; i++) {
1091 glBindTexture(GL_TEXTURE_2D, shapeTextures[index].textureId[i]);
1092 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
1093 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
1094 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
1095 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR_MIPMAP_LINEAR);
1096 for (int j = 0; j < shapeTextureMipmapCount; j++) {
1097 glTexImage2D(GL_TEXTURE_2D, j, GL_RGBA, shapeTextureMipmapWidth >> j,
1098 shapeTextureMipmapHeight >> j, 0, GL_RGBA, GL_UNSIGNED_BYTE,
1099 &shapeTextureMipmapData[i][shapeTextureMipmapOffset[j]]);
1100 }
1101 }
1102 }
1103}
1104
1105// Gets the nearest boundary to coord in the texel grid of the given size.1108// Gets the nearest boundary to coord in the texel grid of the given size.
1106static Q_DECL_CONSTEXPR float roundTextureCoord(float coord, float size)1109static Q_DECL_CONSTEXPR float roundTextureCoord(float coord, float size)
1107{1110{
@@ -1182,22 +1185,6 @@
1182 QSGNode* node = oldNode ? oldNode : createSceneGraphNode();1185 QSGNode* node = oldNode ? oldNode : createSceneGraphNode();
1183 Q_ASSERT(node);1186 Q_ASSERT(node);
11841187
1185 // Get or create the shape texture that's stored per context and shared by all the shape items.
1186 Q_ASSERT(window());
1187 QOpenGLContext* openglContext = window()->openglContext();
1188 Q_ASSERT(openglContext);
1189 int index = getShapeTexturesIndex(openglContext);
1190 if (index < 0) {
1191 index = getEmptyShapeTexturesIndex();
1192 shapeTextures[index].openglContext = openglContext;
1193 createShapeTextures(openglContext, index);
1194 connect(openglContext, &QOpenGLContext::aboutToBeDestroyed, [index] {
1195 shapeTextures[index].openglContext = NULL;
1196 glDeleteTextures(shapeTextureCount, shapeTextures[index].textureId);
1197 } );
1198 }
1199 const quint32 shapeTextureId = shapeTextures[index].textureId[m_aspect != DropShadow ? 0 : 1];
1200
1201 // Get the source texture info and update the source transform if needed.1188 // Get the source texture info and update the source transform if needed.
1202 QSGTextureProvider* provider = m_source ? m_source->textureProvider() : NULL;1189 QSGTextureProvider* provider = m_source ? m_source->textureProvider() : NULL;
1203 QSGTexture* sourceTexture = provider ? provider->texture() : NULL;1190 QSGTexture* sourceTexture = provider ? provider->texture() : NULL;
@@ -1256,7 +1243,7 @@
1256 / qGuiApp->devicePixelRatio();1243 / qGuiApp->devicePixelRatio();
1257 }1244 }
12581245
1259 updateMaterial(node, radius, shapeTextureId, sourceTexture && m_sourceOpacity);1246 updateMaterial(node, radius, m_aspect != DropShadow ? 0 : 1, sourceTexture && m_sourceOpacity);
12601247
1261 // Get the affine transformation for the source texture coordinates.1248 // Get the affine transformation for the source texture coordinates.
1262 const QVector4D sourceCoordTransform(1249 const QVector4D sourceCoordTransform(
@@ -1312,12 +1299,12 @@
1312}1299}
13131300
1314void UCUbuntuShape::updateMaterial(1301void UCUbuntuShape::updateMaterial(
1315 QSGNode* node, float radius, quint32 shapeTextureId, bool textured)1302 QSGNode* node, float radius, quint8 shapeTextureIndex, bool textured)
1316{1303{
1317 ShapeMaterial::Data* materialData = static_cast<ShapeNode*>(node)->material()->data();1304 ShapeMaterial::Data* materialData = static_cast<ShapeNode*>(node)->material()->data();
1318 quint8 flags = 0;1305 quint8 flags = 0;
13191306
1320 materialData->shapeTextureId = shapeTextureId;1307 materialData->shapeTextureIndex = shapeTextureIndex;
1321 if (textured) {1308 if (textured) {
1322 materialData->sourceTextureProvider = m_sourceTextureProvider;1309 materialData->sourceTextureProvider = m_sourceTextureProvider;
1323 materialData->sourceOpacity = m_sourceOpacity;1310 materialData->sourceOpacity = m_sourceOpacity;
@@ -1364,7 +1351,7 @@
1364 const QVector4D& sourceCoordTransform, const QVector4D& sourceMaskTransform,1351 const QVector4D& sourceCoordTransform, const QVector4D& sourceMaskTransform,
1365 const quint32 backgroundColor[3])1352 const quint32 backgroundColor[3])
1366{1353{
1367 // Used by subclasses, using the shapeTextureInfo.offset constant directly allows slightly1354 // Used by subclasses, using the shapeTextureOffset constant directly allows slightly
1368 // better optimization here.1355 // better optimization here.
1369 Q_UNUSED(shapeOffset);1356 Q_UNUSED(shapeOffset);
13701357
13711358
=== modified file 'src/Ubuntu/Components/plugin/ucubuntushape.h'
--- src/Ubuntu/Components/plugin/ucubuntushape.h 2016-04-28 11:19:46 +0000
+++ src/Ubuntu/Components/plugin/ucubuntushape.h 2016-06-16 09:57:10 +0000
@@ -23,6 +23,7 @@
23#include <QtQuick/QSGNode>23#include <QtQuick/QSGNode>
24#include <QtQuick/qsgmaterial.h>24#include <QtQuick/qsgmaterial.h>
25#include <QtGui/QOpenGLFunctions>25#include <QtGui/QOpenGLFunctions>
26#include "ucubuntushapetextures.h"
26#include "ucimportversionchecker_p.h"27#include "ucimportversionchecker_p.h"
2728
28// --- Scene graph shader ---29// --- Scene graph shader ---
@@ -66,22 +67,25 @@
66 Pressed = (1 << 6)67 Pressed = (1 << 6)
67 };68 };
68 QSGTextureProvider* sourceTextureProvider;69 QSGTextureProvider* sourceTextureProvider;
69 quint32 shapeTextureId;70 quint8 shapeTextureIndex;
70 quint8 distanceAAFactor;71 quint8 distanceAAFactor;
71 quint8 sourceOpacity;72 quint8 sourceOpacity;
72 quint8 flags;73 quint8 flags;
73 };74 };
7475
75 ShapeMaterial();76 ShapeMaterial();
77 ~ShapeMaterial();
76 QSGMaterialType* type() const override;78 QSGMaterialType* type() const override;
77 QSGMaterialShader* createShader() const override;79 QSGMaterialShader* createShader() const override;
78 int compare(const QSGMaterial* other) const override;80 int compare(const QSGMaterial* other) const override;
79 virtual void updateTextures();81 virtual void updateTextures();
80 const Data* constData() const { return &m_data; }82 const Data* constData() const { return &m_data; }
81 Data* data() { return &m_data; }83 Data* data() { return &m_data; }
84 quint32* textureIds() { return m_shapeTexturesId; }
8285
83private:86private:
84 Data m_data;87 Data m_data;
88 quint32 m_shapeTexturesId[shapeTextureCount];
85};89};
8690
87// --- Scene graph node ---91// --- Scene graph node ---
@@ -293,7 +297,8 @@
293297
294 // Virtual functions for extended shapes.298 // Virtual functions for extended shapes.
295 virtual QSGNode* createSceneGraphNode() const;299 virtual QSGNode* createSceneGraphNode() const;
296 virtual void updateMaterial(QSGNode* node, float radius, quint32 shapeTextureId, bool textured);300 virtual void updateMaterial(
301 QSGNode* node, float radius, quint8 shapeTextureIndex, bool textured);
297 virtual void updateGeometry(302 virtual void updateGeometry(
298 QSGNode* node, const QSizeF& itemSize, float radius, float shapeOffset,303 QSGNode* node, const QSizeF& itemSize, float radius, float shapeOffset,
299 const QVector4D& sourceCoordTransform, const QVector4D& sourceMaskTransform,304 const QVector4D& sourceCoordTransform, const QVector4D& sourceMaskTransform,
300305
=== renamed file 'src/Ubuntu/Components/plugin/ucubuntushapetexture.h' => 'src/Ubuntu/Components/plugin/ucubuntushapetextures.cpp'
--- src/Ubuntu/Components/plugin/ucubuntushapetexture.h 2015-10-12 17:20:30 +0000
+++ src/Ubuntu/Components/plugin/ucubuntushapetextures.cpp 2016-06-16 09:57:10 +0000
@@ -1,12 +1,9 @@
1// Copyright 2015 Canonical Ltd.1// Copyright 2015 Canonical Ltd.
2// Automatically generated by the createshapetextures tool.2// Automatically generated by the createshapetextures tool.
33
4const int shapeTextureCount = 2;4#include "ucubuntushapetextures.h"
5const int shapeTextureWidth = 32;5
6const int shapeTextureHeight = 32;6const unsigned char shapeTextureData[2][4097] = {
7const float shapeTextureOffset = 0.0625;
8const int shapeTextureDistanceAA = 4;
9static const unsigned char shapeTextureData[2][4097] = {
10 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"7 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"
11 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"8 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"
12 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x06\x00"9 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x06\x00"
@@ -522,13 +519,10 @@
522 "\xff\xff\xcc\x00\xff\xff\xcc\x00\xff\xff\xcc\x00\xff\xff\xcc\x00"519 "\xff\xff\xcc\x00\xff\xff\xcc\x00\xff\xff\xcc\x00\xff\xff\xcc\x00"
523};520};
524521
525const int shapeTextureMipmapWidth = 256;522const int shapeTextureMipmapOffset[9] = {
526const int shapeTextureMipmapHeight = 256;
527const int shapeTextureMipmapCount = 9;
528static const int shapeTextureMipmapOffset[9] = {
529 0, 262144, 327680, 344064, 348160, 349184, 349440, 349504, 349520523 0, 262144, 327680, 344064, 348160, 349184, 349440, 349504, 349520
530};524};
531static const unsigned char shapeTextureMipmapData[2][349525] = {525const unsigned char shapeTextureMipmapData[2][349525] = {
532 // Mipmap level 0.526 // Mipmap level 0.
533 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"527 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"
534 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"528 "\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00\x5e\x5e\x00\x00"
535529
=== added file 'src/Ubuntu/Components/plugin/ucubuntushapetextures.h'
--- src/Ubuntu/Components/plugin/ucubuntushapetextures.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/ucubuntushapetextures.h 2016-06-16 09:57:10 +0000
@@ -0,0 +1,17 @@
1// Copyright 2015 Canonical Ltd.
2// Automatically generated by the createshapetextures tool.
3
4const int shapeTextureCount = 2;
5const int shapeTextureWidth = 32;
6const int shapeTextureHeight = 32;
7const float shapeTextureOffset = 0.0625;
8const int shapeTextureDistanceAA = 4;
9
10extern const unsigned char shapeTextureData[2][4097];
11
12const int shapeTextureMipmapWidth = 256;
13const int shapeTextureMipmapHeight = 256;
14const int shapeTextureMipmapCount = 9;
15
16extern const int shapeTextureMipmapOffset[9];
17extern const unsigned char shapeTextureMipmapData[2][349525];
018
=== modified file 'tests/unit/add_qmlmakecheck.pri'
--- tests/unit/add_qmlmakecheck.pri 2016-02-08 09:33:08 +0000
+++ tests/unit/add_qmlmakecheck.pri 2016-06-16 09:57:10 +0000
@@ -7,7 +7,7 @@
7for(TEST, TESTS) {7for(TEST, TESTS) {
8 _uitk_command = cd $$_PRO_FILE_PWD_;8 _uitk_command = cd $$_PRO_FILE_PWD_;
9 _uitk_command += env UITK_TEST_KEEP_RUNNING=19 _uitk_command += env UITK_TEST_KEEP_RUNNING=1
10 _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${TEST}" minimal';10 _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${_PRO_FILE_PWD_}/$${TEST}" minimal';
1111
12 check.commands += $${_uitk_command}12 check.commands += $${_uitk_command}
1313
1414
=== modified file 'tests/unit/add_qmlmakecheck_x11.pri'
--- tests/unit/add_qmlmakecheck_x11.pri 2016-05-30 15:14:42 +0000
+++ tests/unit/add_qmlmakecheck_x11.pri 2016-06-16 09:57:10 +0000
@@ -10,7 +10,7 @@
10 for(TEST, TESTS) {10 for(TEST, TESTS) {
11 _uitk_command = cd $$_PRO_FILE_PWD_;11 _uitk_command = cd $$_PRO_FILE_PWD_;
12 _uitk_command += env UITK_TEST_KEEP_RUNNING=112 _uitk_command += env UITK_TEST_KEEP_RUNNING=1
13 _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${TEST}"';13 _uitk_command += '$${ROOT_SOURCE_DIR}/tests/unit/runtest.sh "$$shadowed($$_PRO_FILE_PWD_)/$${TARGET}" "$${_PRO_FILE_PWD_}/$${TEST}"';
1414
15 check.commands += $${_uitk_command}15 check.commands += $${_uitk_command}
1616
1717
=== modified file 'tests/unit/i18n/LocalizedApp/LocalizedApp.pro'
--- tests/unit/i18n/LocalizedApp/LocalizedApp.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/i18n/LocalizedApp/LocalizedApp.pro 2016-06-16 09:57:10 +0000
@@ -5,7 +5,6 @@
5DOMAIN = localizedApp5DOMAIN = localizedApp
6mo.target = mo6mo.target = mo
7mo.commands = set -e;7mo.commands = set -e;
8mo.commands += echo Generating localization;
9mo.commands += msgfmt $$PWD/po/en_US.po -o $$PWD/$${DOMAIN}/share/locale/en/LC_MESSAGES/$${DOMAIN}.mo;8mo.commands += msgfmt $$PWD/po/en_US.po -o $$PWD/$${DOMAIN}/share/locale/en/LC_MESSAGES/$${DOMAIN}.mo;
10QMAKE_EXTRA_TARGETS += mo9QMAKE_EXTRA_TARGETS += mo
11PRE_TARGETDEPS += mo10PRE_TARGETDEPS += mo
1211
=== modified file 'tests/unit/i18n/RelativeTime/RelativeTime.pro'
--- tests/unit/i18n/RelativeTime/RelativeTime.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/i18n/RelativeTime/RelativeTime.pro 2016-06-16 09:57:10 +0000
@@ -5,7 +5,6 @@
5DOMAIN = ubuntu-ui-toolkit5DOMAIN = ubuntu-ui-toolkit
6mo.target = mo6mo.target = mo
7mo.commands = set -e;7mo.commands = set -e;
8mo.commands += echo Generating localization;
9mo.commands += msgfmt $${PWD}/po/en_US.po -o $${PWD}/$${DOMAIN}/share/locale/en/LC_MESSAGES/$${DOMAIN}.mo;8mo.commands += msgfmt $${PWD}/po/en_US.po -o $${PWD}/$${DOMAIN}/share/locale/en/LC_MESSAGES/$${DOMAIN}.mo;
10QMAKE_EXTRA_TARGETS += mo9QMAKE_EXTRA_TARGETS += mo
11PRE_TARGETDEPS += mo10PRE_TARGETDEPS += mo
1211
=== modified file 'tests/unit/mainview/mainview.pro'
--- tests/unit/mainview/mainview.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/mainview/mainview.pro 2016-06-16 09:57:10 +0000
@@ -2,5 +2,3 @@
22
3QT += gui3QT += gui
4SOURCES += tst_mainview.cpp4SOURCES += tst_mainview.cpp
5
6OTHER_FILES += $$system(ls tst_*.qml)
75
=== modified file 'tests/unit/page/page.pro'
--- tests/unit/page/page.pro 2016-05-31 09:02:35 +0000
+++ tests/unit/page/page.pro 2016-06-16 09:57:10 +0000
@@ -2,5 +2,3 @@
22
3QT += gui3QT += gui
4SOURCES += tst_page.cpp4SOURCES += tst_page.cpp
5
6OTHER_FILES += $$system(ls tst_*.qml)
75
=== added file 'tests/unit/performance/TextArea13Grid.qml'
--- tests/unit/performance/TextArea13Grid.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/performance/TextArea13Grid.qml 2016-06-16 09:57:10 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.0
18import Ubuntu.Components 1.3
19
20Grid {
21 width: units.gu(80)
22 height: units.gu(60)
23 rows: 16
24 columns: 16
25
26 Repeater {
27 model: 16 * 16
28
29 TextField {
30 text: i18n.tr("Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.")
31 }
32 }
33}
034
=== modified file 'tests/unit/performance/tst_performance.cpp'
--- tests/unit/performance/tst_performance.cpp 2015-12-07 22:16:52 +0000
+++ tests/unit/performance/tst_performance.cpp 2016-06-16 09:57:10 +0000
@@ -102,6 +102,7 @@
102 QTest::addColumn<QString>("document");102 QTest::addColumn<QString>("document");
103 QTest::addColumn<QUrl>("theme");103 QTest::addColumn<QUrl>("theme");
104104
105 QTest::newRow("TextArea 1.3") << "TextArea13Grid.qml" << QUrl();
105 QTest::newRow("AbstractButton 1.2") << "AbstractButtonGrid.qml" << QUrl();106 QTest::newRow("AbstractButton 1.2") << "AbstractButtonGrid.qml" << QUrl();
106 QTest::newRow("AbstractButton 1.3") << "AbstractButton13Grid.qml" << QUrl();107 QTest::newRow("AbstractButton 1.3") << "AbstractButton13Grid.qml" << QUrl();
107 QTest::newRow("grid with Rectangle") << "RectangleGrid.qml" << QUrl();108 QTest::newRow("grid with Rectangle") << "RectangleGrid.qml" << QUrl();
108109
=== modified file 'tests/unit/runtest.sh'
--- tests/unit/runtest.sh 2016-06-01 09:48:44 +0000
+++ tests/unit/runtest.sh 2016-06-16 09:57:10 +0000
@@ -43,14 +43,14 @@
43 echo " $0 TEST_EXECUTABLE [QML_FILE] [QT_QPA_PLATFORM]"43 echo " $0 TEST_EXECUTABLE [QML_FILE] [QT_QPA_PLATFORM]"
44 echo ''44 echo ''
45 echo 'Examples:'45 echo 'Examples:'
46 echo " $0 $(relpath ${BUILD_DIR}/tests/unit/components/components) tst_label13.qml minimal"46 echo " $0 $(relpath ${BUILD_DIR}/tests/unit/components/components) $(relpath ${SRC_DIR}/tests/unit/components/tst_label13.qml) minimal"
47 echo ''47 echo ''
48 echo " cd $(relpath ${BUILD_DIR}/tests/unit/mainview)"48 echo " cd $(relpath ${BUILD_DIR}/tests/unit/mainview)"
49 echo " ../$(basename $0) mainview minimal"49 echo " ../$(basename $0) mainview minimal"
50 echo " cd ../../.."50 echo " cd ../../.."
51 echo ''51 echo ''
52 echo " cd $(relpath ${BUILD_DIR}/tests/unit/visual)"52 echo " cd $(relpath ${BUILD_DIR}/tests/unit/visual)"
53 echo " ../../xvfb.sh ../../unit/$(basename $0) visual tst_listitem13.qml"53 echo " ../../xvfb.sh ../../unit/$(basename $0) visual ../../unit/visual/tst_listitem13.qml"
54 echo " cd ../../.."54 echo " cd ../../.."
55 echo ''55 echo ''
56 echo " $(relpath ${BUILD_DIR}/tests/xvfb.sh) $0 $(relpath ${BUILD_DIR}/tests/unit/bottomedge/bottomedge)"56 echo " $(relpath ${BUILD_DIR}/tests/xvfb.sh) $0 $(relpath ${BUILD_DIR}/tests/unit/bottomedge/bottomedge)"
@@ -74,20 +74,26 @@
74EOF74EOF
75}75}
7676
77function abspath {
78 if [[ "$1" = /* ]]; then
79 ABSPATH=$1
80 else
81 ABSPATH=./$1
82 fi
83 # Note: '|| echo' so we get a sane error message if it doesn't exist
84 echo -n $(readlink -f $ABSPATH || echo $ABSPATH)
85}
86
77function create_test_cmd {87function create_test_cmd {
78 if [[ "$_TARGETPATH" = /* ]]; then88 EXE=$(abspath $_TARGETPATH)
79 EXE=$_TARGETPATH
80 else
81 EXE=./$_TARGETPATH
82 fi
83 _CMD="-n $_TESTFILE -m 500"89 _CMD="-n $_TESTFILE -m 500"
8490
85 DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)91 DEB_HOST_ARCH=$(dpkg-architecture -qDEB_HOST_ARCH)
86 if [[ ${DEB_HOST_ARCH} =~ 'arm' ]]; then92 if [[ ${DEB_HOST_ARCH} =~ 'arm' ]]; then
87 _CMD="dbus-test-runner --task $(readlink -f $EXE) $_CMD"93 _CMD="dbus-test-runner --task $EXE $_CMD"
88 else94 else
89 _CMD="dbus-test-runner --task gdb -p --quiet $_CMD"95 _CMD="dbus-test-runner --task gdb -p --quiet $_CMD"
90 _CMD="$_CMD -p --batch -p -ex -p 'set print thread-events off' -p -ex -p run -p -ex -p bt -p --return-child-result -p --args -p $(readlink -f $EXE)"96 _CMD="$_CMD -p --batch -p -ex -p 'set print thread-events off' -p -ex -p run -p -ex -p bt -p --return-child-result -p --args -p $EXE"
91 fi97 fi
9298
93 if [[ 'minimal custom' == *$_MINIMAL* ]]; then99 if [[ 'minimal custom' == *$_MINIMAL* ]]; then
@@ -95,27 +101,26 @@
95 fi101 fi
96102
97 if [[ $_TESTFILEPATH == *\.qml* ]]; then103 if [[ $_TESTFILEPATH == *\.qml* ]]; then
98 _CMD="$_CMD -p -input -p $_TESTFILEPATH"104 _CMD="$_CMD -p -input -p $(abspath $_TESTFILEPATH)"
99 fi105 fi
100 _CMD="$_CMD -p -maxwarnings -p 100"106 _CMD="$_CMD -p -maxwarnings -p 100"
101}107}
102108
103function execute_test_cmd {109function execute_test_cmd {
104 echo "Executing $_CMD $_ARGS"110 echo "Executing $_CMD $_ARGS"
105 echo "Working directory: $PWD"
106 if [ ! -x $_TARGETPATH ]; then111 if [ ! -x $_TARGETPATH ]; then
107 echo "Error: $_TARGET wasn't built!"112 echo "Error: $_TARGET wasn't built!"
108 RESULT=2113 RESULT=2
109 elif [ $DISPLAY ]; then114 elif [ $DISPLAY ]; then
110 cd $(dirname $_TARGETPATH)115 SRC_TARGETPATH=$(echo $EXE | sed "s@$BUILD_DIR@$SRC_DIR@")
116 cd $(dirname $SRC_TARGETPATH)
111117
112 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999118 # https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1256999
113 # https://bugreports.qt-project.org/browse/QTBUG-36243119 # https://bugreports.qt-project.org/browse/QTBUG-36243
114
115 # QV4_MM_AGGRESSIVE_GC=1 \120 # QV4_MM_AGGRESSIVE_GC=1 \
116 ALARM_BACKEND=memory SUPPRESS_DEPRECATED_NOTE=no \121 ALARM_BACKEND=memory SUPPRESS_DEPRECATED_NOTE=no \
117 QT_LOGGING_RULES="[PERFORMANCE].warning=false" \122 QT_LOGGING_RULES="[PERFORMANCE].warning=false" \
118 $_CMD $_ARGS 2>&1 | grep -v 'QFontDatabase: Cannot find font directory'123 $_CMD $_ARGS 2>&1 | sed "s@$_TESTFILE: @@" | grep -v 'QFontDatabase: Cannot find font directory'
119 if [ ! -s $_XML ]; then124 if [ ! -s $_XML ]; then
120 # Write fallback in case it crashed and the file is empty125 # Write fallback in case it crashed and the file is empty
121 if [[ $_XML == *".SEGFAULT"* ]]; then126 if [[ $_XML == *".SEGFAULT"* ]]; then
@@ -125,7 +130,7 @@
125 fi130 fi
126 fi131 fi
127 if [ "x$UITK_TEST_KEEP_RUNNING" != "x1" ]; then132 if [ "x$UITK_TEST_KEEP_RUNNING" != "x1" ]; then
128 ${BUILD_DIR}/tests/checkresults.sh $_XML133 ${SRC_DIR}/tests/checkresults.sh $_XML
129 RESULT=$?134 RESULT=$?
130 fi135 fi
131 else136 else
132137
=== added file 'tests/unit/visual/gallery.qml'
--- tests/unit/visual/gallery.qml 1970-01-01 00:00:00 +0000
+++ tests/unit/visual/gallery.qml 2016-06-16 09:57:10 +0000
@@ -0,0 +1,78 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.3
19import Qt.labs.folderlistmodel 2.1
20
21MainView {
22 width: units.gu(120)
23 height: units.gu(75)
24
25 AdaptivePageLayout {
26 id: pageLayout
27 anchors.fill: parent
28 primaryPage: Page {
29 header: PageHeader {
30 flickable: testsListView
31 title: 'Unit Tests'
32 }
33
34 UbuntuListView {
35 id: testsListView
36 anchors.fill: parent
37 model: FolderListModel {
38 Component.onCompleted: folder += '/tests/unit/visual'
39 showDirs: false
40 showOnlyReadable: true
41 sortField: FolderListModel.Name
42 nameFilters: [ "tst_*13.qml" ]
43 }
44
45 delegate: ListItem {
46 height: listItemLayout.height
47 ListItemLayout {
48 id: listItemLayout
49 title.text: fileBaseName
50 ProgressionSlot {}
51 }
52 onClicked: {
53 testsListView.currentIndex = index
54 pageLayout.addPageToNextColumn(pageLayout.primaryPage, testPage, { source: fileURL, title: fileBaseName })
55 }
56 }
57 }
58 }
59 asynchronous: false
60
61 Page {
62 id: testPage
63 property alias source: testLoader.source
64 header: PageHeader {
65 id: testPageHeader
66 title: testPage.title
67 }
68
69 Loader {
70 id: testLoader
71 anchors.fill: parent
72 anchors.topMargin: testPage.header.height
73 asynchronous: false
74 }
75 }
76 }
77}
78
079
=== added file 'tests/unit/visual/gallery.sh'
--- tests/unit/visual/gallery.sh 1970-01-01 00:00:00 +0000
+++ tests/unit/visual/gallery.sh 2016-06-16 09:57:10 +0000
@@ -0,0 +1,6 @@
1#!/bin/bash
2
3. `dirname ${BASH_SOURCE[0]}`/../../../export_qml_dir.sh || exit 1
4
5SCRIPT_DIRECTORY=`dirname $0`
6$BUILD_DIR/ubuntu-ui-toolkit-launcher/ubuntu-ui-toolkit-launcher $@ $SCRIPT_DIRECTORY/gallery.qml
07
=== modified file 'tests/unit/visual/tst_pageheader.qml'
--- tests/unit/visual/tst_pageheader.qml 2016-03-30 15:12:36 +0000
+++ tests/unit/visual/tst_pageheader.qml 2016-06-16 09:57:10 +0000
@@ -238,7 +238,8 @@
238238
239 Switch {239 Switch {
240 id: subtitleSwitch240 id: subtitleSwitch
241 checked: false241 // Subtitle enabled initially as a regression test for bug #1588837.
242 checked: true
242 }243 }
243 Label {244 Label {
244 text: "subtitle"245 text: "subtitle"
245246
=== modified file 'tests/unit/visual/tst_picker13.qml'
--- tests/unit/visual/tst_picker13.qml 2016-03-15 13:26:55 +0000
+++ tests/unit/visual/tst_picker13.qml 2016-06-16 09:57:10 +0000
@@ -100,6 +100,7 @@
100 Loader {100 Loader {
101 id: pickerLoader101 id: pickerLoader
102 asynchronous: false102 asynchronous: false
103 sourceComponent: defaultPicker
103 }104 }
104105
105 ListModel {106 ListModel {
106107
=== modified file 'tests/unit/visual/tst_popups_dialog13.qml'
--- tests/unit/visual/tst_popups_dialog13.qml 2016-03-15 13:26:55 +0000
+++ tests/unit/visual/tst_popups_dialog13.qml 2016-06-16 09:57:10 +0000
@@ -26,6 +26,13 @@
26 width: units.gu(40)26 width: units.gu(40)
27 height: units.gu(71)27 height: units.gu(71)
2828
29 Button {
30 id: pressMe
31 anchors.top: parent.top
32 text: "Open Dialog"
33 onClicked: PopupUtils.open(dialog)
34 }
35
29 UbuntuTestCase {36 UbuntuTestCase {
30 id: test37 id: test
31 name: "Popups.Dialog"38 name: "Popups.Dialog"
@@ -45,7 +52,13 @@
45 Component {52 Component {
46 id: dialog53 id: dialog
47 Dialog {54 Dialog {
55 id: ahojDialog
48 title: "Ahoj"56 title: "Ahoj"
57
58 Button {
59 text: "Close"
60 onClicked: PopupUtils.close(ahojDialog)
61 }
49 }62 }
50 }63 }
51}64}
5265
=== modified file 'tests/xvfb.sh'
--- tests/xvfb.sh 2013-12-19 14:46:25 +0000
+++ tests/xvfb.sh 2016-06-16 09:57:10 +0000
@@ -1,4 +1,4 @@
1#!/bin/sh1#!/bin/bash
2#2#
3# Copyright 2013 Canonical Ltd.3# Copyright 2013 Canonical Ltd.
4#4#
@@ -16,15 +16,18 @@
16#16#
17# Author: Christian Dywan <christian.dywan@canonical.com>17# Author: Christian Dywan <christian.dywan@canonical.com>
1818
19. `dirname ${BASH_SOURCE[0]}`/../export_qml_dir.sh || exit 1
20
21LOG=$BUILD_DIR/xvfb.err
19echo Running $@ in virtual frame buffer...22echo Running $@ in virtual frame buffer...
20xvfb-run -a -s "-screen 0 1280x1024x24" -e xvfb.err "$@" 2>test.err23xvfb-run -a -s "-screen 0 1280x1024x24" -e $LOG "$@" 2>$LOG
21RETVAL=$?24RETVAL=$?
22if [ $RETVAL -eq 0 ]; then25if [ $RETVAL -eq 0 ]; then
23 echo $@ finished successfully...26 echo $@ finished successfully...
24else27else
25 echo $@ in virtual frame buffer failed...28 echo $@ in virtual frame buffer failed...
26 cat test.err >&229 cat $LOG >&2
27 echo Tail of xvfb-run output:30 echo Tail of xvfb-run output:
28 tail xvfb.err >&231 tail $LOG >&2
29 exit $RETVAL32 exit $RETVAL
30fi33fi

Subscribers

People subscribed via source and target branches

to status/vote changes: