TMP [drape] Restore old non-working code for bucket discard optimization
This commit is contained in:
parent
ef67cd04f1
commit
2ac04082cb
3 changed files with 13 additions and 0 deletions
|
@ -240,6 +240,7 @@ uint64_t CalculateOverlayPriority(int minZoomLevel, uint8_t rank, float depth)
|
|||
|
||||
// Even if minZoomLevel < 0 (-1 is not visible), we will get more consistent |minZoom| value (less is worse).
|
||||
ASSERT_GREATER_OR_EQUAL(minZoomLevel, 0, ());
|
||||
minZoomLevel = 0; // TMP make sure its not affecting overlays displacement
|
||||
uint8_t const minZoom = 0xFF - static_cast<uint8_t>(minZoomLevel);
|
||||
|
||||
// Pack into uint64_t priority value (bigger is better).
|
||||
|
|
|
@ -153,6 +153,10 @@ bool RenderGroup::UpdateCanBeDeletedStatus(bool canBeDeleted, int currentZoom, r
|
|||
bool visibleBucket = !canBeDeleted && (m_renderBuckets[i]->GetMinZoom() <= currentZoom);
|
||||
if (!visibleBucket)
|
||||
{
|
||||
// TMP DEBUG output
|
||||
if (m_renderBuckets[i]->GetMinZoom() > currentZoom)
|
||||
LOG(LINFO, ("Removing not visible bucket", m_renderBuckets[i]->GetMinZoom(), currentZoom, GetDepthLayer(m_state), m_renderBuckets.size()));
|
||||
|
||||
m_renderBuckets[i]->RemoveOverlayHandles(tree);
|
||||
std::swap(m_renderBuckets[i], m_renderBuckets.back());
|
||||
m_renderBuckets.pop_back();
|
||||
|
|
|
@ -303,6 +303,12 @@ void RuleDrawer::ProcessAreaStyle(FeatureType & f, Stylist const & s,
|
|||
applyPointStyle = m_globalRect.IsPointInside(featureCenter);
|
||||
}
|
||||
|
||||
if (applyPointStyle || is3dBuilding)
|
||||
{
|
||||
// At this point a proper geometry is loaded already.
|
||||
minVisibleScale = feature::GetMinDrawableScale(f); // Doesn't get passed to insertShape().
|
||||
}
|
||||
|
||||
ApplyAreaFeature apply(m_context->GetTileKey(), insertShape, f.GetID(),
|
||||
m_currentScaleGtoP, isBuilding,
|
||||
m_context->Is3dBuildingsEnabled() && isBuildingOutline,
|
||||
|
@ -446,6 +452,7 @@ void RuleDrawer::ProcessPointStyle(FeatureType & f, Stylist const & s,
|
|||
if (isSpeedCamera)
|
||||
depthLayer = DepthLayer::NavigationLayer;
|
||||
|
||||
minVisibleScale = feature::GetMinDrawableScale(f); // Doesn't get passed to insertShape().
|
||||
ApplyPointFeature apply(m_context->GetTileKey(), insertShape, f.GetID(), minVisibleScale, f.GetRank(),
|
||||
s.GetCaptionDescription(), 0.0f /* posZ */, depthLayer);
|
||||
f.ForEachPoint([&apply](m2::PointD const & pt) { apply(pt, false /* hasArea */); }, zoomLevel);
|
||||
|
@ -499,6 +506,7 @@ void RuleDrawer::operator()(FeatureType & f)
|
|||
size_t const index = shape->GetType();
|
||||
ASSERT_LESS(index, m_mapShapes.size(), ());
|
||||
|
||||
// MinZoom is used for optimization in RenderGroup::UpdateCanBeDeletedStatus().
|
||||
shape->SetFeatureMinZoom(minVisibleScale);
|
||||
m_mapShapes[index].push_back(std::move(shape));
|
||||
};
|
||||
|
|
Reference in a new issue