summaryrefslogtreecommitdiff
path: root/src/mbgl/programs
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-05-15 14:17:06 -0700
committerAnsis Brammanis <brammanis@gmail.com>2017-07-11 09:10:22 -0700
commit59df3a90f41461562a80688337ec53687e341124 (patch)
treeaae3e94ddc74134600494fce944a5b3ab764a41a /src/mbgl/programs
parente364f24570f863044b9c464c2eb8c0fd75c5a80b (diff)
downloadqtlocation-mapboxgl-59df3a90f41461562a80688337ec53687e341124.tar.gz
[core] Improved label pitch-scaling: approximate collision box shapes based on tile distance from camera.
Diffstat (limited to 'src/mbgl/programs')
-rw-r--r--src/mbgl/programs/symbol_program.cpp2
-rw-r--r--src/mbgl/programs/symbol_program.hpp6
2 files changed, 7 insertions, 1 deletions
diff --git a/src/mbgl/programs/symbol_program.cpp b/src/mbgl/programs/symbol_program.cpp
index cdbd6b9713..789eed0dd8 100644
--- a/src/mbgl/programs/symbol_program.cpp
+++ b/src/mbgl/programs/symbol_program.cpp
@@ -2,6 +2,7 @@
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/map/transform_state.hpp>
#include <mbgl/style/layers/symbol_layer_impl.hpp>
+#include <mbgl/tile/tile.hpp>
#include <mbgl/util/enum.hpp>
#include <mbgl/math/clamp.hpp>
@@ -57,6 +58,7 @@ Values makeValues(const bool isText,
uniforms::u_texture::Value{ 0 },
uniforms::u_fadetexture::Value{ 1 },
uniforms::u_is_text::Value{ isText },
+ uniforms::u_collision_y_stretch::Value{ tile.tile.yStretch() },
std::forward<Args>(args)...
};
}
diff --git a/src/mbgl/programs/symbol_program.hpp b/src/mbgl/programs/symbol_program.hpp
index c11e0b5ca1..d1a6b4b994 100644
--- a/src/mbgl/programs/symbol_program.hpp
+++ b/src/mbgl/programs/symbol_program.hpp
@@ -42,6 +42,7 @@ MBGL_DEFINE_UNIFORM_SCALAR(bool, u_is_size_feature_constant);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_size_t);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_size);
MBGL_DEFINE_UNIFORM_SCALAR(float, u_layout_size);
+MBGL_DEFINE_UNIFORM_SCALAR(float, u_collision_y_stretch);
} // namespace uniforms
struct SymbolLayoutAttributes : gl::Attributes<
@@ -389,7 +390,8 @@ class SymbolIconProgram : public SymbolProgram<
uniforms::u_rotate_with_map,
uniforms::u_texture,
uniforms::u_fadetexture,
- uniforms::u_is_text>,
+ uniforms::u_is_text,
+ uniforms::u_collision_y_stretch>,
style::IconPaintProperties>
{
public:
@@ -422,6 +424,7 @@ class SymbolSDFProgram : public SymbolProgram<
uniforms::u_texture,
uniforms::u_fadetexture,
uniforms::u_is_text,
+ uniforms::u_collision_y_stretch,
uniforms::u_gamma_scale,
uniforms::u_pitch,
uniforms::u_bearing,
@@ -443,6 +446,7 @@ public:
uniforms::u_texture,
uniforms::u_fadetexture,
uniforms::u_is_text,
+ uniforms::u_collision_y_stretch,
uniforms::u_gamma_scale,
uniforms::u_pitch,
uniforms::u_bearing,