[core]Disable RenderAnnotationSource when annotations are disabled

This patch disables creation of `RenderAnnotationSource` instances
and thus saves extra 4Ki on Android when `LayerManager::annotationsEnabled`
is `false`.
This commit is contained in:
Mikhail Pozdnyakov
2018-12-11 13:41:23 +02:00
parent ebd87a5442
commit c043d01e14
2 changed files with 11 additions and 1 deletions

View File

@@ -6,12 +6,15 @@
#include <mbgl/algorithm/generate_clip_ids.hpp>
#include <mbgl/algorithm/generate_clip_ids_impl.hpp>
#include <mbgl/layermanager/layer_manager.hpp>
namespace mbgl {
using namespace style;
RenderAnnotationSource::RenderAnnotationSource(Immutable<AnnotationSource::Impl> impl_)
: RenderSource(impl_) {
assert(LayerManager::annotationsEnabled);
tilePyramid.setObserver(this);
}