summaryrefslogtreecommitdiff
path: root/src/mbgl/renderer/style_diff.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-05-31 13:53:48 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-05 19:38:08 -0700
commit9dfc2d924d440560adb2db13c758b2c5b3b7dd47 (patch)
tree8d1868b5b011676fd0a7d260e0c3560cd36db6b9 /src/mbgl/renderer/style_diff.hpp
parent97eb62fe7cc10fd882f6e361c461900687361460 (diff)
downloadqtlocation-mapboxgl-9dfc2d924d440560adb2db13c758b2c5b3b7dd47.tar.gz
[core] Collection-level immutability
Introduce a second level of immutability, over each of the collections held by a style: sources, images, and layers. Tracking immutability at this level allows us to short-circuit significant portions of the RenderStyle update logic via a simple equality check, greatly improving performance.
Diffstat (limited to 'src/mbgl/renderer/style_diff.hpp')
-rw-r--r--src/mbgl/renderer/style_diff.hpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/renderer/style_diff.hpp b/src/mbgl/renderer/style_diff.hpp
index 285d1e12ed..ef788c380c 100644
--- a/src/mbgl/renderer/style_diff.hpp
+++ b/src/mbgl/renderer/style_diff.hpp
@@ -21,20 +21,20 @@ public:
using ImmutableImage = Immutable<style::Image::Impl>;
using ImageDifference = StyleDifference<ImmutableImage>;
-ImageDifference diffImages(const std::vector<ImmutableImage>&,
- const std::vector<ImmutableImage>&);
+ImageDifference diffImages(const Immutable<std::vector<ImmutableImage>>&,
+ const Immutable<std::vector<ImmutableImage>>&);
using ImmutableSource = Immutable<style::Source::Impl>;
using SourceDifference = StyleDifference<ImmutableSource>;
-SourceDifference diffSources(const std::vector<ImmutableSource>&,
- const std::vector<ImmutableSource>&);
+SourceDifference diffSources(const Immutable<std::vector<ImmutableSource>>&,
+ const Immutable<std::vector<ImmutableSource>>&);
using ImmutableLayer = Immutable<style::Layer::Impl>;
using LayerDifference = StyleDifference<ImmutableLayer>;
-LayerDifference diffLayers(const std::vector<ImmutableLayer>&,
- const std::vector<ImmutableLayer>&);
+LayerDifference diffLayers(const Immutable<std::vector<ImmutableLayer>>&,
+ const Immutable<std::vector<ImmutableLayer>>&);
bool hasLayoutDifference(const LayerDifference&, const std::string& layerID);