summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mbgl/renderer/painter.hpp3
-rw-r--r--src/renderer/painter.cpp3
-rw-r--r--src/renderer/painter_fill.cpp2
-rw-r--r--src/renderer/painter_line.cpp2
4 files changed, 5 insertions, 5 deletions
diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp
index 957660a525..6801ad1cf7 100644
--- a/include/mbgl/renderer/painter.hpp
+++ b/include/mbgl/renderer/painter.hpp
@@ -120,7 +120,7 @@ public:
bool needsAnimation() const;
private:
void setupShaders();
- const mat4 &translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor = TranslateAnchorType::Map);
+ mat4 translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor = TranslateAnchorType::Map);
void prepareTile(const Tile& tile);
@@ -131,7 +131,6 @@ public:
void depthRange(float near, float far);
public:
- mat4 vtxMatrix;
mat4 projMatrix;
mat4 nativeMatrix;
mat4 extrudeMatrix;
diff --git a/src/renderer/painter.cpp b/src/renderer/painter.cpp
index 4822ba7312..2a3d45c9ed 100644
--- a/src/renderer/painter.cpp
+++ b/src/renderer/painter.cpp
@@ -204,13 +204,14 @@ void Painter::renderBackground(std::shared_ptr<StyleLayer> layer_desc) {
}
}
-const mat4 &Painter::translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor) {
+mat4 Painter::translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor) {
if (translation[0] == 0 && translation[1] == 0) {
return matrix;
} else {
// TODO: Get rid of the 8 (scaling from 4096 to tile size)
const double factor = ((double)(1 << id.z)) / map.getState().getScale() * (4096.0 / util::tileSize);
+ mat4 vtxMatrix;
if (anchor == TranslateAnchorType::Viewport) {
const double sin_a = std::sin(-map.getState().getAngle());
const double cos_a = std::cos(-map.getState().getAngle());
diff --git a/src/renderer/painter_fill.cpp b/src/renderer/painter_fill.cpp
index fe08d4c2fa..141b60d3ad 100644
--- a/src/renderer/painter_fill.cpp
+++ b/src/renderer/painter_fill.cpp
@@ -141,6 +141,6 @@ void Painter::renderFill(FillBucket& bucket, std::shared_ptr<StyleLayer> layer_d
// Abort early.
if (!bucket.hasData()) return;
const FillProperties &properties = layer_desc->getProperties<FillProperties>();
- const mat4 &vtxMatrix = translatedMatrix(matrix, properties.translate, id, properties.translateAnchor);
+ mat4 vtxMatrix = translatedMatrix(matrix, properties.translate, id, properties.translateAnchor);
renderFill(bucket, properties, id, vtxMatrix);
}
diff --git a/src/renderer/painter_line.cpp b/src/renderer/painter_line.cpp
index 24358c51dd..ad0778fc0b 100644
--- a/src/renderer/painter_line.cpp
+++ b/src/renderer/painter_line.cpp
@@ -31,7 +31,7 @@ void Painter::renderLine(LineBucket& bucket, std::shared_ptr<StyleLayer> layer_d
float dash_length = properties.dash_array[0];
float dash_gap = properties.dash_array[1];
- const mat4 &vtxMatrix = translatedMatrix(matrix, properties.translate, id, properties.translateAnchor);
+ mat4 vtxMatrix = translatedMatrix(matrix, properties.translate, id, properties.translateAnchor);
depthRange(strata, 1.0f);