[core] Immutable Impls

This commit is contained in:
John Firebaugh
2017-04-25 18:20:26 -07:00
parent d3f23b83d4
commit c2a5894f2d
124 changed files with 2592 additions and 1487 deletions

View File

@@ -3,12 +3,17 @@
namespace mbgl {
RenderLayer::RenderLayer(style::LayerType type_, const style::Layer::Impl& baseImpl_)
: type(type_), baseImpl(baseImpl_) {
RenderLayer::RenderLayer(style::LayerType type_, Immutable<style::Layer::Impl> baseImpl_)
: type(type_),
baseImpl(baseImpl_) {
}
void RenderLayer::setImpl(Immutable<style::Layer::Impl> impl) {
baseImpl = impl;
}
const std::string& RenderLayer::getID() const {
return baseImpl.id;
return baseImpl->id;
}
bool RenderLayer::hasRenderPass(RenderPass pass) const {
@@ -17,9 +22,9 @@ bool RenderLayer::hasRenderPass(RenderPass pass) const {
bool RenderLayer::needsRendering(float zoom) const {
return passes != RenderPass::None
&& baseImpl.visibility != style::VisibilityType::None
&& baseImpl.minZoom <= zoom
&& baseImpl.maxZoom >= zoom;
&& baseImpl->visibility != style::VisibilityType::None
&& baseImpl->minZoom <= zoom
&& baseImpl->maxZoom >= zoom;
}
} // namespace mbgl