This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] Add setMaxOverscaleFactorForParentTiles
- Loading branch information
1 parent
09a5ee2
commit 9d593f2
Showing
13 changed files
with
92 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,41 @@ | ||
#include <mbgl/style/source_impl.hpp> | ||
#include <mbgl/util/constants.hpp> | ||
#include <mbgl/util/logging.hpp> | ||
|
||
namespace mbgl { | ||
namespace style { | ||
|
||
namespace { | ||
void WarnIfOverscaleFactorCapsPrefetchDelta(const optional<uint8_t>& overscale, const optional<uint8_t>& prefetch) { | ||
const uint8_t prefetchDelta = std::max<uint8_t>(util::DEFAULT_PREFETCH_ZOOM_DELTA, prefetch.value_or(0u)); | ||
if (overscale && *overscale < prefetchDelta) { | ||
Log::Warning(Event::Style, "Parent tile overscale factor will cap prefetch delta to %d", int(*overscale)); | ||
} | ||
} | ||
} // namespace | ||
|
||
Source::Impl::Impl(SourceType type_, std::string id_) | ||
: type(type_), | ||
id(std::move(id_)) { | ||
} | ||
|
||
void Source::Impl::setPrefetchZoomDelta(optional<uint8_t> delta) noexcept { | ||
prefetchZoomDelta = std::move(delta); | ||
WarnIfOverscaleFactorCapsPrefetchDelta(maxOverscaleFactor, prefetchZoomDelta); | ||
} | ||
|
||
optional<uint8_t> Source::Impl::getPrefetchZoomDelta() const noexcept { | ||
return prefetchZoomDelta; | ||
} | ||
|
||
void Source::Impl::setMaxOverscaleFactorForParentTiles(optional<uint8_t> overscaleFactor) noexcept { | ||
maxOverscaleFactor = std::move(overscaleFactor); | ||
WarnIfOverscaleFactorCapsPrefetchDelta(maxOverscaleFactor, prefetchZoomDelta); | ||
} | ||
|
||
optional<uint8_t> Source::Impl::getMaxOverscaleFactorForParentTiles() const noexcept { | ||
return maxOverscaleFactor; | ||
} | ||
|
||
} // namespace style | ||
} // namespace mbgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters