From a1baafca98d4d20106b005b85abefdf3af39135b Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 6 Dec 2019 12:22:12 -0500 Subject: [core] Fix really overscaled lines #16018 --- metrics/ignores/platform-all.json | 123 ++++++++++++++++++++++++++++++ src/mbgl/renderer/buckets/line_bucket.cpp | 13 ++-- 2 files changed, 130 insertions(+), 6 deletions(-) create mode 100644 metrics/ignores/platform-all.json diff --git a/metrics/ignores/platform-all.json b/metrics/ignores/platform-all.json new file mode 100644 index 0000000000..44761324fc --- /dev/null +++ b/metrics/ignores/platform-all.json @@ -0,0 +1,123 @@ +{ + "expression-tests/collator/accent-equals-de": "Locale-specific behavior changes based on platform.", + "expression-tests/in/assert-array": "https://github.com/mapbox/mapbox-gl-native/issues/15893", + "expression-tests/in/assert-string": "https://github.com/mapbox/mapbox-gl-native/issues/15893", + "expression-tests/in/basic-array": "https://github.com/mapbox/mapbox-gl-native/issues/15893", + "expression-tests/in/basic-string": "https://github.com/mapbox/mapbox-gl-native/issues/15893", + "expression-tests/in/invalid-haystack": "https://github.com/mapbox/mapbox-gl-native/issues/15893", + "expression-tests/in/invalid-needle": "https://github.com/mapbox/mapbox-gl-native/issues/15893", + "expression-tests/interpolate-hcl/linear": "https://github.com/mapbox/mapbox-gl-native/issues/8720", + "expression-tests/interpolate-lab/linear": "https://github.com/mapbox/mapbox-gl-native/issues/8720", + "expression-tests/is-supported-script/default": "This tests RTL text plugin behavior specific to GL JS", + "expression-tests/legacy/categorical/array": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/categorical/boolean": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/categorical/color": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/categorical/number": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/categorical/string": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/exponential/color-hcl": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/exponential/color-lab": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/identity/color-default": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/identity/enum-default": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/interval/composite": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/interval/composite-default": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/legacy/interval/tokens-zoom": "https://github.com/mapbox/mapbox-gl-native/issues/12747", + "expression-tests/resolved-locale/basic": "Even the 'en' locale may not be present on some test systems.", + "probes/file-size/fail-file-doesnt-match": "Should fail, doesn't match the expectation.", + "probes/file-size/fail-file-not-found": "Should fail, file not found.", + "probes/file-size/fail-size-is-over": "Should fail, size is bigger than expected.", + "probes/file-size/fail-size-is-under": "Should fail, size is smaller than expected.", + "probes/gfx/fail-ib-mem-mismatch": "Should fail, combined byte size of index buffers doesn't match the expectation.", + "probes/gfx/fail-negative-framebuffer-count": "Should fail, number of frame buffers is higher than expected.", + "probes/gfx/fail-texture-mem-mismatch": "Should fail, combined byte size of textures doesn't match the expectation.", + "probes/gfx/fail-too-few-buffers": "Should fail, number of vertex and index buffers is smaller than expected.", + "probes/gfx/fail-too-few-textures": "Should fail, number of textures is smaller than expected.", + "probes/gfx/fail-too-many-drawcalls": "Should fail, number of draw calls higher than expected.", + "probes/gfx/fail-vb-mem-mismatch": "Should fail, combined byte size of index buffers doesn't match the expectation.", + "probes/memory/fail-memory-size-is-too-big": "Should fail, memory size is bigger than expected.", + "probes/memory/fail-memory-size-is-too-small": "Should fail, memory size is smaller than expected.", + "probes/memory/pass-memory-size-is-same": "TODO: Check with Mikhail why is this failing", + "probes/network/fail-requests": "Should fail, number of requests higher than expected.", + "probes/network/fail-requests-transferred": "Should fail, number of requests higher than expected and amount of transferred data less than expected.", + "probes/network/fail-transferred": "Should fail, amount of transferred data higher than expected.", + "query-tests/fill-extrusion-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701", + "query-tests/fill-extrusion/base-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-extrusion/box-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-extrusion/side-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-extrusion/sort": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-extrusion/sort-concave-inner": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-extrusion/sort-concave-outer": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-extrusion/sort-rotated": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-extrusion/top-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139", + "query-tests/fill-translate/multiple-layers": "https://github.com/mapbox/mapbox-gl-native/issues/12701", + "query-tests/geometry/multilinestring": "needs investigation", + "query-tests/geometry/multipolygon": "needs investigation", + "query-tests/geometry/polygon": "needs investigation", + "query-tests/regressions/mapbox-gl-js#6555": "skip - no querySourceFeatures in mbgl-node; needs issue", + "query-tests/regressions/mapbox-gl-js#7883": "https://github.com/mapbox/mapbox-gl-native/issues/14585", + "query-tests/world-wrapping/box": "skip - needs issue", + "render-tests/background-color/colorSpace-hcl": "needs issue", + "render-tests/background-color/transition": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/canvas/default": "skip - js specific", + "render-tests/canvas/update": "skip - js specific", + "render-tests/circle-sort-key/literal": "https://github.com/mapbox/mapbox-gl-native/issues/15008", + "render-tests/collator/default": "Some test platforms don't resolve 'en' locale", + "render-tests/collator/resolved-locale": "Some test platforms don't resolve 'en' locale", + "render-tests/custom-layer-js/depth": "skip - js specific", + "render-tests/custom-layer-js/null-island": "skip - js specific", + "render-tests/custom-layer-js/tent-3d": "skip - js specific", + "render-tests/debug/collision": "https://github.com/mapbox/mapbox-gl-native/issues/3841", + "render-tests/debug/overdraw": "https://github.com/mapbox/mapbox-gl-native/issues/15638", + "render-tests/debug/raster": "https://github.com/mapbox/mapbox-gl-native/issues/15510", + "render-tests/debug/tile": "https://github.com/mapbox/mapbox-gl-native/issues/3841", + "render-tests/debug/tile-overscaled": "https://github.com/mapbox/mapbox-gl-native/issues/3841", + "render-tests/extent/1024-circle": "needs investigation", + "render-tests/feature-state/promote-id": "https://github.com/mapbox/mapbox-gl-native/issues/16016", + "render-tests/fill-extrusion-geometry/linestring": "https://github.com/mapbox/mapbox-gl-native/pull/14240", + "render-tests/fill-extrusion-pattern/@2x": "https://github.com/mapbox/mapbox-gl-js/issues/3327", + "render-tests/fill-extrusion-pattern/feature-expression": "https://github.com/mapbox/mapbox-gl-js/issues/3327", + "render-tests/fill-extrusion-pattern/function": "https://github.com/mapbox/mapbox-gl-js/issues/3327", + "render-tests/fill-extrusion-pattern/function-2": "https://github.com/mapbox/mapbox-gl-js/issues/3327", + "render-tests/fill-extrusion-pattern/literal": "https://github.com/mapbox/mapbox-gl-js/issues/3327", + "render-tests/fill-extrusion-pattern/opacity": "https://github.com/mapbox/mapbox-gl-js/issues/3327", + "render-tests/fill-extrusion-pattern/tile-buffer": "https://github.com/mapbox/mapbox-gl-js/issues/3327", + "render-tests/fill-pattern/update-feature-state": "https://github.com/mapbox/mapbox-gl-native/issues/15895", + "render-tests/geojson/inline-linestring-fill": "current behavior is arbitrary", + "render-tests/icon-text-fit/stretch-fifteen-part": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-nine-part": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-nine-part-@2x": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-nine-part-content": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-nine-part-content-collision": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-nine-part-just-height": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-nine-part-just-width": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-three-part": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-two-part": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/stretch-underscale": "https://github.com/mapbox/mapbox-gl-native/issues/16017", + "render-tests/icon-text-fit/text-variable-anchor-overlap": "https://github.com/mapbox/mapbox-gl-native/issues/15809", + "render-tests/mixed-zoom/z10-z11": "https://github.com/mapbox/mapbox-gl-native/issues/10397", + "render-tests/raster-masking/overlapping-zoom": "https://github.com/mapbox/mapbox-gl-native/issues/10195", + "render-tests/real-world/bangkok": "https://github.com/mapbox/mapbox-gl-native/issues/10412", + "render-tests/real-world/chicago": "https://github.com/mapbox/mapbox-gl-native/issues/10412", + "render-tests/real-world/sanfrancisco": "https://github.com/mapbox/mapbox-gl-native/issues/10412", + "render-tests/regressions/mapbox-gl-js#2467": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/regressions/mapbox-gl-js#2762": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/regressions/mapbox-gl-js#2769": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/regressions/mapbox-gl-js#5740": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/regressions/mapbox-gl-js#5982": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/regressions/mapbox-gl-js#6655": "skip - port https://github.com/mapbox/mapbox-gl-js/pull/6263 - needs issue", + "render-tests/regressions/mapbox-gl-js#6706": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/regressions/mapbox-gl-js#6806": "pending https://github.com/mapbox/mapbox-gl-js/pull/6812", + "render-tests/regressions/mapbox-gl-js#7271": "https://github.com/mapbox/mapbox-gl-native/issues/12888", + "render-tests/regressions/mapbox-gl-js#7302": "skip - js specific", + "render-tests/regressions/mapbox-gl-js#7708": "skip - js specific", + "render-tests/regressions/mapbox-gl-js#8026": "skip - js specific", + "render-tests/regressions/mapbox-gl-js#8817": "skip - https://github.com/mapbox/mapbox-gl-native/issues/15737", + "render-tests/regressions/mapbox-gl-native#7357": "https://github.com/mapbox/mapbox-gl-native/issues/7357", + "render-tests/runtime-styling/image-add-remove-add": "skip - https://github.com/mapbox/mapbox-gl-native/issues/16021", + "render-tests/runtime-styling/pattern-add-remove-add": "skip - https://github.com/mapbox/mapbox-gl-native/issues/16021", + "render-tests/symbol-cross-fade/chinese": "https://github.com/mapbox/mapbox-gl-native/issues/10619", + "render-tests/text-max-width/zero-width-point-placement": "https://github.com/mapbox/mapbox-gl-native/issues/15648", + "render-tests/text-size/nan": "https://github.com/mapbox/mapbox-gl-native/issues/16020", + "render-tests/text-variable-anchor/remember-last-placement": "skip - fails on gl-native, as symbol index is not functional at static map mode - needs issue", + "render-tests/video/default": "skip - https://github.com/mapbox/mapbox-gl-native/issues/601", + "render-tests/zoomed-fill/negative-zoom": "https://github.com/mapbox/mapbox-gl-native/issues/16019" +} diff --git a/src/mbgl/renderer/buckets/line_bucket.cpp b/src/mbgl/renderer/buckets/line_bucket.cpp index e756722854..e272593e48 100644 --- a/src/mbgl/renderer/buckets/line_bucket.cpp +++ b/src/mbgl/renderer/buckets/line_bucket.cpp @@ -129,18 +129,19 @@ void LineBucket::addGeometry(const GeometryCoordinates& coordinates, const Geome total_length += util::dist(coordinates[i], coordinates[i + 1]); } - lineDistances = Distances{*numericValue(clip_start_it->second), - *numericValue(clip_end_it->second), - total_length}; + lineDistances = Distances{ + *numericValue(clip_start_it->second), *numericValue(clip_end_it->second), total_length}; } const LineJoinType joinType = layout.evaluate(zoom, feature); const float miterLimit = joinType == LineJoinType::Bevel ? 1.05f : float(layout.get()); - const double sharpCornerOffset = overscaling == 0 ? - SHARP_CORNER_OFFSET * (float(util::EXTENT) / util::tileSize) : - SHARP_CORNER_OFFSET * (float(util::EXTENT) / (util::tileSize * overscaling)); + const double sharpCornerOffset = + overscaling == 0 + ? SHARP_CORNER_OFFSET * (float(util::EXTENT) / util::tileSize) + : (overscaling <= 16.0 ? SHARP_CORNER_OFFSET * (float(util::EXTENT) / (util::tileSize * overscaling)) + : 0.0f); const GeometryCoordinate firstCoordinate = coordinates[first]; const LineCapType beginCap = layout.get(); -- cgit v1.2.1