aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2022-01-11 11:59:53 +0100
committerHenning Gruendl <henning.gruendl@qt.io>2022-01-12 13:30:38 +0100
commit4fb0164bc10a6741c917a7386fe5a494093ee70e (patch)
treeaae98632860d8764b4063c92fae61fec6e588a89
parent3d2a31c27e7e0fa7c65364b0d2f3a1e82954397d (diff)
Components: Use samples when antialiasing enabled
Use layer.samples: 4 whenever antialiasing is enabled on a component. Remove bigger textureSize due to performance implications. Task-number: QDS-5781 Change-Id: If73f136e21f70d76c58193545d657a9b52b0c38a Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--src/imports/components/ArcItem.qml2
-rw-r--r--src/imports/components/BorderItem.qml2
-rw-r--r--src/imports/components/EllipseItem.qml2
-rw-r--r--src/imports/components/PieItem.qml2
-rw-r--r--src/imports/components/RectangleItem.qml2
-rw-r--r--src/imports/components/RegularPolygonItem.qml2
-rw-r--r--src/imports/components/SvgPathItem.qml9
-rw-r--r--src/imports/components/TriangleItem.qml2
8 files changed, 11 insertions, 12 deletions
diff --git a/src/imports/components/ArcItem.qml b/src/imports/components/ArcItem.qml
index 4bed4e8..09dc040 100644
--- a/src/imports/components/ArcItem.qml
+++ b/src/imports/components/ArcItem.qml
@@ -282,7 +282,7 @@ Shape {
layer.enabled: root.antialiasing
layer.smooth: root.antialiasing
- layer.textureSize: Qt.size(root.width * 2, root.height * 2)
+ layer.samples: root.antialiasing ? 4 : 0
/*!
Whether the arc has an outline.
diff --git a/src/imports/components/BorderItem.qml b/src/imports/components/BorderItem.qml
index 33df0ab..ebaf218 100644
--- a/src/imports/components/BorderItem.qml
+++ b/src/imports/components/BorderItem.qml
@@ -322,7 +322,7 @@ Shape {
layer.enabled: root.antialiasing
layer.smooth: root.antialiasing
- layer.textureSize: Qt.size(root.width * 2, root.height * 2)
+ layer.samples: root.antialiasing ? 4 : 0
/*!
Where the border is drawn.
diff --git a/src/imports/components/EllipseItem.qml b/src/imports/components/EllipseItem.qml
index 9e0d6a6..2ce07ca 100644
--- a/src/imports/components/EllipseItem.qml
+++ b/src/imports/components/EllipseItem.qml
@@ -143,7 +143,7 @@ Shape {
layer.enabled: root.antialiasing
layer.smooth: root.antialiasing
- layer.textureSize: Qt.size(root.width * 2, root.height * 2)
+ layer.samples: root.antialiasing ? 4 : 0
/*!
The border is rendered within the rectangle's boundaries, outside of them,
diff --git a/src/imports/components/PieItem.qml b/src/imports/components/PieItem.qml
index 1b93bdc..3b2a60d 100644
--- a/src/imports/components/PieItem.qml
+++ b/src/imports/components/PieItem.qml
@@ -246,7 +246,7 @@ Shape {
layer.enabled: root.antialiasing
layer.smooth: root.antialiasing
- layer.textureSize: Qt.size(root.width * 2, root.height * 2)
+ layer.samples: root.antialiasing ? 4 : 0
function clamp(num, min, max) {
return Math.max(min, Math.min(num, max))
diff --git a/src/imports/components/RectangleItem.qml b/src/imports/components/RectangleItem.qml
index 9564cfc..b2bd1d1 100644
--- a/src/imports/components/RectangleItem.qml
+++ b/src/imports/components/RectangleItem.qml
@@ -317,7 +317,7 @@ Shape {
layer.enabled: root.antialiasing
layer.smooth: root.antialiasing
- layer.textureSize: Qt.size(root.width * 2, root.height * 2)
+ layer.samples: root.antialiasing ? 4 : 0
/*!
The border is rendered within the rectangle's boundaries, outside of them,
diff --git a/src/imports/components/RegularPolygonItem.qml b/src/imports/components/RegularPolygonItem.qml
index 0d51760..d07b795 100644
--- a/src/imports/components/RegularPolygonItem.qml
+++ b/src/imports/components/RegularPolygonItem.qml
@@ -163,7 +163,7 @@ Shape {
layer.enabled: root.antialiasing
layer.smooth: root.antialiasing
- layer.textureSize: Qt.size(root.width * 2, root.height * 2)
+ layer.samples: root.antialiasing ? 4 : 0
// This is used to make the bounding box of the item a bit bigger so it will draw sharp edges
// in case of large stroke width instead of cutting it off.
diff --git a/src/imports/components/SvgPathItem.qml b/src/imports/components/SvgPathItem.qml
index 6d1c480..c9fdc87 100644
--- a/src/imports/components/SvgPathItem.qml
+++ b/src/imports/components/SvgPathItem.qml
@@ -60,6 +60,7 @@ import QtQuick.Shapes 1.0
*/
Shape {
+ id: root
width: 200
height: 200
@@ -201,11 +202,9 @@ Shape {
*/
property alias capStyle: shape.capStyle
- layer.enabled: antialiasing
- layer.smooth: antialiasing
- layer.textureSize: Qt.size(width * 2, height * 2)
-
- id: svgPathItem
+ layer.enabled: root.antialiasing
+ layer.smooth: root.antialiasing
+ layer.samples: root.antialiasing ? 4 : 0
ShapePath {
id: shape
diff --git a/src/imports/components/TriangleItem.qml b/src/imports/components/TriangleItem.qml
index ce32581..6df2be9 100644
--- a/src/imports/components/TriangleItem.qml
+++ b/src/imports/components/TriangleItem.qml
@@ -304,7 +304,7 @@ Shape {
layer.enabled: root.antialiasing
layer.smooth: root.antialiasing
- layer.textureSize: Qt.size(root.width * 2, root.height * 2)
+ layer.samples: root.antialiasing ? 4 : 0
// This is used to make the bounding box of the item a bit bigger so it will draw sharp edges
// in case of large stroke width instead of cutting it off.