[core] Fix layer impl cast in render layer implementations
This PR puts `impl()` functions definitions into a nameless namespace to provide internal linkage and to make sure that appropriate cast function is invoked.
This commit is contained in:
@@ -16,10 +16,15 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
namespace {
|
||||
|
||||
inline const BackgroundLayer::Impl& impl(const Immutable<style::Layer::Impl>& impl) {
|
||||
assert(impl->getTypeInfo() == BackgroundLayer::Impl::staticTypeInfo());
|
||||
return static_cast<const style::BackgroundLayer::Impl&>(*impl);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
RenderBackgroundLayer::RenderBackgroundLayer(Immutable<style::BackgroundLayer::Impl> _impl)
|
||||
: RenderLayer(makeMutable<BackgroundLayerProperties>(std::move(_impl))),
|
||||
unevaluated(impl(baseImpl).paint.untransitioned()) {
|
||||
|
||||
Reference in New Issue
Block a user