Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Scale tile cache size based on tile size
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh authored and brunoabinader committed Jan 26, 2017
1 parent 19bd68d commit 44b960f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mbgl/style/source_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ void Source::Impl::updateTiles(const UpdateParameters& parameters) {

if (type != SourceType::Annotations && cache.getSize() == 0) {
size_t conservativeCacheSize =
std::max((float)parameters.transformState.getSize().width / util::tileSize, 1.0f) *
std::max((float)parameters.transformState.getSize().height / util::tileSize, 1.0f) *
std::max((float)parameters.transformState.getSize().width / tileSize, 1.0f) *
std::max((float)parameters.transformState.getSize().height / tileSize, 1.0f) *
(parameters.transformState.getMaxZoom() - parameters.transformState.getMinZoom() + 1) *
0.5;
cache.setSize(conservativeCacheSize);
Expand Down

0 comments on commit 44b960f

Please sign in to comment.