From 0ea8a37cb081302707c7815f3df5745bd3d6eef3 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 14 Jul 2015 15:14:39 +0300 Subject: 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; --- src/mbgl/renderer/painter_line.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mbgl/renderer/painter_line.cpp') 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 #include #include +#include #include #include #include @@ -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; -- cgit v1.2.1