summaryrefslogtreecommitdiff
path: root/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-01-11 16:02:14 +0100
committerIvan Solovev <ivan.solovev@qt.io>2021-03-25 11:08:33 +0100
commit4bcacd0dc8f73de7b9e5e5f5fa2129fd88bdff3b (patch)
treec257958bf7892f83fa6a80331c53c8292293b2f2 /src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
parent4d6e3ba98a09ffb390da90154a2f61085b565d8e (diff)
downloadqtlocation-4bcacd0dc8f73de7b9e5e5f5fa2129fd88bdff3b.tar.gz
Fix compilation for no opengl builds
Disables experimental labs qml plugin, which since a4469cad40 depends heavily on opengl backend. Fix warnings with msvc when compiling without experimental plugin. Task-number: QTBUG-91623 Fixes: QTBUG-88017 Change-Id: I53c5da915981bd05f39134ba57f585d0a0786aa8 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativepolygonmapitem.cpp')
-rw-r--r--src/location/declarativemaps/qdeclarativepolygonmapitem.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
index 24086993..4275d696 100644
--- a/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
+++ b/src/location/declarativemaps/qdeclarativepolygonmapitem.cpp
@@ -334,6 +334,7 @@ void QGeoMapPolygonGeometry::updateScreenPoints(const QGeoMap &map, qreal stroke
this->translate(QPointF(strokeWidth, strokeWidth));
}
+#if QT_CONFIG(opengl)
QGeoMapPolygonGeometryOpenGL::QGeoMapPolygonGeometryOpenGL(){
}
@@ -344,6 +345,7 @@ void QGeoMapPolygonGeometryOpenGL::updateSourcePoints(const QGeoMap &map, const
geopath.append(QWebMercator::mercatorToCoord(c));
updateSourcePoints(map, geopath);
}
+#endif
// wrapPath always preserves the geometry
// This one handles holes
@@ -452,6 +454,7 @@ static void cutPathEars(const QList<QDoubleVector2D> &wrappedPath,
screenIndices << quint32(i);
}
+#if QT_CONFIG(opengl)
/*!
\internal
*/
@@ -594,7 +597,7 @@ void QGeoMapPolygonGeometryOpenGL::updateQuickGeometry(const QGeoProjectionWebMe
sourceBounds_.setWidth(brect.width());
sourceBounds_.setHeight(brect.height());
}
-
+#endif // QT_CONFIG(opengl)
/*
* QDeclarativePolygonMapItem Private Implementations
*/
@@ -603,8 +606,9 @@ QDeclarativePolygonMapItemPrivate::~QDeclarativePolygonMapItemPrivate() {}
QDeclarativePolygonMapItemPrivateCPU::~QDeclarativePolygonMapItemPrivateCPU() {}
+#if QT_CONFIG(opengl)
QDeclarativePolygonMapItemPrivateOpenGL::~QDeclarativePolygonMapItemPrivateOpenGL() {}
-
+#endif
/*
* QDeclarativePolygonMapItem Implementation
*/
@@ -689,9 +693,17 @@ void QDeclarativePolygonMapItem::setBackend(QDeclarativePolygonMapItem::Backend
if (b == m_backend)
return;
m_backend = b;
- QScopedPointer<QDeclarativePolygonMapItemPrivate> d((m_backend == Software)
- ? static_cast<QDeclarativePolygonMapItemPrivate *>(new QDeclarativePolygonMapItemPrivateCPU(*this))
- : static_cast<QDeclarativePolygonMapItemPrivate * >(new QDeclarativePolygonMapItemPrivateOpenGL(*this)));
+ QScopedPointer<QDeclarativePolygonMapItemPrivate> d(
+ (m_backend == Software) ? static_cast<QDeclarativePolygonMapItemPrivate *>(
+ new QDeclarativePolygonMapItemPrivateCPU(*this))
+#if QT_CONFIG(opengl)
+ : static_cast<QDeclarativePolygonMapItemPrivate *>(
+ new QDeclarativePolygonMapItemPrivateOpenGL(*this)));
+#else
+ : nullptr);
+ qFatal("Requested non software rendering backend, but source code is compiled wihtout opengl "
+ "support");
+#endif
m_d.swap(d);
m_d->onGeoGeometryChanged();
emit backendChanged();
@@ -898,6 +910,7 @@ void QDeclarativePolygonMapItem::geometryChanged(const QRectF &newGeometry, cons
//////////////////////////////////////////////////////////////////////
+#if QT_CONFIG(opengl)
QSGMaterialShader *MapPolygonMaterial::createShader() const
{
return new MapPolygonShader();
@@ -916,6 +929,7 @@ QSGMaterialType *MapPolygonMaterial::type() const
static QSGMaterialType type;
return &type;
}
+#endif
MapPolygonNode::MapPolygonNode() :
border_(new MapPolylineNode()),
@@ -967,6 +981,7 @@ void MapPolygonNode::update(const QColor &fillColor, const QColor &borderColor,
}
}
+#if QT_CONFIG(opengl)
MapPolygonNodeGL::MapPolygonNodeGL() :
//fill_material_(this),
fill_material_(),
@@ -1052,5 +1067,5 @@ void MapPolygonShader::updateState(const QSGMaterialShader::RenderState &state,
program()->setUniformValue(m_center_lowpart_id, vecCenter_lowpart);
program()->setUniformValue(m_wrapOffset_id, float(newMaterial->wrapOffset()));
}
-
+#endif // QT_CONFIG(opengl)
QT_END_NAMESPACE