[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:
@@ -21,10 +21,15 @@ namespace mbgl {
|
||||
|
||||
using namespace style;
|
||||
|
||||
namespace {
|
||||
|
||||
inline const FillLayer::Impl& impl(const Immutable<style::Layer::Impl>& impl) {
|
||||
assert(impl->getTypeInfo() == FillLayer::Impl::staticTypeInfo());
|
||||
return static_cast<const FillLayer::Impl&>(*impl);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
RenderFillLayer::RenderFillLayer(Immutable<style::FillLayer::Impl> _impl)
|
||||
: RenderLayer(makeMutable<FillLayerProperties>(std::move(_impl))),
|
||||
unevaluated(impl(baseImpl).paint.untransitioned()) {
|
||||
|
||||
Reference in New Issue
Block a user