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/qdeclarativepolygonmapitem_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/qdeclarativepolygonmapitem_p.h')
-rw-r--r-- | src/location/declarativemaps/qdeclarativepolygonmapitem_p.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h index 9a46bb2c..2e1f0d52 100644 --- a/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h +++ b/src/location/declarativemaps/qdeclarativepolygonmapitem_p.h @@ -68,7 +68,7 @@ public: inline void setAssumeSimple(bool value) { assumeSimple_ = value; } void updateSourcePoints(const QGeoMap &map, - const QList<QGeoCoordinate> &path); + const QList<QDoubleVector2D> &path); void updateScreenPoints(const QGeoMap &map); @@ -122,9 +122,12 @@ protected Q_SLOTS: virtual void afterViewportChanged(const QGeoMapViewportChangeEvent &event) Q_DECL_OVERRIDE; private: + void regenerateCache(); + void updateCache(); void pathPropertyChanged(); QGeoPath geopath_; + QList<QDoubleVector2D> geopathProjected_; QDeclarativeMapLineProperties border_; QColor color_; bool dirtyMaterial_; |