diff options
author | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-07-14 15:14:39 +0300 |
---|---|---|
committer | Bruno de Oliveira Abinader <bruno@mapbox.com> | 2015-07-14 16:58:32 +0300 |
commit | 0ea8a37cb081302707c7815f3df5745bd3d6eef3 (patch) | |
tree | 1a6d5511d12ee57e461b48b6552bef47e9a053aa /src/mbgl/renderer/painter_line.cpp | |
parent | 2aad2f4e14ab762847141788e725d50e1ee44ace (diff) | |
download | qtlocation-mapboxgl-0ea8a37cb081302707c7815f3df5745bd3d6eef3.tar.gz |
Unify default transition values in MapData
Relevant changes:
- Added 'defaultFadeDuration' and 'defaultTransitionDelay' to MapData;
- Painter & StyleParser now receives a reference to MapData;
- As previously seen on the code: 300ms is the default fade duration
and 0ms is the default transition duration;
- We no longer pass the current time point to Style, since it now uses
MapData.animationTime, which gets updated in MapContext::update().
- Updated StyleParser check to use a mock MapData;
Diffstat (limited to 'src/mbgl/renderer/painter_line.cpp')
-rw-r--r-- | src/mbgl/renderer/painter_line.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp index 5f5a89d419..1ef9214102 100644 --- a/src/mbgl/renderer/painter_line.cpp +++ b/src/mbgl/renderer/painter_line.cpp @@ -5,6 +5,7 @@ #include <mbgl/style/style_layout.hpp> #include <mbgl/map/sprite.hpp> #include <mbgl/map/tile_id.hpp> +#include <mbgl/map/map_data.hpp> #include <mbgl/shader/line_shader.hpp> #include <mbgl/shader/linesdf_shader.hpp> #include <mbgl/shader/linepattern_shader.hpp> @@ -26,7 +27,7 @@ void Painter::renderLine(LineBucket& bucket, const StyleLayer &layer_desc, const // the distance over which the line edge fades out. // Retina devices need a smaller distance to avoid aliasing. - float antialiasing = 1.0 / pixelRatio; + float antialiasing = 1.0 / data.pixelRatio; float blur = properties.blur + antialiasing; float edgeWidth = properties.width / 2.0; @@ -61,7 +62,7 @@ void Painter::renderLine(LineBucket& bucket, const StyleLayer &layer_desc, const linesdfShader->u_matrix = vtxMatrix; linesdfShader->u_exmatrix = extrudeMatrix; linesdfShader->u_linewidth = {{ outset, inset }}; - linesdfShader->u_ratio = pixelRatio; + linesdfShader->u_ratio = data.pixelRatio; linesdfShader->u_blur = blur; linesdfShader->u_color = color; @@ -80,7 +81,7 @@ void Painter::renderLine(LineBucket& bucket, const StyleLayer &layer_desc, const linesdfShader->u_patternscale_b = {{ scaleXB, scaleYB }}; linesdfShader->u_tex_y_b = posB.y; linesdfShader->u_image = 0; - linesdfShader->u_sdfgamma = lineAtlas->width / (properties.dash_line_width * std::min(posA.width, posB.width) * 256.0 * pixelRatio) / 2; + linesdfShader->u_sdfgamma = lineAtlas->width / (properties.dash_line_width * std::min(posA.width, posB.width) * 256.0 * data.pixelRatio) / 2; linesdfShader->u_mix = properties.dash_array.t; bucket.drawLineSDF(*linesdfShader); @@ -96,7 +97,7 @@ void Painter::renderLine(LineBucket& bucket, const StyleLayer &layer_desc, const linepatternShader->u_matrix = vtxMatrix; linepatternShader->u_exmatrix = extrudeMatrix; linepatternShader->u_linewidth = {{ outset, inset }}; - linepatternShader->u_ratio = pixelRatio; + linepatternShader->u_ratio = data.pixelRatio; linepatternShader->u_blur = blur; linepatternShader->u_pattern_size_a = {{imagePosA.size[0] * factor * properties.image.fromScale, imagePosA.size[1]}}; @@ -120,7 +121,7 @@ void Painter::renderLine(LineBucket& bucket, const StyleLayer &layer_desc, const lineShader->u_matrix = vtxMatrix; lineShader->u_exmatrix = extrudeMatrix; lineShader->u_linewidth = {{ outset, inset }}; - lineShader->u_ratio = pixelRatio; + lineShader->u_ratio = data.pixelRatio; lineShader->u_blur = blur; lineShader->u_color = color; |