Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feature/documentation…
Browse files Browse the repository at this point in the history
…-geojson

# Conflicts:
#	docs/mdbook/src/SUMMARY.md
#	platform/android/docs/geojson-guide.md
  • Loading branch information
jDilshodbek committed Nov 16, 2024
2 parents 03040e0 + e9afa1f commit 64a197c
Show file tree
Hide file tree
Showing 61 changed files with 3,193 additions and 1,138 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ jobs:
- name: Build libmaplibre.so for arm-v8
run: make android-lib-arm-v8

- name: Build documentation
- name: Build API documentation
run: ./gradlew dokkaHtml

- name: Build Examples documentation
run: make mkdocs-build

- name: Copy developer config with API key for UI tests
if: github.ref == 'refs/heads/main'
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/android-device-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
role-duration-seconds: 14400

- name: Run ${{ matrix.test.name }} on AWS Device Farm
run: |
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/gh-pages-android-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: gh-pages-android-examples

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'platform/android/**'

jobs:
gh-pages-android-examples:
runs-on: ubuntu-latest
defaults:
run:
working-directory: platform/android
shell: bash
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Generate documentation
run: make mkdocs-build

- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: platform/android/site
target-folder: android/examples/
12 changes: 7 additions & 5 deletions .github/workflows/gh-pages-mdbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ on:
push:
branches:
- main
paths:
- 'docs/mdbook/**'

jobs:
build-docs:
gh-pages-mdbook-build:
name: Build
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v2
Expand All @@ -27,10 +29,10 @@ jobs:
name: book
path: docs/mdbook/book/

deploy-docs:
needs: build-docs
gh-pages-mdbook-deploy:
needs: gh-pages-mdbook-build
name: Deploy
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download book
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/ios-device-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ jobs:
with:
files: "${{ matrix.test.xcTestFile }}, ${{ matrix.test.ipaFile }}"

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: us-west-2
role-to-assume: ${{ vars.OIDC_AWS_ROLE_TO_ASSUME }}
role-session-name: ${{ github.run_id }}
role-duration-seconds: 14400

- name: Run ${{ matrix.test.name }} on AWS Device Farm
if: steps.check_files.outputs.files_exists == 'true'
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'platform/node/.nvmrc'

- name: npm ci
working-directory: platform/node
Expand Down Expand Up @@ -297,7 +297,7 @@ jobs:
GALLIUM_DRIVER: softpipe
run: |
Invoke-WebRequest https://github.com/pal1000/mesa-dist-win/releases/download/22.3.5/mesa3d-22.3.5-release-msvc.7z -OutFile mesa3d.7z
& 'C:\Program Files\7-Zip\7z.exe' e -olib\node-v115 .\mesa3d.7z x64\opengl32.dll x64\libgallium_wgl.dll x64\libGLESv2.dll x64\libglapi.dll
& 'C:\Program Files\7-Zip\7z.exe' e -olib\node-v131 .\mesa3d.7z x64\opengl32.dll x64\libgallium_wgl.dll x64\libGLESv2.dll x64\libglapi.dll
npm test
# On PRs make sure that the npm package can be packaged.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/node-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'platform/node/.nvmrc'

- name: Check if version is published
id: check
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'platform/node/.nvmrc'

- name: npm ci
working-directory: platform/node
Expand Down Expand Up @@ -270,7 +270,7 @@ jobs:
- name: Use Node.js from nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version-file: 'platform/node/.nvmrc'

- name: Get version
id: package-version
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ compile_commands.json
/platform/ios/platform/ios/benchmark/assets/glyphs/Roboto Condensed Italic,Noto Sans Italic
/platform/ios/platform/ios/benchmark/assets/glyphs/Noto Sans Regular
/platform/android/key.json
/platform/android/site
node_modules
# Node binaries.
/lib
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repos:
rev: v5.0.0
hooks:
- id: check-yaml
args: [--allow-multiple-documents]
args: [--allow-multiple-documents, --unsafe]
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.3
hooks:
Expand Down
7 changes: 0 additions & 7 deletions docs/mdbook/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,5 @@
- [Android Map Rendering Data Flow](design/android-map-rendering-data-flow.md)
- [Geometry Tile Worker](design/geometry-tile-worker.md)

- [MapLibre Native for Android](./android/README.md)
- [Quickstart](./android/getting-started-guide.md)
- [Annotation: Marker](./android/annotation-guide.md)
- [Location Component](./android/location-component-guide.md)
- [MapOptions Guide](./android/map-options-guide.md)
- [GeoJSON Guide](./android/geojson-guide.md)

- [Profiling applications that use MapLibre Native](./profiling/README.md)
- [Tracy profiling](./profiling/tracy-profiling.md)
3 changes: 0 additions & 3 deletions docs/mdbook/src/android/README.md

This file was deleted.

100 changes: 0 additions & 100 deletions docs/mdbook/src/android/location-component-guide.md

This file was deleted.

26 changes: 14 additions & 12 deletions include/mbgl/shaders/mtl/line.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]],
const float ANTIALIASING = 1.0 / DEVICE_PIXEL_RATIO / 2.0;
const float2 a_extrude = float2(vertx.data.xy) - 128.0;
const float a_direction = fmod(float(vertx.data.z), 4.0) - 1.0;
const float a_direction = glMod(float(vertx.data.z), 4.0) - 1.0;
const float2 pos = floor(float2(vertx.pos_normal) * 0.5);
// x is 1 if it's a round cap, 0 otherwise
Expand Down Expand Up @@ -297,7 +297,7 @@ FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]],
const float ANTIALIASING = 1.0 / DEVICE_PIXEL_RATIO / 2.0;
const float2 a_extrude = float2(vertx.data.xy) - 128.0;
const float a_direction = fmod(float(vertx.data.z), 4.0) - 1.0;
const float a_direction = glMod(float(vertx.data.z), 4.0) - 1.0;
const float v_lineprogress = (floor(float(vertx.data.z) / 4.0) + vertx.data.w * 64.0) * 2.0 / MAX_LINE_DISTANCE;
const float2 pos = floor(float2(vertx.pos_normal) * 0.5);
Expand Down Expand Up @@ -501,7 +501,7 @@ FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]],
const float LINE_DISTANCE_SCALE = 2.0;
const float2 a_extrude = float2(vertx.data.xy) - 128.0;
const float a_direction = fmod(float(vertx.data.z), 4.0) - 1.0;
const float a_direction = glMod(float(vertx.data.z), 4.0) - 1.0;
const float linesofar = (floor(vertx.data.z / 4.0) + vertx.data.w * 64.0) * LINE_DISTANCE_SCALE;
const float2 pos = floor(float2(vertx.pos_normal) * 0.5);
Expand Down Expand Up @@ -731,16 +731,16 @@ FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]],
#if defined(HAS_UNIFORM_u_gapwidth)
const auto exprGapWidth = (props.expressionMask & LineExpressionMask::GapWidth);
const auto gapwidth = (exprGapWidth ? expr.gapwidth.eval(paintParams.zoom) : props.gapwidth) / 2;
const auto gapwidth = (exprGapWidth ? expr.gapwidth.eval(paintParams.zoom) : props.gapwidth) / 2.0;
#else
const auto gapwidth = unpack_mix_float(vertx.gapwidth, interp.gapwidth_t) / 2;
const auto gapwidth = unpack_mix_float(vertx.gapwidth, interp.gapwidth_t) / 2.0;
#endif
#if defined(HAS_UNIFORM_u_offset)
const auto exprOffset = (props.expressionMask & LineExpressionMask::Offset);
const auto offset = (exprOffset ? expr.offset.eval(paintParams.zoom) : props.offset) * -1;
const auto offset = (exprOffset ? expr.offset.eval(paintParams.zoom) : props.offset) * -1.0;
#else
const auto offset = unpack_mix_float(vertx.offset, interp.offset_t) * -1;
const auto offset = unpack_mix_float(vertx.offset, interp.offset_t) * -1.0;
#endif
#if defined(HAS_UNIFORM_u_width)
Expand All @@ -763,8 +763,8 @@ FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]],
const float LINE_DISTANCE_SCALE = 2.0;
const float2 a_extrude = float2(vertx.data.xy) - 128.0;
const float a_direction = fmod(float(vertx.data.z), 4.0) - 1.0;
float linesofar = (floor(vertx.data.z / 4.0) + vertx.data.w * 64.0) * LINE_DISTANCE_SCALE;
const float a_direction = glMod(float(vertx.data.z), 4.0) - 1.0;
float linesofar = (floor(float(vertx.data.z) / 4.0) + float(vertx.data.w) * 64.0) * LINE_DISTANCE_SCALE;
const float2 pos = floor(float2(vertx.pos_normal) * 0.5);
// x is 1 if it's a round cap, 0 otherwise
Expand Down Expand Up @@ -800,8 +800,8 @@ FragmentStage vertex vertexMain(thread const VertexStage vertx [[stage_in]],
.width2 = float2(outset, inset),
.normal = v_normal,
.gamma_scale = half(extrude_length_without_perspective / extrude_length_with_perspective),
.tex_a = float2(linesofar * drawable.patternscale_a.x / floorwidth, (normal.y * drawable.patternscale_a.y + drawable.tex_y_a) * 2.0),
.tex_b = float2(linesofar * drawable.patternscale_b.x / floorwidth, (normal.y * drawable.patternscale_b.y + drawable.tex_y_b) * 2.0),
.tex_a = float2(linesofar * drawable.patternscale_a.x / floorwidth, v_normal.y * drawable.patternscale_a.y + drawable.tex_y_a),
.tex_b = float2(linesofar * drawable.patternscale_b.x / floorwidth, v_normal.y * drawable.patternscale_b.y + drawable.tex_y_b),
#if !defined(HAS_UNIFORM_u_color)
.color = unpack_mix_color(vertx.color, interp.color_t),
Expand Down Expand Up @@ -857,14 +857,16 @@ half4 fragment fragmentMain(FragmentStage in [[stage_in]],
const auto floorwidth = in.floorwidth;
#endif
// Calculate the distance of the pixel from the line in pixels.
const float dist = length(in.normal) * in.width2.x;
// Calculate the antialiasing fade factor. This is either when fading in the
// line in case of an offset line (`v_width2.y`) or when fading out (`v_width2.x`)
const float blur2 = (blur + 1.0 / DEVICE_PIXEL_RATIO) * in.gamma_scale;
const float sdfdist_a = image0.sample(image0_sampler, in.tex_a).a;
const float sdfdist_b = image0.sample(image0_sampler, in.tex_b).a;
const float sdfdist = mix(sdfdist_a, sdfdist_b, drawable.mix);
const float dist = length(in.normal) * in.width2.x;
const float alpha = clamp(min(dist - (in.width2.y - blur2), in.width2.x - dist) / blur2, 0.0, 1.0) *
smoothstep(0.5 - drawable.sdfgamma / floorwidth, 0.5 + drawable.sdfgamma / floorwidth, sdfdist);
Expand Down
Loading

0 comments on commit 64a197c

Please sign in to comment.