Skip to content

Commit 7128b7c

Browse files
VectorLayer - Bug fix unittests fail after last changes
1 parent e3c8707 commit 7128b7c

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

gl_engine/shaders/vector_layer.frag

-4
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,6 @@ void main() {
440440
if(check_next_geometry)
441441
continue;
442442

443-
// TODO tile extent depends on zoom level
444-
// highp int tmp = tile_extent;
445-
// tmp = tmp >> (18-int(tile_id.z));
446-
447443

448444
highp float thickness = layer_style.current_layer_style.outline_width / tile_extent;
449445
d = sdLine(uv, v0, v1) - thickness;

nucleus/vector_layer/Preprocessor.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ std::vector<GeometryData> parse_tile(tile::Id id, const QByteArray& vector_tile_
112112

113113
// qDebug() << layer_name << styles.size();
114114

115+
// TODO performance -> might be more efficient to find out if the style is the same and the alpha is full -> only visualize the higher layer_index
116+
115117
for (const auto& style : styles)
116118
data.emplace_back(vertices, extent, style.first, style.second, true, all_edges, 0);
117119
// data.emplace_back(std::vector<glm::vec2>(vertices), extent, styles[0].first, styles[0].second, true, std::vector<glm::ivec2>(edges), 0);

unittests/nucleus/vector_style.cpp

+14-3
Original file line numberDiff line numberDiff line change
@@ -187,16 +187,27 @@ TEST_CASE("nucleus/vector_style")
187187

188188
CHECK(style_buffer[feature_to_style.at("fill__building__null__null_0")].x == s.parse_color("#d9d0c9ff"));
189189
CHECK(style_buffer[feature_to_style.at("fill__landcover__farmland__farmland_0")].x == s.parse_color("#eef0d5ff"));
190-
CHECK(style_buffer[feature_to_style.at("fill__landcover__farmland__vineyard_0")].x == s.parse_color("#aedfa3ff"));
190+
CHECK(style_buffer[feature_to_style.at("fill__landcover__farmland__farmland_1")].x == s.parse_color("#eef0d5ff"));
191+
CHECK(style_buffer[feature_to_style.at("fill__landcover__farmland__vineyard_0")].x == s.parse_color("#eef0d5ff"));
192+
CHECK(style_buffer[feature_to_style.at("fill__landcover__farmland__vineyard_1")].x == s.parse_color("#aedfa3ff"));
191193
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__grass_0")].x == s.parse_color("#cdebb0ff"));
194+
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__grass_1")].x == s.parse_color("#cdebb0ff"));
192195
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__grassland_0")].x == s.parse_color("#cdebb0ff"));
196+
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__grassland_1")].x == s.parse_color("#cdebb0ff"));
193197
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__meadow_0")].x == s.parse_color("#cdebb0ff"));
194-
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__park_0")].x == s.parse_color("#c8faccff"));
195-
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__scrub_0")].x == s.parse_color("#c8d7abff"));
198+
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__meadow_1")].x == s.parse_color("#cdebb0ff"));
199+
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__park_0")].x == s.parse_color("#cdebb0ff"));
200+
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__park_1")].x == s.parse_color("#c8faccff"));
201+
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__scrub_0")].x == s.parse_color("#cdebb0ff"));
202+
CHECK(style_buffer[feature_to_style.at("fill__landcover__grass__scrub_1")].x == s.parse_color("#c8d7abff"));
196203
CHECK(style_buffer[feature_to_style.at("fill__landcover__rock__bare_rock_0")].x == s.parse_color("#eee5dcff"));
204+
CHECK(style_buffer[feature_to_style.at("fill__landcover__rock__bare_rock_1")].x == s.parse_color("#eee5dcff"));
197205
CHECK(style_buffer[feature_to_style.at("fill__landcover__wetland__wetland_0")].x == s.parse_color("#add19eff"));
206+
CHECK(style_buffer[feature_to_style.at("fill__landcover__wetland__wetland_1")].x == s.parse_color("#add19eff"));
198207
CHECK(style_buffer[feature_to_style.at("fill__landcover__wood__forest_0")].x == s.parse_color("#add19eff"));
208+
CHECK(style_buffer[feature_to_style.at("fill__landcover__wood__forest_1")].x == s.parse_color("#add19eff"));
199209
CHECK(style_buffer[feature_to_style.at("fill__landcover__wood__wood_0")].x == s.parse_color("#add19eff"));
210+
CHECK(style_buffer[feature_to_style.at("fill__landcover__wood__wood_1")].x == s.parse_color("#add19eff"));
200211
CHECK(style_buffer[feature_to_style.at("fill__landuse__commercial__null_0")].x == s.parse_color("#f2dad9ff"));
201212
CHECK(style_buffer[feature_to_style.at("fill__landuse__industrial__null_0")].x == s.parse_color("#ebdbe8ff"));
202213
CHECK(style_buffer[feature_to_style.at("fill__landuse__pitch__null_0")].x == s.parse_color("#aae0cbff"));

0 commit comments

Comments
 (0)