summaryrefslogtreecommitdiff
path: root/src/mbgl/tile/geometry_tile.hpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-03-30 16:02:56 -0700
committerChris Loer <chris.loer@mapbox.com>2018-04-02 10:39:22 -0700
commit7f42e3970ee8c6a57fbb4dba7c564ff17c2eb6bb (patch)
tree9258a7ad3655f1fd3b1a01acb073093cd1b5685a /src/mbgl/tile/geometry_tile.hpp
parent6762cd0a8ffda59d377b4299b267b6c461040af4 (diff)
downloadqtlocation-mapboxgl-7f42e3970ee8c6a57fbb4dba7c564ff17c2eb6bb.tar.gz
[core] Convert GeometryTileWorker to "one-phase" loading
Modest simplification refactoring (issue #10457). Also, fixes issue #11538, which was caused in part by a hole in the vestigial two-phase loading.
Diffstat (limited to 'src/mbgl/tile/geometry_tile.hpp')
-rw-r--r--src/mbgl/tile/geometry_tile.hpp33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp
index 8843d6e579..98b5f0c490 100644
--- a/src/mbgl/tile/geometry_tile.hpp
+++ b/src/mbgl/tile/geometry_tile.hpp
@@ -68,30 +68,24 @@ public:
std::unordered_map<std::string, std::shared_ptr<Bucket>> nonSymbolBuckets;
std::unique_ptr<FeatureIndex> featureIndex;
std::unique_ptr<GeometryTileData> tileData;
+ std::unordered_map<std::string, std::shared_ptr<Bucket>> symbolBuckets;
+ optional<AlphaImage> glyphAtlasImage;
+ optional<PremultipliedImage> iconAtlasImage;
LayoutResult(std::unordered_map<std::string, std::shared_ptr<Bucket>> nonSymbolBuckets_,
std::unique_ptr<FeatureIndex> featureIndex_,
- std::unique_ptr<GeometryTileData> tileData_)
+ std::unique_ptr<GeometryTileData> tileData_,
+ std::unordered_map<std::string, std::shared_ptr<Bucket>> symbolBuckets_,
+ optional<AlphaImage> glyphAtlasImage_,
+ optional<PremultipliedImage> iconAtlasImage_)
: nonSymbolBuckets(std::move(nonSymbolBuckets_)),
featureIndex(std::move(featureIndex_)),
- tileData(std::move(tileData_)) {}
- };
- void onLayout(LayoutResult, uint64_t correlationID);
-
- class PlacementResult {
- public:
- std::unordered_map<std::string, std::shared_ptr<Bucket>> symbolBuckets;
- optional<AlphaImage> glyphAtlasImage;
- optional<PremultipliedImage> iconAtlasImage;
-
- PlacementResult(std::unordered_map<std::string, std::shared_ptr<Bucket>> symbolBuckets_,
- optional<AlphaImage> glyphAtlasImage_,
- optional<PremultipliedImage> iconAtlasImage_)
- : symbolBuckets(std::move(symbolBuckets_)),
+ tileData(std::move(tileData_)),
+ symbolBuckets(std::move(symbolBuckets_)),
glyphAtlasImage(std::move(glyphAtlasImage_)),
iconAtlasImage(std::move(iconAtlasImage_)) {}
};
- void onPlacement(PlacementResult, uint64_t correlationID);
+ void onLayout(LayoutResult, uint64_t correlationID);
void onError(std::exception_ptr, uint64_t correlationID);
@@ -124,16 +118,15 @@ private:
uint64_t correlationID = 0;
std::unordered_map<std::string, std::shared_ptr<Bucket>> nonSymbolBuckets;
+ std::unordered_map<std::string, std::shared_ptr<Bucket>> symbolBuckets;
+
+ optional<std::pair<std::unique_ptr<const GeometryTileData>, std::unique_ptr<FeatureIndex>>> dataPendingCommit;
std::unique_ptr<FeatureIndex> featureIndex;
- optional<std::pair<bool,std::unique_ptr<FeatureIndex>>> pendingFeatureIndex;
std::unique_ptr<const GeometryTileData> data;
- optional<std::pair<bool, std::unique_ptr<const GeometryTileData>>> pendingData;
optional<AlphaImage> glyphAtlasImage;
optional<PremultipliedImage> iconAtlasImage;
- std::unordered_map<std::string, std::shared_ptr<Bucket>> symbolBuckets;
-
const MapMode mode;
bool showCollisionBoxes;