summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2022-11-24 10:11:20 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2022-11-30 10:42:40 +0100
commit0ee94fbbba4f91209e6075fa033cd58300549286 (patch)
tree3f959c74824549654c8e312c22051fa5088713c6
parent8f6bd3b108826e3189d1b7f3280e748a473b2a1b (diff)
downloadqtlocation-0ee94fbbba4f91209e6075fa033cd58300549286.tar.gz
Remove map item backend switch
Change-Id: Ic1ed064269ac73e68d0358b373ea1e8048a1c241 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r--examples/location/geojson_viewer/GeoJsonDelegate.qml3
-rw-r--r--examples/location/geojson_viewer/main.qml8
-rw-r--r--src/location/quickmapitems/qdeclarativecirclemapitem.cpp79
-rw-r--r--src/location/quickmapitems/qdeclarativecirclemapitem_p.h13
-rw-r--r--src/location/quickmapitems/qdeclarativepolygonmapitem.cpp52
-rw-r--r--src/location/quickmapitems/qdeclarativepolygonmapitem_p.h12
-rw-r--r--src/location/quickmapitems/qdeclarativepolylinemapitem.cpp53
-rw-r--r--src/location/quickmapitems/qdeclarativepolylinemapitem_p.h12
-rw-r--r--src/location/quickmapitems/qdeclarativerectanglemapitem.cpp53
-rw-r--r--src/location/quickmapitems/qdeclarativerectanglemapitem_p.h12
-rw-r--r--tests/manual/mapitems_backends/main.qml43
-rw-r--r--tests/manual/mapobjects_tester/main.qml35
-rw-r--r--tests/manual/mappolyline_tester/main.qml23
13 files changed, 0 insertions, 398 deletions
diff --git a/examples/location/geojson_viewer/GeoJsonDelegate.qml b/examples/location/geojson_viewer/GeoJsonDelegate.qml
index d5b9b3e9..c9e43be3 100644
--- a/examples/location/geojson_viewer/GeoJsonDelegate.qml
+++ b/examples/location/geojson_viewer/GeoJsonDelegate.qml
@@ -59,7 +59,6 @@ DelegateChooser {
role: "type"
property color defaultColor: "grey"
property real defaultOpacity: 0.6
- property bool openGLBackends: false
DelegateChoice {
roleValue: "Point"
@@ -83,7 +82,6 @@ DelegateChooser {
delegate: MapPolyline {
property string geojsonType: "LineString"
property var props: modelData.properties
- backend: (dc.openGLBackends) ? MapPolyline.OpenGL : MapPolyline.Software
geoShape: modelData.data
line.width: 4
opacity: dc.defaultOpacity
@@ -101,7 +99,6 @@ DelegateChooser {
color: (props && props.color) || (parent && parent.props && parent.props.color) || dc.defaultColor
border.width: 4
border.color: 'black'
- backend: (dc.openGLBackends) ? MapPolygon.OpenGL : MapPolygon.Software
MouseArea {
anchors.fill: parent
onClicked: {
diff --git a/examples/location/geojson_viewer/main.qml b/examples/location/geojson_viewer/main.qml
index 3c42d9a5..85d0e07d 100644
--- a/examples/location/geojson_viewer/main.qml
+++ b/examples/location/geojson_viewer/main.qml
@@ -64,7 +64,6 @@ ApplicationWindow {
height: 1024
menuBar: mainMenu
title: qsTr("GeoJSON Viewer")
- property bool openGLBackends: glBackendSelector.checked
FileDialog {
visible: false
@@ -140,12 +139,6 @@ ApplicationWindow {
geoJsoner.print(miv)
}
}
- MenuItem {
- text: "OpenGL Item backends"
- id: glBackendSelector
- checkable: true
- checked: false
- }
}
}
@@ -173,7 +166,6 @@ ApplicationWindow {
id: miv
model: geoJsoner.model
delegate: GeoJsonDelegate {
- openGLBackends: win.openGLBackends
}
}
}
diff --git a/src/location/quickmapitems/qdeclarativecirclemapitem.cpp b/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
index 927ce6ae..499a9a1a 100644
--- a/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativecirclemapitem.cpp
@@ -265,17 +265,6 @@ void QGeoMapCircleGeometry::updateScreenPointsInvert(const QList<QDoubleVector2D
sourceBounds_ = screenBounds_;
}
-struct CircleBackendSelector
-{
- CircleBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativeCircleMapItem::OpenGL : QDeclarativeCircleMapItem::Software;
- }
- QDeclarativeCircleMapItem::Backend backend = QDeclarativeCircleMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(CircleBackendSelector, mapCircleBackendSelector)
-
QDeclarativeCircleMapItem::QDeclarativeCircleMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_border(this), m_color(Qt::transparent), m_dirtyMaterial(true),
m_updatingGeometry(false)
@@ -294,7 +283,6 @@ QDeclarativeCircleMapItem::QDeclarativeCircleMapItem(QQuickItem *parent)
// FIXME: unfortunately they self-intersect at the poles due to current drawing method
// so the line is commented out until fixed
//geometry_.setAssumeSimple(true);
- setBackend(mapCircleBackendSelector->backend);
}
QDeclarativeCircleMapItem::~QDeclarativeCircleMapItem()
@@ -347,7 +335,6 @@ void QDeclarativeCircleMapItem::setCenter(const QGeoCoordinate &center)
if (m_circle.center() == center)
return;
- possiblySwitchBackend(m_circle.center(), m_circle.radius(), center, m_circle.radius());
m_circle.setCenter(center);
m_d->onGeoGeometryChanged();
emit centerChanged(center);
@@ -391,7 +378,6 @@ void QDeclarativeCircleMapItem::setRadius(qreal radius)
if (m_circle.radius() == radius)
return;
- possiblySwitchBackend(m_circle.center(), m_circle.radius(), m_circle.center(), radius);
m_circle.setRadius(radius);
m_d->onGeoGeometryChanged();
emit radiusChanged(radius);
@@ -432,29 +418,6 @@ void QDeclarativeCircleMapItem::updatePolish()
/*!
\internal
-
- The OpenGL backend doesn't do circles crossing poles yet.
- So if that backend is selected and the circle crosses the poles, use the CPU backend instead.
-*/
-void QDeclarativeCircleMapItem::possiblySwitchBackend(const QGeoCoordinate &oldCenter, qreal oldRadius, const QGeoCoordinate &newCenter, qreal newRadius)
-{
- if (m_backend != QDeclarativeCircleMapItem::OpenGL)
- return;
-
- // if old does not cross and new crosses, move to CPU.
- if (!QDeclarativeCircleMapItemPrivate::crossEarthPole(oldCenter, oldRadius)
- && !QDeclarativeCircleMapItemPrivate::crossEarthPole(newCenter, newRadius)) {
- std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateCPU(*this)));
- std::swap(m_d, d);
- } else if (QDeclarativeCircleMapItemPrivate::crossEarthPole(oldCenter, oldRadius)
- && !QDeclarativeCircleMapItemPrivate::crossEarthPole(newCenter, newRadius)) { // else if old crosses and new does not cross, move back to OpenGL
- std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(static_cast<QDeclarativeCircleMapItemPrivate *>(new QDeclarativeCircleMapItemPrivateOpenGL(*this)));
- std::swap(m_d, d);
- }
-}
-
-/*!
- \internal
*/
void QDeclarativeCircleMapItem::afterViewportChanged(const QGeoMapViewportChangeEvent &event)
{
@@ -486,7 +449,6 @@ void QDeclarativeCircleMapItem::setGeoShape(const QGeoShape &shape)
const QGeoCircle circle(shape); // if shape isn't a circle, circle will be created as a default-constructed circle
const bool centerHasChanged = circle.center() != m_circle.center();
const bool radiusHasChanged = circle.radius() != m_circle.radius();
- possiblySwitchBackend(m_circle.center(), m_circle.radius(), circle.center(), circle.radius());
m_circle = circle;
m_d->onGeoGeometryChanged();
@@ -498,47 +460,6 @@ void QDeclarativeCircleMapItem::setGeoShape(const QGeoShape &shape)
/*!
\internal
- \qmlproperty MapCircle.Backend QtLocation::MapCircle::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapCircle.Software and \b{MapCircle.OpenGL}.
- The default value is \b{MapCircle.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-
-QDeclarativeCircleMapItem::Backend QDeclarativeCircleMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativeCircleMapItem::setBackend(QDeclarativeCircleMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativeCircleMapItemPrivate> d(
- (m_backend == Software) ? static_cast<QDeclarativeCircleMapItemPrivate *>(
- new QDeclarativeCircleMapItemPrivateCPU(*this))
- : static_cast<QDeclarativeCircleMapItemPrivate *>(
- new QDeclarativeCircleMapItemPrivateOpenGL(*this)));
- std::swap(m_d, d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativeCircleMapItem::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
{
diff --git a/src/location/quickmapitems/qdeclarativecirclemapitem_p.h b/src/location/quickmapitems/qdeclarativecirclemapitem_p.h
index 9e5f4e1a..88a02cfa 100644
--- a/src/location/quickmapitems/qdeclarativecirclemapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativecirclemapitem_p.h
@@ -66,20 +66,13 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeCircleMapItem : public QDeclarativeG
Q_OBJECT
QML_NAMED_ELEMENT(MapCircle)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QGeoCoordinate center READ center WRITE setCenter NOTIFY centerChanged)
Q_PROPERTY(qreal radius READ radius WRITE setRadius NOTIFY radiusChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativeCircleMapItem(QQuickItem *parent = nullptr);
~QDeclarativeCircleMapItem() override;
@@ -101,19 +94,14 @@ public:
const QGeoShape &geoShape() const override;
void setGeoShape(const QGeoShape &shape) override;
- Backend backend() const;
- void setBackend(Backend b);
-
Q_SIGNALS:
void centerChanged(const QGeoCoordinate &center);
void radiusChanged(qreal radius);
void colorChanged(const QColor &color);
- void backendChanged();
protected:
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
void updatePolish() override;
- void possiblySwitchBackend(const QGeoCoordinate &oldCenter, qreal oldRadius, const QGeoCoordinate &newCenter, qreal newRadius);
protected Q_SLOTS:
void markSourceDirtyAndUpdate();
@@ -129,7 +117,6 @@ private:
QColor m_color;
bool m_dirtyMaterial;
bool m_updatingGeometry;
- Backend m_backend = Software;
std::unique_ptr<QDeclarativeCircleMapItemPrivate> m_d;
diff --git a/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp b/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp
index f8125ddb..b8d202a8 100644
--- a/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativepolygonmapitem.cpp
@@ -425,17 +425,6 @@ bool QDeclarativePolygonMapItemPrivateCPU::contains(const QPointF &point) const
* QDeclarativePolygonMapItem Implementation
*/
-struct PolygonBackendSelector
-{
- PolygonBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativePolygonMapItem::OpenGL : QDeclarativePolygonMapItem::Software;
- }
- QDeclarativePolygonMapItem::Backend backend = QDeclarativePolygonMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(PolygonBackendSelector, mapPolygonBackendSelector)
-
QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_border(this), m_color(Qt::transparent), m_dirtyMaterial(true),
m_updatingGeometry(false)
@@ -451,7 +440,6 @@ QDeclarativePolygonMapItem::QDeclarativePolygonMapItem(QQuickItem *parent)
this, &QDeclarativePolygonMapItem::onLinePropertiesChanged);
QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged,
this, &QDeclarativePolygonMapItem::onLinePropertiesChanged);
- setBackend(mapPolygonBackendSelector->backend);
}
QDeclarativePolygonMapItem::~QDeclarativePolygonMapItem()
@@ -479,46 +467,6 @@ QDeclarativeMapLineProperties *QDeclarativePolygonMapItem::border()
/*!
\internal
- \qmlproperty MapPolygon.Backend QtLocation::MapPolygon::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapPolygon.Software and \b{MapPolygon.OpenGL}.
- The default value is \b{MapPolygon.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-QDeclarativePolygonMapItem::Backend QDeclarativePolygonMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativePolygonMapItem::setBackend(QDeclarativePolygonMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativePolygonMapItemPrivate> d(
- (m_backend == Software) ? static_cast<QDeclarativePolygonMapItemPrivate *>(
- new QDeclarativePolygonMapItemPrivateCPU(*this))
- : static_cast<QDeclarativePolygonMapItemPrivate *>(
- new QDeclarativePolygonMapItemPrivateOpenGL(*this)));
- std::swap(m_d, d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativePolygonMapItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
{
diff --git a/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h b/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h
index fae9c626..2726e5bd 100644
--- a/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativepolygonmapitem_p.h
@@ -64,19 +64,12 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolygonMapItem : public QDeclarative
Q_OBJECT
QML_NAMED_ELEMENT(MapPolygon)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativePolygonMapItem(QQuickItem *parent = nullptr);
~QDeclarativePolygonMapItem() override;
@@ -95,9 +88,6 @@ public:
QDeclarativeMapLineProperties *border();
- Backend backend() const;
- void setBackend(Backend b);
-
bool contains(const QPointF &point) const override;
const QGeoShape &geoShape() const override;
void setGeoShape(const QGeoShape &shape) override;
@@ -105,7 +95,6 @@ public:
Q_SIGNALS:
void pathChanged();
void colorChanged(const QColor &color);
- void backendChanged();
protected Q_SLOTS:
void markSourceDirtyAndUpdate();
@@ -123,7 +112,6 @@ public:
QGeoPolygon m_geopoly;
QDeclarativeMapLineProperties m_border;
QColor m_color;
- Backend m_backend = Software;
bool m_dirtyMaterial;
// bool m_dirtyGeometry = false;
bool m_updatingGeometry;
diff --git a/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp b/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp
index 6c1f3c20..73eaf930 100644
--- a/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativepolylinemapitem.cpp
@@ -799,17 +799,6 @@ bool QDeclarativePolylineMapItemPrivateCPU::contains(const QPointF &point) const
* QDeclarativePolygonMapItem Implementation
*/
-struct PolylineBackendSelector
-{
- PolylineBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativePolylineMapItem::OpenGL : QDeclarativePolylineMapItem::Software;
- }
- QDeclarativePolylineMapItem::Backend backend = QDeclarativePolylineMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(PolylineBackendSelector, mapPolylineBackendSelector)
-
QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_line(this),
m_d(new QDeclarativePolylineMapItemPrivateCPU(*this))
@@ -821,7 +810,6 @@ QDeclarativePolylineMapItem::QDeclarativePolylineMapItem(QQuickItem *parent)
this, &QDeclarativePolylineMapItem::updateAfterLinePropertiesChanged);
QObject::connect(&m_line, &QDeclarativeMapLineProperties::widthChanged,
this, &QDeclarativePolylineMapItem::updateAfterLinePropertiesChanged);
- setBackend(mapPolylineBackendSelector->backend);
}
QDeclarativePolylineMapItem::~QDeclarativePolylineMapItem()
@@ -1062,47 +1050,6 @@ QDeclarativeMapLineProperties *QDeclarativePolylineMapItem::line()
/*!
\internal
- \qmlproperty MapPolyline.Backend QtLocation::MapPolyline::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapPolyline.Software and \b{MapPolyline.OpenGL}.
- The default value is \b{MapPolyline.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-QDeclarativePolylineMapItem::Backend QDeclarativePolylineMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativePolylineMapItem::setBackend(QDeclarativePolylineMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativePolylineMapItemPrivate> d(
- (m_backend == Software)
- ? static_cast<QDeclarativePolylineMapItemPrivate *>(
- new QDeclarativePolylineMapItemPrivateCPU(*this))
- : static_cast<QDeclarativePolylineMapItemPrivate *>(
- new QDeclarativePolylineMapItemPrivateOpenGL(*this)));
- m_d.swap(d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativePolylineMapItem::geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry)
{
diff --git a/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h b/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h
index 8087aec1..f9c05b12 100644
--- a/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativepolylinemapitem_p.h
@@ -96,18 +96,11 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativePolylineMapItem : public QDeclarativ
Q_OBJECT
QML_NAMED_ELEMENT(MapPolyline)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QList<QGeoCoordinate> path READ path WRITE setPath NOTIFY pathChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *line READ line CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativePolylineMapItem(QQuickItem *parent = nullptr);
~QDeclarativePolylineMapItem();
@@ -134,12 +127,8 @@ public:
QDeclarativeMapLineProperties *line();
- Backend backend() const;
- void setBackend(Backend b);
-
Q_SIGNALS:
void pathChanged();
- void backendChanged();
protected Q_SLOTS:
void updateAfterLinePropertiesChanged();
@@ -156,7 +145,6 @@ public:
QGeoPath m_geopath;
QDeclarativeMapLineProperties m_line;
- Backend m_backend = Software;
bool m_dirtyMaterial = true;
bool m_updatingGeometry = false;
diff --git a/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp b/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp
index 20930d40..8b5b4e43 100644
--- a/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp
+++ b/src/location/quickmapitems/qdeclarativerectanglemapitem.cpp
@@ -132,17 +132,6 @@ QT_BEGIN_NAMESPACE
\since 5.14
*/
-struct RectangleBackendSelector
-{
- RectangleBackendSelector()
- {
- backend = (qgetenv("QTLOCATION_OPENGL_ITEMS").toInt()) ? QDeclarativeRectangleMapItem::OpenGL : QDeclarativeRectangleMapItem::Software;
- }
- QDeclarativeRectangleMapItem::Backend backend = QDeclarativeRectangleMapItem::Software;
-};
-
-Q_GLOBAL_STATIC(RectangleBackendSelector, mapRectangleBackendSelector)
-
QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent)
: QDeclarativeGeoMapItemBase(parent), m_border(this),
m_d(new QDeclarativeRectangleMapItemPrivateCPU(*this))
@@ -154,7 +143,6 @@ QDeclarativeRectangleMapItem::QDeclarativeRectangleMapItem(QQuickItem *parent)
this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged);
QObject::connect(&m_border, &QDeclarativeMapLineProperties::widthChanged,
this, &QDeclarativeRectangleMapItem::onLinePropertiesChanged);
- setBackend(mapRectangleBackendSelector->backend);
}
QDeclarativeRectangleMapItem::~QDeclarativeRectangleMapItem()
@@ -163,47 +151,6 @@ QDeclarativeRectangleMapItem::~QDeclarativeRectangleMapItem()
/*!
\internal
- \qmlproperty MapRectangle.Backend QtLocation::MapRectangle::backend
-
- This property holds which backend is in use to render the map item.
- Valid values are \b MapRectangle.Software and \b{MapRectangle.OpenGL}.
- The default value is \b{MapRectangle.Software}.
-
- \note \b{The release of this API with Qt 5.15 is a Technology Preview}.
- Ideally, as the OpenGL backends for map items mature, there will be
- no more need to also offer the legacy software-projection backend.
- So this property will likely disappear at some later point.
- To select OpenGL-accelerated item backends without using this property,
- it is also possible to set the environment variable \b QTLOCATION_OPENGL_ITEMS
- to \b{1}.
- Also note that all current OpenGL backends won't work as expected when enabling
- layers on the individual item, or when running on OpenGL core profiles greater than 2.x.
-
- \since 5.15
-*/
-QDeclarativeRectangleMapItem::Backend QDeclarativeRectangleMapItem::backend() const
-{
- return m_backend;
-}
-
-void QDeclarativeRectangleMapItem::setBackend(QDeclarativeRectangleMapItem::Backend b)
-{
- if (b == m_backend)
- return;
- m_backend = b;
- std::unique_ptr<QDeclarativeRectangleMapItemPrivate> d(
- (m_backend == Software) ? static_cast<QDeclarativeRectangleMapItemPrivate *>(
- new QDeclarativeRectangleMapItemPrivateCPU(*this))
- : static_cast<QDeclarativeRectangleMapItemPrivate *>(
- new QDeclarativeRectangleMapItemPrivateOpenGL(*this)));
-
- std::swap(m_d, d);
- m_d->onGeoGeometryChanged();
- emit backendChanged();
-}
-
-/*!
- \internal
*/
void QDeclarativeRectangleMapItem::setMap(QDeclarativeGeoMap *quickMap, QGeoMap *map)
{
diff --git a/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h b/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h
index 066ba241..7b0dcd06 100644
--- a/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h
+++ b/src/location/quickmapitems/qdeclarativerectanglemapitem_p.h
@@ -69,20 +69,13 @@ class Q_LOCATION_PRIVATE_EXPORT QDeclarativeRectangleMapItem: public QDeclarativ
Q_OBJECT
QML_NAMED_ELEMENT(MapRectangle)
QML_ADDED_IN_VERSION(5, 0)
- Q_ENUMS(Backend)
Q_PROPERTY(QGeoCoordinate topLeft READ topLeft WRITE setTopLeft NOTIFY topLeftChanged)
Q_PROPERTY(QGeoCoordinate bottomRight READ bottomRight WRITE setBottomRight NOTIFY bottomRightChanged)
Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)
Q_PROPERTY(QDeclarativeMapLineProperties *border READ border CONSTANT)
- Q_PROPERTY(Backend backend READ backend WRITE setBackend NOTIFY backendChanged REVISION(5, 15))
public:
- enum Backend {
- Software = 0,
- OpenGL = 1
- };
-
explicit QDeclarativeRectangleMapItem(QQuickItem *parent = nullptr);
~QDeclarativeRectangleMapItem() override;
@@ -105,14 +98,10 @@ public:
const QGeoShape &geoShape() const override;
void setGeoShape(const QGeoShape &shape) override;
- Backend backend() const;
- void setBackend(Backend b);
-
Q_SIGNALS:
void topLeftChanged(const QGeoCoordinate &topLeft);
void bottomRightChanged(const QGeoCoordinate &bottomRight);
void colorChanged(const QColor &color);
- void backendChanged();
protected:
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override;
@@ -130,7 +119,6 @@ private:
bool m_dirtyMaterial = true;
bool m_updatingGeometry = false;
- Backend m_backend = Software;
std::unique_ptr<QDeclarativeRectangleMapItemPrivate> m_d;
diff --git a/tests/manual/mapitems_backends/main.qml b/tests/manual/mapitems_backends/main.qml
index 56c4fda2..495462fe 100644
--- a/tests/manual/mapitems_backends/main.qml
+++ b/tests/manual/mapitems_backends/main.qml
@@ -178,19 +178,12 @@ Window {
// border.color: "black"
// border.width: 15
// objectName: parent.objectName + "limegreen"
-// backend: polygonBackend()
// path: [
// { longitude:17.13, latitude: 51.11},
// { longitude:30.54, latitude: 50.42},
// { longitude:26.70, latitude: 58.36},
// { longitude:17.13, latitude: 51.11}
// ]
-
-// function polygonBackend()
-// {
-// return (switchPolygons1.checked)
-// ? MapPolygon.OpenGL : MapPolygon.Software
-// }
// }
layer {
@@ -289,36 +282,13 @@ Window {
property bool glCircles
property bool glRectangles
objectName: parent.objectName + "_MIG_"
- function polylineBackend()
- {
- return (polyGroup.glPolylines)
- ? MapPolyline.OpenGL : MapPolyline.Software
- }
-
- function polygonBackend()
- {
- return (polyGroup.glPolygons)
- ? MapPolygon.OpenGL : MapPolygon.Software
- }
- function rectangleBackend()
- {
- return (polyGroup.glRectangles)
- ? MapRectangle.OpenGL : MapRectangle.Software
- }
-
- function circleBackend()
- {
- return (polyGroup.glCircles)
- ? MapCircle.OpenGL : MapCircle.Software
- }
MapPolyline {
id: tstPolyLine // to verify the polygon stays where it's supposed to
line.color: 'black'
objectName: parent.objectName + "black"
line.width: 1
opacity: 1.0
- backend: polylineBackend()
path: [
{ latitude: 76.9965, longitude: -175.012 },
{ latitude: 26.9965, longitude: -175.012 }
@@ -330,7 +300,6 @@ Window {
line.color: "red"
objectName: parent.objectName + "timeline"
line.width: 4
- backend: polylineBackend()
path: [
{ latitude: 90, longitude: 180 },
{ latitude: -90, longitude: -180 }
@@ -341,7 +310,6 @@ Window {
id: poly1
color: "red"
objectName: parent.objectName + "red"
- backend: polygonBackend()
path: [
{ latitude: 55, longitude: 170 },
{ latitude: 66.9965, longitude: -175.012 },
@@ -365,7 +333,6 @@ Window {
id: selfIntersectingPolygon
color: 'darkmagenta'
objectName: parent.objectName + "darkmagenta"
- backend: polygonBackend()
opacity: 1.0
path: [
{ latitude: 19, longitude: 49 },
@@ -398,7 +365,6 @@ Window {
border.color: "black"
border.width: 8
objectName: parent.objectName + "green"
- backend: polygonBackend()
path: [
{ latitude: -45, longitude: -170 },
{ latitude: -55, longitude: -155 },
@@ -420,7 +386,6 @@ Window {
id: poly3
color: "deepskyblue"
objectName: parent.objectName + "deepskyblue"
- backend: polygonBackend()
opacity: 0.2
path: [
{ latitude: 65, longitude: -20 },
@@ -436,7 +401,6 @@ Window {
border.color: "black"
border.width: 15
objectName: parent.objectName + "limegreen"
- backend: polygonBackend()
path: [
{ longitude:17.13, latitude: 51.11},
{ longitude:30.54, latitude: 50.42},
@@ -451,7 +415,6 @@ Window {
border.color: "black"
border.width: 8
objectName: parent.objectName + "yellow"
- backend: polygonBackend()
path: [
{ longitude:4, latitude: 15},
{ longitude:5, latitude: 15},
@@ -470,7 +433,6 @@ Window {
border.width: 6
topLeft: QtPositioning.coordinate(10,-10)
bottomRight: QtPositioning.coordinate(-10,10)
- backend: rectangleBackend()
MouseArea {
anchors.fill: parent
Rectangle {
@@ -486,7 +448,6 @@ Window {
id: longPolyline
line.width: sliLineWidth.value
line.color: 'firebrick'
- backend: polylineBackend()
}
MapCircle {
@@ -495,7 +456,6 @@ Window {
color: 'deepskyblue'
border.width: 6
border.color: 'firebrick'
- backend: circleBackend()
MouseArea {
anchors.fill: parent
Rectangle {
@@ -511,12 +471,9 @@ Window {
id: circle1
border.color: 'deepskyblue'
border.width: 26
- backend: circleBackend()
center: QtPositioning.coordinate(17, 44);
radius: 200*1000
color: "firebrick"
-// layer.enabled: (backend == MapCircle.Software)
-// layer.samples: 4
}
}
}
diff --git a/tests/manual/mapobjects_tester/main.qml b/tests/manual/mapobjects_tester/main.qml
index 038f1e7a..52cdf36c 100644
--- a/tests/manual/mapobjects_tester/main.qml
+++ b/tests/manual/mapobjects_tester/main.qml
@@ -149,36 +149,12 @@ Window {
property bool glRectangles
objectName: parent.objectName + "_MIG_"
- function polylineBackend()
- {
- return (polyGroup.glPolylines)
- ? MapPolyline.OpenGL : MapPolyline.Software
- }
-
- function polygonBackend()
- {
- return (polyGroup.glPolygons)
- ? MapPolygon.OpenGL : MapPolygon.Software
- }
-
- function rectangleBackend()
- {
- return (polyGroup.glRectangles)
- ? MapRectangle.OpenGL : MapRectangle.Software
- }
-
- function circleBackend()
- {
- return (polyGroup.glCircles)
- ? MapCircle.OpenGL : MapCircle.Software
- }
MapPolyline {
id: tstPolyLine // to verify the polygon stays where it's supposed to
line.color: 'black'
objectName: parent.objectName + "black"
line.width: 1
opacity: 1.0
- backend: polylineBackend()
path: [
{ latitude: 76.9965, longitude: -175.012 },
{ latitude: 26.9965, longitude: -175.012 }
@@ -190,7 +166,6 @@ Window {
line.color: "red"
objectName: parent.objectName + "timeline"
line.width: 4
- backend: polylineBackend()
path: [
{ latitude: 90, longitude: 180 },
{ latitude: -90, longitude: -180 }
@@ -201,7 +176,6 @@ Window {
id: poly1
color: "red"
objectName: parent.objectName + "red"
- backend: polygonBackend()
path: [
{ latitude: 55, longitude: 170 },
{ latitude: 66.9965, longitude: -175.012 },
@@ -225,7 +199,6 @@ Window {
id: selfIntersectingPolygon
color: 'darkmagenta'
objectName: parent.objectName + "darkmagenta"
- backend: polygonBackend()
opacity: 1.0
path: [
{ latitude: 19, longitude: 49 },
@@ -258,7 +231,6 @@ Window {
border.color: "black"
border.width: 8
objectName: parent.objectName + "green"
- backend: polygonBackend()
path: [
{ latitude: -45, longitude: -170 },
{ latitude: -55, longitude: -155 },
@@ -280,7 +252,6 @@ Window {
id: poly3
color: "deepskyblue"
objectName: parent.objectName + "deepskyblue"
- backend: polygonBackend()
opacity: 0.2
path: [
{ latitude: 65, longitude: -20 },
@@ -297,7 +268,6 @@ Window {
border.width: 6
topLeft: QtPositioning.coordinate(10,-10)
bottomRight: QtPositioning.coordinate(-10,10)
- backend: rectangleBackend()
MouseArea {
anchors.fill: parent
Rectangle {
@@ -311,7 +281,6 @@ Window {
LongPolyline {
id: longPoly
- backend: polylineBackend()
Component.onCompleted: longPolyPath = path
}
@@ -321,7 +290,6 @@ Window {
color: 'deepskyblue'
border.width: 6
border.color: 'firebrick'
- backend: circleBackend()
MouseArea {
anchors.fill: parent
Rectangle {
@@ -337,12 +305,9 @@ Window {
id: circle1
border.color: 'deepskyblue'
border.width: 26
- backend: circleBackend()
center: QtPositioning.coordinate(17, 44);
radius: 200*1000
color: "firebrick"
-// layer.enabled: (backend == MapCircle.Software)
-// layer.samples: 4
}
}
}
diff --git a/tests/manual/mappolyline_tester/main.qml b/tests/manual/mappolyline_tester/main.qml
index c8154916..25ec1f55 100644
--- a/tests/manual/mappolyline_tester/main.qml
+++ b/tests/manual/mappolyline_tester/main.qml
@@ -176,25 +176,12 @@ Window {
property bool glRectangles : true
objectName: parent.objectName + "_MIG_"
- function polylineBackend()
- {
- return (polyGroup.glPolylines === "Software")
- ? MapPolyline.Software : MapPolyline.OpenGL
- }
-
- function polygonBackend()
- {
- return (polyGroup.glPolylines === "Software")
- ? MapPolygon.Software : MapPolygon.OpenGL
- }
-
MapPolyline {
id: tstPolyLine // to verify the polygon stays where it's supposed to
line.color: 'black'
objectName: parent.objectName + "black"
line.width: 1
opacity: 1.0
- backend: polylineBackend()
path: [
{ latitude: 76.9965, longitude: -175.012 },
{ latitude: 26.9965, longitude: -175.012 }
@@ -206,7 +193,6 @@ Window {
line.color: "red"
objectName: parent.objectName + "timeline"
line.width: 4
- backend: polylineBackend()
path: [
{ latitude: 90, longitude: 180 },
{ latitude: -90, longitude: -180 }
@@ -218,7 +204,6 @@ Window {
line.color: "pink"
line.width: sliWidth.value
objectName: parent.objectName + "red"
- backend: polylineBackend()
path: [
{ latitude: 55, longitude: 170 },
@@ -248,7 +233,6 @@ Window {
border.color: "black"
border.width: 12
objectName: parent.objectName + "green"
- backend: polygonBackend()
path: [
{ latitude: -45, longitude: -170 },
{ latitude: -55, longitude: -155 },
@@ -265,13 +249,6 @@ Window {
}
}
}
-
-// LongPolyline {
-// id: longPolyline
-// line.width: 10
-// line.color: 'firebrick'
-// backend: polylineBackend()
-// }
}
}