summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-01-30 12:37:16 +0100
committerKonstantin Käfer <mail@kkaefer.com>2014-01-30 12:37:16 +0100
commitbc07cb4b2615ba0f622189fdc30092a021750598 (patch)
tree67fac828f0d7283561ceffbb3aea397560e0ad5f
parent6a343494ec6453cac0e04d016c502f385351866a (diff)
downloadqtlocation-mapboxgl-bc07cb4b2615ba0f622189fdc30092a021750598.tar.gz
don't pass the entire tile object to changeMatrix
-rw-r--r--include/llmr/renderer/painter.hpp3
-rw-r--r--src/map/map.cpp1
-rw-r--r--src/renderer/painter.cpp6
3 files changed, 5 insertions, 5 deletions
diff --git a/include/llmr/renderer/painter.hpp b/include/llmr/renderer/painter.hpp
index b79aeb8f9c..86d53c1637 100644
--- a/include/llmr/renderer/painter.hpp
+++ b/include/llmr/renderer/painter.hpp
@@ -33,7 +33,9 @@ public:
void setup();
+
void clear();
+ void changeMatrix(const Tile::ID& id);
void render(const std::shared_ptr<Tile>& tile);
void renderLayers(const std::shared_ptr<Tile>& tile, const std::vector<LayerDescription>& layers);
void renderDebug(const std::shared_ptr<Tile>& tile);
@@ -49,7 +51,6 @@ public:
private:
void setupShaders();
- void changeMatrix(const std::shared_ptr<Tile>& tile);
public:
diff --git a/src/map/map.cpp b/src/map/map.cpp
index c19d390f8e..bda787b6ae 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -294,6 +294,7 @@ bool Map::render() {
for (Tile::Ptr& tile : tiles) {
assert(tile);
if (tile->state == Tile::ready) {
+ painter.changeMatrix(tile->id);
painter.render(tile);
}
}
diff --git a/src/renderer/painter.cpp b/src/renderer/painter.cpp
index 297fa3d2ba..35224ab837 100644
--- a/src/renderer/painter.cpp
+++ b/src/renderer/painter.cpp
@@ -51,13 +51,13 @@ void Painter::setupShaders() {
lineShader = std::make_shared<LineShader>();
}
-void Painter::changeMatrix(const Tile::Ptr& tile) {
+void Painter::changeMatrix(const Tile::ID& id) {
// Initialize projection matrix
mat4 projMatrix;
matrix::ortho(projMatrix, 0, transform.width, transform.height, 0, 1, 10);
// The position matrix.
- transform.matrixFor(matrix, tile->id);
+ transform.matrixFor(matrix, id);
matrix::multiply(matrix, projMatrix, matrix);
// The extrusion matrix.
@@ -118,8 +118,6 @@ void Painter::render(const Tile::Ptr& tile) {
return;
}
- changeMatrix(tile);
-
drawClippingMask();
renderLayers(tile, style.layers);