diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/renderer/tile_pyramid.cpp | 7 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile.cpp | 5 | ||||
-rw-r--r-- | src/mbgl/tile/geometry_tile.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/tile/tile.hpp | 10 |
4 files changed, 13 insertions, 11 deletions
diff --git a/src/mbgl/renderer/tile_pyramid.cpp b/src/mbgl/renderer/tile_pyramid.cpp index dee84c4e32..b931b2d279 100644 --- a/src/mbgl/renderer/tile_pyramid.cpp +++ b/src/mbgl/renderer/tile_pyramid.cpp @@ -231,12 +231,7 @@ void TilePyramid::update(const std::vector<Immutable<style::LayerProperties>>& l if (holdForFade && typeInfo->fadingTiles == LayerTypeInfo::FadingTiles::NotRequired) { continue; } - // Update layer properties for complete tiles; for incomplete just check the presence. - bool layerRenderableInTile = tile.isComplete() ? tile.updateLayerProperties(layerProperties) - : static_cast<bool>(tile.getBucket(*layerProperties->baseImpl)); - if (layerRenderableInTile) { - tile.usedByRenderedLayers = true; - } + tile.usedByRenderedLayers |= tile.layerPropertiesUpdated(layerProperties); } } } diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index 7a7b7cb770..1bc7646d1e 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -212,13 +212,14 @@ const LayerRenderData* GeometryTile::getLayerRenderData(const style::Layer::Impl return that->getMutableLayerRenderData(layerImpl); } -bool GeometryTile::updateLayerProperties(const Immutable<style::LayerProperties>& layerProperties) { +bool GeometryTile::layerPropertiesUpdated(const Immutable<style::LayerProperties>& layerProperties) { LayerRenderData* renderData = getMutableLayerRenderData(*layerProperties->baseImpl); if (!renderData) { return false; } - if (renderData->layerProperties != layerProperties) { + if (renderData->layerProperties != layerProperties && + renderData->layerProperties->constantsMask() == layerProperties->constantsMask()) { renderData->layerProperties = layerProperties; } diff --git a/src/mbgl/tile/geometry_tile.hpp b/src/mbgl/tile/geometry_tile.hpp index cbc94deed0..c206dd1157 100644 --- a/src/mbgl/tile/geometry_tile.hpp +++ b/src/mbgl/tile/geometry_tile.hpp @@ -47,7 +47,7 @@ public: void upload(gfx::UploadPass&) override; Bucket* getBucket(const style::Layer::Impl&) const override; const LayerRenderData* getLayerRenderData(const style::Layer::Impl&) const override; - bool updateLayerProperties(const Immutable<style::LayerProperties>&) override; + bool layerPropertiesUpdated(const Immutable<style::LayerProperties>&) override; void queryRenderedFeatures( std::unordered_map<std::string, std::vector<Feature>>& result, diff --git a/src/mbgl/tile/tile.hpp b/src/mbgl/tile/tile.hpp index 95ee0bc37e..17a16b4666 100644 --- a/src/mbgl/tile/tile.hpp +++ b/src/mbgl/tile/tile.hpp @@ -58,10 +58,16 @@ public: assert(false); return nullptr; } - // Updates the contained layer render data with the given properties. + // Notifies this tile of the updated layer properties. + // + // Tile implementation should update the contained layer + // render data with the given properties. + // // Returns `true` if the corresponding render layer data is present in this tile (and i.e. it // was succesfully updated); returns `false` otherwise. - virtual bool updateLayerProperties(const Immutable<style::LayerProperties>&) { return true; } + virtual bool layerPropertiesUpdated(const Immutable<style::LayerProperties>& layerProperties) { + return bool(getBucket(*layerProperties->baseImpl)); + } virtual void setShowCollisionBoxes(const bool) {} virtual void setLayers(const std::vector<Immutable<style::LayerProperties>>&) {} virtual void setMask(TileMask&&) {} |