This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] restructure TileSource construction and callbacks
- Loading branch information
Showing
19 changed files
with
264 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,24 @@ | ||
#include <mbgl/tile/annotation_tile_source.hpp> | ||
#include <mbgl/tile/geometry_tile.hpp> | ||
#include <mbgl/tile/geometry_tile_data.hpp> | ||
#include <mbgl/annotation/annotation_manager.hpp> | ||
#include <mbgl/util/async_request.hpp> | ||
|
||
namespace mbgl { | ||
|
||
AnnotationTileSource::AnnotationTileSource(const OverscaledTileID& tileID_, | ||
AnnotationManager& annotationManager_) | ||
: tileID(tileID_), annotationManager(annotationManager_) { | ||
AnnotationTileSource::AnnotationTileSource(GeometryTileData& tileData_, | ||
const OverscaledTileID& tileID_, | ||
AnnotationManager& annotationManager_) | ||
: GeometryTileSource(tileData_), tileID(tileID_), annotationManager(annotationManager_) { | ||
annotationManager.addTileSource(*this); | ||
} | ||
|
||
AnnotationTileSource::~AnnotationTileSource() { | ||
annotationManager.removeTileSource(*this); | ||
} | ||
|
||
std::unique_ptr<AsyncRequest> | ||
AnnotationTileSource::monitorTile(const GeometryTileSource::Callback& callback_) { | ||
callback = callback_; | ||
annotationManager.addTileSource(*this); | ||
return nullptr; | ||
} | ||
|
||
void AnnotationTileSource::update(std::unique_ptr<GeometryTile> tile) { | ||
callback(nullptr, std::move(tile), {}, {}); | ||
tileData.setData(nullptr, std::move(tile), {}, {}); | ||
} | ||
|
||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7af016e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#5143 becomes a bit hard to follow at this point. It looks like, in addition to the primary change here (essentially inverting the relationship between
GeometryTileSource
andGeometryTileData
, which is a great idea), there are some separable changes.RasterTileSource
toImageTileSource
GeometryTileData::parsePending
callback
⇢cb
Can these be split into separate commits?
7af016e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jfirebaugh looks like you continued work in https://github.com/mapbox/mapbox-gl-native/compare/5143-refactor-tile-source; want to sync up later today?