summaryrefslogtreecommitdiff
path: root/include/mbgl/style
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2017-05-04 19:21:08 +0300
committerIvo van Dongen <ivovandongen@users.noreply.github.com>2017-05-08 19:39:55 +0300
commit6fd40867d67eb3758c0eb8eca184ed9d7b9da5b0 (patch)
tree36fede4f7dfeb01a6835f53a185dad47f3153481 /include/mbgl/style
parentfeae5e22ee4910a1508f2120c8131b2f8531bae8 (diff)
downloadqtlocation-mapboxgl-6fd40867d67eb3758c0eb8eca184ed9d7b9da5b0.tar.gz
[core] delegate light changes to render light
Diffstat (limited to 'include/mbgl/style')
-rw-r--r--include/mbgl/style/conversion/light.hpp2
-rw-r--r--include/mbgl/style/light.hpp15
-rw-r--r--include/mbgl/style/light.hpp.ejs15
3 files changed, 17 insertions, 15 deletions
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 <mbgl/style/transition_options.hpp>
#include <mbgl/style/types.hpp>
-namespace mbgl {
-
-class RenderLight;
+#include <memory>
+namespace mbgl {
namespace style {
class Light {
public:
+ class Impl;
+
+ Light();
+ ~Light();
+
static LightAnchorType getDefaultAnchor();
PropertyValue<LightAnchorType> getAnchor() const;
void setAnchor(PropertyValue<LightAnchorType>);
@@ -38,10 +42,7 @@ public:
void setIntensityTransition(const TransitionOptions&);
TransitionOptions getIntensityTransition() const;
-private:
- IndexedTuple<LightProperties, LightProperties> properties;
-
- friend class mbgl::RenderLight;
+ std::shared_ptr<Impl> 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 <mbgl/style/transition_options.hpp>
#include <mbgl/style/types.hpp>
-namespace mbgl {
-
-class RenderLight;
+#include <memory>
+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<LightProperties, LightProperties> properties;
-
- friend class mbgl::RenderLight;
+ std::shared_ptr<Impl> impl;
};
} // namespace style