diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-05-20 17:38:52 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-05-21 10:55:09 +0200 |
commit | 13939b26d9dd270294f3491759362f62a52a8a13 (patch) | |
tree | 3e094ed77469a4a028ded41908e1879919117dd8 /src/style/style.cpp | |
parent | 238fe86571772da67cc5b3e23012b75904b0f9fb (diff) | |
download | qtlocation-mapboxgl-13939b26d9dd270294f3491759362f62a52a8a13.tar.gz |
first shot at composited blending
still missing:
- stencil+depth mask
- alpha compositing
Diffstat (limited to 'src/style/style.cpp')
-rw-r--r-- | src/style/style.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/style/style.cpp b/src/style/style.cpp index 578b2c0131..54528f5271 100644 --- a/src/style/style.cpp +++ b/src/style/style.cpp @@ -18,6 +18,7 @@ void Style::reset() { computed.icons.clear(); computed.texts.clear(); computed.rasters.clear(); + computed.composites.clear(); } void Style::cascade(float z) { @@ -130,6 +131,19 @@ void Style::cascade(float z) { raster.opacity = layer.opacity.evaluate<float>(z); } + // Cascade composite classes + for (const auto& composite_pair : sheetClass.composite) { + const std::string& layer_name = composite_pair.first; + const llmr::CompositeClass& layer = composite_pair.second; + + // TODO: This should be restricted to composite styles that have actual + // values so as to not override with default values. + llmr::CompositeProperties& composite = computed.composites[layer_name]; + composite.enabled = layer.enabled.evaluate<bool>(z); + composite.opacity = layer.opacity.evaluate<float>(z); + } + + // Cascade background computed.background.color = sheetClass.background.color; computed.background.opacity = sheetClass.background.opacity.evaluate<float>(z); |