diff options
author | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-03-14 13:51:46 +0100 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2017-03-22 11:13:38 +0000 |
commit | ec1033a1cc24305025f9397ff29b6562a3187eb8 (patch) | |
tree | 651bef1e1871da1654840ca4c3fd9c285ed7a175 /src/location/declarativemaps/qdeclarativerectanglemapitem_p.h | |
parent | 172cff4678d26883b822c5486f1da7f33f760575 (diff) | |
download | qtlocation-ec1033a1cc24305025f9397ff29b6562a3187eb8.tar.gz |
Cache coordinate projections in map items
This patch caches the result of geoToMapProjection() for the coordinates
of the map items, regenerating this data only upon coordinate changes.
This allows avoiding to perform a (mercator) projection basically
every time the item has to be drawn, and instead do only the wrapping
around the camera center and the projection to screen
Task-number: QTBUG-59479
Change-Id: Iea5ec04f360d2fe7495cd9c1dd278e83200e0f8d
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/location/declarativemaps/qdeclarativerectanglemapitem_p.h')
-rw-r--r-- | src/location/declarativemaps/qdeclarativerectanglemapitem_p.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h b/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h index b65db813..ca7ca9b7 100644 --- a/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h +++ b/src/location/declarativemaps/qdeclarativerectanglemapitem_p.h @@ -53,6 +53,7 @@ #include <QtLocation/private/qgeomapitemgeometry_p.h> #include <QtLocation/private/qdeclarativepolylinemapitem_p.h> #include <QtLocation/private/qdeclarativepolygonmapitem_p.h> +#include <QtPositioning/private/qdoublevector2d_p.h> #include <QSGGeometryNode> #include <QSGFlatColorMaterial> @@ -97,6 +98,7 @@ Q_SIGNALS: void colorChanged(const QColor &color); protected: + void updatePath(); void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE; void updatePolish() Q_DECL_OVERRIDE; @@ -112,6 +114,7 @@ private: QGeoMapPolygonGeometry geometry_; QGeoMapPolylineGeometry borderGeometry_; bool updatingGeometry_; + QList<QDoubleVector2D> pathMercator_; }; ////////////////////////////////////////////////////////////////////// |