From 6fd40867d67eb3758c0eb8eca184ed9d7b9da5b0 Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Thu, 4 May 2017 19:21:08 +0300 Subject: [core] delegate light changes to render light --- include/mbgl/style/conversion/light.hpp | 2 +- include/mbgl/style/light.hpp | 15 ++++++++------- include/mbgl/style/light.hpp.ejs | 15 ++++++++------- 3 files changed, 17 insertions(+), 15 deletions(-) (limited to 'include/mbgl/style') diff --git a/include/mbgl/style/conversion/light.hpp b/include/mbgl/style/conversion/light.hpp index 30bb906037..ba162516c0 100644 --- a/include/mbgl/style/conversion/light.hpp +++ b/include/mbgl/style/conversion/light.hpp @@ -113,7 +113,7 @@ public: return {}; } } - return { light }; + return { std::move(light) }; }; }; diff --git a/include/mbgl/style/light.hpp b/include/mbgl/style/light.hpp index 7942d0d237..8212a58dcc 100644 --- a/include/mbgl/style/light.hpp +++ b/include/mbgl/style/light.hpp @@ -5,15 +5,19 @@ #include #include -namespace mbgl { - -class RenderLight; +#include +namespace mbgl { namespace style { class Light { public: + class Impl; + + Light(); + ~Light(); + static LightAnchorType getDefaultAnchor(); PropertyValue getAnchor() const; void setAnchor(PropertyValue); @@ -38,10 +42,7 @@ public: void setIntensityTransition(const TransitionOptions&); TransitionOptions getIntensityTransition() const; -private: - IndexedTuple properties; - - friend class mbgl::RenderLight; + std::shared_ptr impl; }; } // namespace style diff --git a/include/mbgl/style/light.hpp.ejs b/include/mbgl/style/light.hpp.ejs index 40f85b66b5..601e0bd410 100644 --- a/include/mbgl/style/light.hpp.ejs +++ b/include/mbgl/style/light.hpp.ejs @@ -8,15 +8,19 @@ #include #include -namespace mbgl { - -class RenderLight; +#include +namespace mbgl { namespace style { class Light { public: + class Impl; + + Light(); + ~Light(); + <% for (const property of properties) { -%> static <%- evaluatedType(property) %> getDefault<%- camelize(property.name) %>(); <%- propertyValueType(property) %> get<%- camelize(property.name) %>() const; @@ -25,10 +29,7 @@ public: TransitionOptions get<%- camelize(property.name) %>Transition() const; <% } -%> -private: - IndexedTuple properties; - - friend class mbgl::RenderLight; + std::shared_ptr impl; }; } // namespace style -- cgit v1.2.1