summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-06-05 16:41:14 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-06-10 19:36:47 +0300
commitad53132e5d56fbd0ae90cfde2e2b26977ad0b433 (patch)
tree3e352de7e1c28e3d9c50e259d406fdf8cdcbfb37
parent50e239a93794b2fa1a57105f6f8f093d2e0a8d43 (diff)
downloadqtlocation-mapboxgl-ad53132e5d56fbd0ae90cfde2e2b26977ad0b433.tar.gz
[core] Inherit RenderAnnotationSource from RenderTileSource
-rw-r--r--src/mbgl/annotation/render_annotation_source.cpp37
-rw-r--r--src/mbgl/annotation/render_annotation_source.hpp22
2 files changed, 4 insertions, 55 deletions
diff --git a/src/mbgl/annotation/render_annotation_source.cpp b/src/mbgl/annotation/render_annotation_source.cpp
index ada6ec5ea9..123a776754 100644
--- a/src/mbgl/annotation/render_annotation_source.cpp
+++ b/src/mbgl/annotation/render_annotation_source.cpp
@@ -10,7 +10,7 @@ namespace mbgl {
using namespace style;
RenderAnnotationSource::RenderAnnotationSource(Immutable<AnnotationSource::Impl> impl_)
- : RenderSource(impl_) {
+ : RenderTileSource(std::move(impl_)) {
assert(LayerManager::annotationsEnabled);
tilePyramid.setObserver(this);
}
@@ -19,10 +19,6 @@ const AnnotationSource::Impl& RenderAnnotationSource::impl() const {
return static_cast<const AnnotationSource::Impl&>(*baseImpl);
}
-bool RenderAnnotationSource::isLoaded() const {
- return tilePyramid.isLoaded();
-}
-
void RenderAnnotationSource::update(Immutable<style::Source::Impl> baseImpl_,
const std::vector<Immutable<style::LayerProperties>>& layers,
const bool needsRendering,
@@ -47,30 +43,6 @@ void RenderAnnotationSource::update(Immutable<style::Source::Impl> baseImpl_,
});
}
-void RenderAnnotationSource::upload(gfx::UploadPass& uploadPass) {
- tilePyramid.upload(uploadPass);
-}
-
-void RenderAnnotationSource::prepare(const SourcePrepareParameters& parameters) {
- tilePyramid.prepare(parameters);
-}
-
-void RenderAnnotationSource::finishRender(PaintParameters& parameters) {
- tilePyramid.finishRender(parameters);
-}
-
-void RenderAnnotationSource::updateFadingTiles() {
- tilePyramid.updateFadingTiles();
-}
-
-bool RenderAnnotationSource::hasFadingTiles() const {
- return tilePyramid.hasFadingTiles();
-}
-
-std::vector<std::reference_wrapper<RenderTile>> RenderAnnotationSource::getRenderTiles() {
- return tilePyramid.getRenderTiles();
-}
-
std::unordered_map<std::string, std::vector<Feature>>
RenderAnnotationSource::queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
@@ -84,12 +56,5 @@ std::vector<Feature> RenderAnnotationSource::querySourceFeatures(const SourceQue
return {};
}
-void RenderAnnotationSource::reduceMemoryUse() {
- tilePyramid.reduceMemoryUse();
-}
-
-void RenderAnnotationSource::dumpDebugLogs() const {
- tilePyramid.dumpDebugLogs();
-}
} // namespace mbgl
diff --git a/src/mbgl/annotation/render_annotation_source.hpp b/src/mbgl/annotation/render_annotation_source.hpp
index c427da16d5..e5d5130446 100644
--- a/src/mbgl/annotation/render_annotation_source.hpp
+++ b/src/mbgl/annotation/render_annotation_source.hpp
@@ -1,16 +1,13 @@
#pragma once
-#include <mbgl/renderer/render_source.hpp>
-#include <mbgl/renderer/tile_pyramid.hpp>
#include <mbgl/annotation/annotation_source.hpp>
+#include <mbgl/renderer/sources/render_tile_source.hpp>
namespace mbgl {
-class RenderAnnotationSource : public RenderSource {
+class RenderAnnotationSource final : public RenderTileSource {
public:
- RenderAnnotationSource(Immutable<AnnotationSource::Impl>);
-
- bool isLoaded() const final;
+ explicit RenderAnnotationSource(Immutable<AnnotationSource::Impl>);
void update(Immutable<style::Source::Impl>,
const std::vector<Immutable<style::LayerProperties>>&,
@@ -18,14 +15,6 @@ public:
bool needsRelayout,
const TileParameters&) final;
- void upload(gfx::UploadPass&) final;
- void prepare(const SourcePrepareParameters&) final;
- void finishRender(PaintParameters&) final;
- void updateFadingTiles() final;
- bool hasFadingTiles() const final;
-
- std::vector<std::reference_wrapper<RenderTile>> getRenderTiles() final;
-
std::unordered_map<std::string, std::vector<Feature>>
queryRenderedFeatures(const ScreenLineString& geometry,
const TransformState& transformState,
@@ -36,13 +25,8 @@ public:
std::vector<Feature>
querySourceFeatures(const SourceQueryOptions&) const final;
- void reduceMemoryUse() final;
- void dumpDebugLogs() const final;
-
private:
const AnnotationSource::Impl& impl() const;
-
- TilePyramid tilePyramid;
};
template <>