Selectable renderer implementation (#1247)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
mwilsnd
2023-06-26 15:49:48 -05:00
committed by Bart Louwers
parent fe165c8924
commit 1963697687
64 changed files with 1189 additions and 316 deletions

1
.gitignore vendored
View File

@@ -44,3 +44,4 @@ node_modules
/bazel-*
CMakeLists.txt.user
CMakeFiles
__generated__

View File

@@ -1,15 +1,32 @@
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load(
"//bazel:core.bzl",
"MLN_CORE_HEADERS",
"MLN_CORE_SOURCE",
"MLN_GENERATED_SHADER_HEADERS",
"MLN_GENERATED_STYLE_SOURCE",
"MLN_OPENGL_HEADERS",
"MLN_OPENGL_SOURCE",
"MLN_PRIVATE_GENERATED_STYLE_HEADERS",
"MLN_PUBLIC_GENERATED_STYLE_HEADERS",
load("//bazel:core.bzl", "MLN_CORE_SOURCE", "MLN_CORE_HEADERS", "MLN_OPENGL_SOURCE", "MLN_OPENGL_HEADERS", "MLN_DRAWABLES_SOURCE", "MLN_DRAWABLES_HEADERS")
string_flag(
name = "renderer",
build_setting_default = "drawable",
values=["legacy", "drawable", "split"]
)
config_setting(
name = "legacy_renderer",
flag_values = {
":renderer": "legacy"
}
)
config_setting(
name = "drawable_renderer",
flag_values = {
":renderer": "drawable"
}
)
config_setting(
name = "split_renderer",
flag_values = {
":renderer": "split"
}
)
# Generate code required by the core
@@ -76,15 +93,24 @@ cc_library(
# the prefix from the path.
cc_library(
name = "mbgl-core",
srcs = MLN_CORE_SOURCE +
MLN_GENERATED_STYLE_SOURCE +
MLN_OPENGL_SOURCE,
hdrs = MLN_CORE_HEADERS +
MLN_OPENGL_HEADERS,
srcs = MLN_CORE_SOURCE + select({
":drawable_renderer": MLN_DRAWABLES_SOURCE,
":split_renderer": MLN_DRAWABLES_SOURCE,
"//conditions:default": []
}) + MLN_OPENGL_SOURCE,
hdrs = MLN_CORE_HEADERS + select({
":drawable_renderer": MLN_DRAWABLES_HEADERS,
":split_renderer": MLN_DRAWABLES_HEADERS,
"//conditions:default": []
}) + MLN_OPENGL_HEADERS,
copts = CPP_FLAGS + MAPLIBRE_FLAGS,
defines = select({
":legacy_renderer": ["MLN_LEGACY_RENDERER=1", "MLN_DRAWABLE_RENDERER=0"],
":drawable_renderer": ["MLN_LEGACY_RENDERER=0", "MLN_DRAWABLE_RENDERER=1"],
":split_renderer": ["MLN_LEGACY_RENDERER=1", "MLN_DRAWABLE_RENDERER=1", "MLN_RENDERER_SPLIT_VIEW=1"],
}) + select({
"//:ios": ["GLES_SILENCE_DEPRECATION=1"],
"//conditions:default": [],
"//conditions:default": []
}),
includes = [
"include",

View File

@@ -11,6 +11,10 @@ option(MLN_WITH_OPENGL "Build with OpenGL renderer" ON)
option(MLN_WITH_EGL "Build with EGL renderer" OFF)
option(MLN_WITH_OSMESA "Build with OSMesa (Software) renderer" OFF)
option(MLN_WITH_WERROR "Make all compilation warnings errors" ON)
option(MLN_LEGACY_RENDERER "Include the legacy rendering pathway" OFF)
option(MLN_DRAWABLE_RENDERER "Include the drawable rendering pathway" ON)
option(MLN_RENDERER_SPLIT_VIEW "Enable a split view if both renderers are enabled" ON)
option(MLN_RENDERER_QUAD_SPLIT_VIEW "When using split view, split opaque and translucent passes as well" OFF)
if (MLN_WITH_CLANG_TIDY)
find_program(CLANG_TIDY_COMMAND NAMES clang-tidy)
@@ -130,6 +134,75 @@ else()
add_library(mbgl-core STATIC)
endif()
if(MLN_DRAWABLE_RENDERER)
list(APPEND INCLUDE_FILES
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_data.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_impl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_builder.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/uniform_block.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/uniform_buffer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/vertex_attribute.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/texture2d.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/change_request.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/layer_group.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/shader_program_base.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/shader_program_mtl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/identity.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/suppress_copies.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/shader_program_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl_builder.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/layer_group_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/uniform_block_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/uniform_buffer_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/vertex_attribute_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/texture2d.hpp
)
list(APPEND SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable_builder.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable_builder_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/uniform_block.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/uniform_buffer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/vertex_attribute.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/change_request.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layer_group.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/tile_layer_group.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/background_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/background_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/circle_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/circle_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/fill_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/fill_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/raster_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/raster_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/shader_program_base.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/shader_program_mtl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/identity.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/gl/shader_program_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl_builder.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/layer_group_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/texture2d.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_block_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_buffer_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_attribute_gl.cpp
)
endif()
list(APPEND INCLUDE_FILES
${PROJECT_SOURCE_DIR}/include/mbgl/actor/actor.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/actor/actor_ref.hpp
@@ -140,22 +213,13 @@ list(APPEND INCLUDE_FILES
${PROJECT_SOURCE_DIR}/include/mbgl/actor/scheduler.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/annotation/annotation.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/backend_scope.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_data.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_impl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_builder.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/drawable_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/gfx_types.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/renderable.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/renderer_backend.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/rendering_stats.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/shader_group.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/shader_registry.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/shader_group.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/shader.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/uniform_block.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/uniform_buffer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/vertex_attribute.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/texture2d.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/types.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/layermanager/background_layer_factory.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/layermanager/circle_layer_factory.hpp
@@ -185,16 +249,10 @@ list(APPEND INCLUDE_FILES
${PROJECT_SOURCE_DIR}/include/mbgl/platform/settings.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/platform/thread.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/query.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/layer_group.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/renderer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/renderer_frontend.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/renderer_observer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/renderer_state.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/shader_program_base.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/shader_group_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/shader_program_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/shader_program_mtl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/storage/database_file_source.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/storage/file_source.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/storage/file_source_manager.hpp
@@ -315,7 +373,6 @@ list(APPEND INCLUDE_FILES
${PROJECT_SOURCE_DIR}/include/mbgl/util/geo.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/geojson.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/geometry.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/identity.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/ignore.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/image.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/immutable.hpp
@@ -330,7 +387,6 @@ list(APPEND INCLUDE_FILES
${PROJECT_SOURCE_DIR}/include/mbgl/util/run_loop.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/size.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/string.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/suppress_copies.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/tile_server_options.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/thread.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/util/tileset.hpp
@@ -384,11 +440,7 @@ list(APPEND SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/depth_mode.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/draw_mode.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/draw_scope.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/image_drawable_data.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable_builder.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable_builder_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/drawable_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/index_buffer.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/index_vector.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/offscreen_texture.hpp
@@ -397,15 +449,12 @@ list(APPEND SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/renderbuffer.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/renderer_backend.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/rendering_stats.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/shader_group.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/shader_registry.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/shader_group.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/stencil_mode.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/texture.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/uniform.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/uniform_block.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/uniform_buffer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/upload_pass.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/vertex_attribute.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/vertex_buffer.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gfx/vertex_vector.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/layermanager/background_layer_factory.cpp
@@ -527,17 +576,6 @@ list(APPEND SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/image_manager.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/image_manager.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/image_manager_observer.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layer_group.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/tile_layer_group.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/background_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/background_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/circle_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/circle_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/fill_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/fill_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/raster_layer_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/raster_layer_tweaker.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_background_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_background_layer.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_circle_layer.cpp
@@ -611,9 +649,6 @@ list(APPEND SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/transition_parameters.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/update_parameters.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/upload_parameters.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/shader_program_base.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/gl/shader_program_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/shader_program_mtl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/sprite/sprite_loader.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/sprite/sprite_loader.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/sprite/sprite_loader_observer.hpp
@@ -866,7 +901,6 @@ list(APPEND SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/util/http_header.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/http_timeout.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/http_timeout.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/identity.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/i18n.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/i18n.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/util/interpolate.cpp
@@ -922,29 +956,27 @@ if(MLN_WITH_OPENGL)
message(STATUS "Configuring GL-Native with OpenGL renderer backend")
target_compile_definitions(
mbgl-core
PRIVATE MBGL_RENDER_BACKEND_OPENGL=1
PRIVATE
MBGL_RENDER_BACKEND_OPENGL=1
"MLN_RENDERER_SPLIT_VIEW=$<BOOL:${MLN_RENDERER_SPLIT_VIEW}>"
"MLN_RENDERER_QUAD_SPLIT_VIEW=$<BOOL:${MLN_RENDERER_QUAD_SPLIT_VIEW}>"
PUBLIC
"MLN_LEGACY_RENDERER=$<BOOL:${MLN_LEGACY_RENDERER}>"
"MLN_DRAWABLE_RENDERER=$<BOOL:${MLN_DRAWABLE_RENDERER}>"
)
list(APPEND
INCLUDE_FILES
${PROJECT_SOURCE_DIR}/include/mbgl/gfx/backend.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/custom_layer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/custom_layer_factory.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl_builder.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/drawable_gl_tweaker.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/layer_group_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/renderable_resource.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/renderer_backend.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/uniform_block_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/uniform_buffer_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/vertex_attribute_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/gl/texture2d.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/layermanager/location_indicator_layer_factory.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/platform/gl_functions.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/renderer/change_request.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/style/layers/location_indicator_layer.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/shader_source.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/shader_manifest.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/shader_group_gl.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/prelude.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/background.hpp
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_background.hpp
@@ -997,17 +1029,12 @@ if(MLN_WITH_OPENGL)
${PROJECT_SOURCE_DIR}/src/mbgl/gl/debugging_extension.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/defines.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/draw_scope_resource.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl_builder.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/drawable_gl_tweaker.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/enum.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/enum.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/extension.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/framebuffer.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/index_buffer_resource.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/index_buffer_resource.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/layer_group_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/object.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/object.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/offscreen_texture.cpp
@@ -1022,26 +1049,21 @@ if(MLN_WITH_OPENGL)
${PROJECT_SOURCE_DIR}/src/mbgl/gl/state.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/texture.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/texture.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/texture2d.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/texture_resource.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/texture_resource.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/types.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_block_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_buffer_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/upload_pass.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/upload_pass.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/value.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/value.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_array.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_array.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_attribute_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_buffer_resource.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_buffer_resource.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/layermanager/location_indicator_layer_factory.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/platform/gl_functions.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/change_request.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_location_indicator_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_location_indicator_layer.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/location_indicator_layer.cpp

View File

@@ -10,8 +10,8 @@ http_archive(
http_archive(
name = "rules_xcodeproj",
sha256 = "5baccdd6a2734a0adeb9cb6175691d0609f8bdbd7c5f516e828d0df744ee9f6c",
url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/1.9.1/release.tar.gz",
sha256 = "f836d2a516a911dc0ace44b1f51aa575613f149a934f4be1e7bd551a549672ff",
url = "https://github.com/MobileNativeFoundation/rules_xcodeproj/releases/download/1.7.1/release.tar.gz",
)
load(
@@ -51,9 +51,9 @@ xcodeproj_rules_dependencies()
load(
"@build_bazel_rules_apple//apple:apple.bzl",
"provisioning_profile_repository",
"provisioning_profile_repository"
)
provisioning_profile_repository(
name = "local_provisioning_profiles",
)
name = "local_provisioning_profiles"
)

View File

@@ -1,85 +1,10 @@
MLN_PUBLIC_GENERATED_STYLE_HEADERS = [
"include/mbgl/style/layers/circle_layer.hpp",
"include/mbgl/style/layers/fill_layer.hpp",
"include/mbgl/style/layers/line_layer.hpp",
"include/mbgl/style/layers/symbol_layer.hpp",
"include/mbgl/style/layers/heatmap_layer.hpp",
"include/mbgl/style/layers/fill_extrusion_layer.hpp",
"include/mbgl/style/layers/raster_layer.hpp",
"include/mbgl/style/layers/hillshade_layer.hpp",
"include/mbgl/style/layers/background_layer.hpp",
"include/mbgl/style/layers/location_indicator_layer.hpp",
"include/mbgl/style/light.hpp",
]
MLN_PRIVATE_GENERATED_STYLE_HEADERS = [
"src/mbgl/style/layers/fill_layer_properties.hpp",
"src/mbgl/style/layers/line_layer_properties.hpp",
"src/mbgl/style/layers/symbol_layer_properties.hpp",
"src/mbgl/style/layers/circle_layer_properties.hpp",
"src/mbgl/style/layers/heatmap_layer_properties.hpp",
"src/mbgl/style/layers/fill_extrusion_layer_properties.hpp",
"src/mbgl/style/layers/raster_layer_properties.hpp",
"src/mbgl/style/layers/hillshade_layer_properties.hpp",
"src/mbgl/style/layers/background_layer_properties.hpp",
"src/mbgl/style/layers/location_indicator_layer_properties.hpp",
]
MLN_GENERATED_STYLE_SOURCE = [
"src/mbgl/style/layers/fill_layer_properties.cpp",
"src/mbgl/style/layers/fill_layer.cpp",
"src/mbgl/style/layers/line_layer_properties.cpp",
"src/mbgl/style/layers/line_layer.cpp",
"src/mbgl/style/layers/symbol_layer_properties.cpp",
"src/mbgl/style/layers/symbol_layer.cpp",
"src/mbgl/style/layers/circle_layer_properties.cpp",
"src/mbgl/style/layers/circle_layer.cpp",
"src/mbgl/style/layers/heatmap_layer_properties.cpp",
"src/mbgl/style/layers/heatmap_layer.cpp",
"src/mbgl/style/layers/fill_extrusion_layer_properties.cpp",
"src/mbgl/style/layers/fill_extrusion_layer.cpp",
"src/mbgl/style/layers/raster_layer_properties.cpp",
"src/mbgl/style/layers/raster_layer.cpp",
"src/mbgl/style/layers/hillshade_layer_properties.cpp",
"src/mbgl/style/layers/hillshade_layer.cpp",
"src/mbgl/style/layers/background_layer_properties.cpp",
"src/mbgl/style/layers/background_layer.cpp",
"src/mbgl/style/layers/location_indicator_layer_properties.cpp",
"src/mbgl/style/layers/location_indicator_layer.cpp",
"src/mbgl/style/light.cpp",
]
MLN_GENERATED_SHADER_HEADERS = [
"include/mbgl/shaders/shader_source.hpp",
"include/mbgl/shaders/shader_manifest.hpp",
"include/mbgl/shaders/gl/background.hpp",
"include/mbgl/shaders/gl/background_pattern.hpp",
"include/mbgl/shaders/gl/circle.hpp",
"include/mbgl/shaders/gl/clipping_mask.hpp",
"include/mbgl/shaders/gl/collision_box.hpp",
"include/mbgl/shaders/gl/collision_circle.hpp",
"include/mbgl/shaders/gl/debug.hpp",
"include/mbgl/shaders/gl/fill_extrusion_pattern.hpp",
"include/mbgl/shaders/gl/fill_extrusion.hpp",
"include/mbgl/shaders/gl/fill_outline_pattern.hpp",
"include/mbgl/shaders/gl/fill_outline.hpp",
"include/mbgl/shaders/gl/fill_pattern.hpp",
"include/mbgl/shaders/gl/fill.hpp",
"include/mbgl/shaders/gl/heatmap_texture.hpp",
"include/mbgl/shaders/gl/heatmap.hpp",
"include/mbgl/shaders/gl/hillshade_prepare.hpp",
"include/mbgl/shaders/gl/hillshade.hpp",
"include/mbgl/shaders/gl/line_gradient.hpp",
"include/mbgl/shaders/gl/line_pattern.hpp",
"include/mbgl/shaders/gl/line_sdf.hpp",
"include/mbgl/shaders/gl/line.hpp",
"include/mbgl/shaders/gl/prelude.hpp",
"include/mbgl/shaders/gl/raster.hpp",
"include/mbgl/shaders/gl/symbol_icon.hpp",
"include/mbgl/shaders/gl/symbol_sdf_text.hpp",
"include/mbgl/shaders/gl/symbol_sdf_icon.hpp",
"include/mbgl/shaders/gl/symbol_text_and_icon.hpp",
]
# MLN_RENDERER_DEFINES = select({
# ":legacy_renderer": ["MLN_LEGACY_RENDERER=1"],
# "//conditions:default": ["MLN_LEGACY_RENDERER=0"]
# }) + select({
# ":drawable_renderer": ["MLN_DRAWABLE_RENDERER=1"],
# "//conditions:default": ["MLN_DRAWABLE_RENDERER=0"]
# })
MLN_CORE_SOURCE = [
"src/mbgl/actor/mailbox.cpp",
@@ -120,6 +45,7 @@ MLN_CORE_SOURCE = [
"src/mbgl/gfx/depth_mode.hpp",
"src/mbgl/gfx/draw_mode.hpp",
"src/mbgl/gfx/draw_scope.hpp",
"src/mbgl/gfx/image_drawable_data.hpp",
"src/mbgl/gfx/index_buffer.hpp",
"src/mbgl/gfx/index_vector.hpp",
"src/mbgl/gfx/offscreen_texture.hpp",
@@ -129,9 +55,9 @@ MLN_CORE_SOURCE = [
"src/mbgl/gfx/renderer_backend.cpp",
"src/mbgl/gfx/rendering_stats.cpp",
"src/mbgl/gfx/shader_registry.cpp",
"src/mbgl/gfx/shader_group.cpp",
"src/mbgl/gfx/stencil_mode.hpp",
"src/mbgl/gfx/texture.hpp",
"src/mbgl/gfx/types.hpp",
"src/mbgl/gfx/uniform.hpp",
"src/mbgl/gfx/upload_pass.hpp",
"src/mbgl/gfx/vertex_buffer.hpp",
@@ -398,7 +324,6 @@ MLN_CORE_SOURCE = [
"src/mbgl/style/expression/match.cpp",
"src/mbgl/style/expression/number_format.cpp",
"src/mbgl/style/expression/parsing_context.cpp",
"src/mbgl/style/expression/slice.cpp",
"src/mbgl/style/expression/step.cpp",
"src/mbgl/style/expression/util.cpp",
"src/mbgl/style/expression/util.hpp",
@@ -412,25 +337,53 @@ MLN_CORE_SOURCE = [
"src/mbgl/style/layer_impl.cpp",
"src/mbgl/style/layer_impl.hpp",
"src/mbgl/style/layer_observer.hpp",
"src/mbgl/style/layers/background_layer.cpp",
"src/mbgl/style/layers/background_layer_impl.cpp",
"src/mbgl/style/layers/background_layer_impl.hpp",
"src/mbgl/style/layers/background_layer_properties.cpp",
"src/mbgl/style/layers/background_layer_properties.hpp",
"src/mbgl/style/layers/circle_layer.cpp",
"src/mbgl/style/layers/circle_layer_impl.cpp",
"src/mbgl/style/layers/circle_layer_impl.hpp",
"src/mbgl/style/layers/circle_layer_properties.cpp",
"src/mbgl/style/layers/circle_layer_properties.hpp",
"src/mbgl/style/layers/fill_extrusion_layer.cpp",
"src/mbgl/style/layers/fill_extrusion_layer_impl.cpp",
"src/mbgl/style/layers/fill_extrusion_layer_impl.hpp",
"src/mbgl/style/layers/fill_extrusion_layer_properties.cpp",
"src/mbgl/style/layers/fill_extrusion_layer_properties.hpp",
"src/mbgl/style/layers/fill_layer.cpp",
"src/mbgl/style/layers/fill_layer_impl.cpp",
"src/mbgl/style/layers/fill_layer_impl.hpp",
"src/mbgl/style/layers/fill_layer_properties.cpp",
"src/mbgl/style/layers/fill_layer_properties.hpp",
"src/mbgl/style/layers/heatmap_layer.cpp",
"src/mbgl/style/layers/heatmap_layer_impl.cpp",
"src/mbgl/style/layers/heatmap_layer_impl.hpp",
"src/mbgl/style/layers/heatmap_layer_properties.cpp",
"src/mbgl/style/layers/heatmap_layer_properties.hpp",
"src/mbgl/style/layers/hillshade_layer.cpp",
"src/mbgl/style/layers/hillshade_layer_impl.cpp",
"src/mbgl/style/layers/hillshade_layer_impl.hpp",
"src/mbgl/style/layers/hillshade_layer_properties.cpp",
"src/mbgl/style/layers/hillshade_layer_properties.hpp",
"src/mbgl/style/layers/line_layer.cpp",
"src/mbgl/style/layers/line_layer_impl.cpp",
"src/mbgl/style/layers/line_layer_impl.hpp",
"src/mbgl/style/layers/line_layer_properties.cpp",
"src/mbgl/style/layers/line_layer_properties.hpp",
"src/mbgl/style/layers/raster_layer.cpp",
"src/mbgl/style/layers/raster_layer_impl.cpp",
"src/mbgl/style/layers/raster_layer_impl.hpp",
"src/mbgl/style/layers/raster_layer_properties.cpp",
"src/mbgl/style/layers/raster_layer_properties.hpp",
"src/mbgl/style/layers/symbol_layer.cpp",
"src/mbgl/style/layers/symbol_layer_impl.cpp",
"src/mbgl/style/layers/symbol_layer_impl.hpp",
"src/mbgl/style/layers/symbol_layer_properties.cpp",
"src/mbgl/style/layers/symbol_layer_properties.hpp",
"src/mbgl/style/layout_property.hpp",
"src/mbgl/style/light.cpp",
"src/mbgl/style/light_impl.cpp",
"src/mbgl/style/light_impl.hpp",
"src/mbgl/style/light_observer.hpp",
@@ -541,7 +494,6 @@ MLN_CORE_SOURCE = [
"src/mbgl/util/dtoa.cpp",
"src/mbgl/util/dtoa.hpp",
"src/mbgl/util/event.cpp",
"src/mbgl/util/filesystem.hpp",
"src/mbgl/util/font_stack.cpp",
"src/mbgl/util/geo.cpp",
"src/mbgl/util/geojson_impl.cpp",
@@ -603,7 +555,7 @@ MLN_CORE_SOURCE = [
"src/mbgl/util/utf.hpp",
"src/mbgl/util/version.cpp",
"src/mbgl/util/version.hpp",
"src/mbgl/util/work_request.cpp",
"src/mbgl/util/work_request.cpp"
]
MLN_CORE_HEADERS = [
@@ -616,11 +568,14 @@ MLN_CORE_HEADERS = [
"include/mbgl/actor/scheduler.hpp",
"include/mbgl/annotation/annotation.hpp",
"include/mbgl/gfx/backend_scope.hpp",
"include/mbgl/gfx/gfx_types.hpp",
"include/mbgl/gfx/renderable.hpp",
"include/mbgl/gfx/renderer_backend.hpp",
"include/mbgl/gfx/rendering_stats.hpp",
"include/mbgl/gfx/shader_registry.hpp",
"include/mbgl/gfx/shader_group.hpp",
"include/mbgl/gfx/shader.hpp",
"include/mbgl/gfx/types.hpp",
"include/mbgl/i18n/collator.hpp",
"include/mbgl/i18n/number_format.hpp",
"include/mbgl/layermanager/background_layer_factory.hpp",
@@ -720,7 +675,6 @@ MLN_CORE_HEADERS = [
"include/mbgl/style/expression/match.hpp",
"include/mbgl/style/expression/number_format.hpp",
"include/mbgl/style/expression/parsing_context.hpp",
"include/mbgl/style/expression/slice.hpp",
"include/mbgl/style/expression/step.hpp",
"include/mbgl/style/expression/type.hpp",
"include/mbgl/style/expression/value.hpp",
@@ -729,6 +683,16 @@ MLN_CORE_HEADERS = [
"include/mbgl/style/image.hpp",
"include/mbgl/style/layer.hpp",
"include/mbgl/style/layer_properties.hpp",
"include/mbgl/style/layers/background_layer.hpp",
"include/mbgl/style/layers/circle_layer.hpp",
"include/mbgl/style/layers/fill_extrusion_layer.hpp",
"include/mbgl/style/layers/fill_layer.hpp",
"include/mbgl/style/layers/heatmap_layer.hpp",
"include/mbgl/style/layers/hillshade_layer.hpp",
"include/mbgl/style/layers/line_layer.hpp",
"include/mbgl/style/layers/raster_layer.hpp",
"include/mbgl/style/layers/symbol_layer.hpp",
"include/mbgl/style/light.hpp",
"include/mbgl/style/position.hpp",
"include/mbgl/style/property_expression.hpp",
"include/mbgl/style/property_value.hpp",
@@ -794,7 +758,7 @@ MLN_CORE_HEADERS = [
"include/mbgl/util/vectors.hpp",
"include/mbgl/util/work_request.hpp",
"include/mbgl/util/work_task.hpp",
"include/mbgl/util/work_task_impl.hpp",
"include/mbgl/util/work_task_impl.hpp"
]
MLN_OPENGL_SOURCE = [
@@ -849,8 +813,11 @@ MLN_OPENGL_SOURCE = [
"src/mbgl/platform/gl_functions.cpp",
"src/mbgl/renderer/layers/render_location_indicator_layer.cpp",
"src/mbgl/renderer/layers/render_location_indicator_layer.hpp",
"src/mbgl/style/layers/location_indicator_layer.cpp",
"src/mbgl/style/layers/location_indicator_layer_impl.cpp",
"src/mbgl/style/layers/location_indicator_layer_impl.hpp",
"src/mbgl/style/layers/location_indicator_layer_properties.cpp",
"src/mbgl/style/layers/location_indicator_layer_properties.hpp"
]
MLN_OPENGL_HEADERS = [
@@ -861,4 +828,106 @@ MLN_OPENGL_HEADERS = [
"include/mbgl/gl/renderer_backend.hpp",
"include/mbgl/layermanager/location_indicator_layer_factory.hpp",
"include/mbgl/platform/gl_functions.hpp",
"include/mbgl/style/layers/location_indicator_layer.hpp",
"include/mbgl/shaders/shader_source.hpp",
"include/mbgl/shaders/shader_manifest.hpp",
"include/mbgl/shaders/gl/shader_group_gl.hpp",
"include/mbgl/shaders/gl/prelude.hpp",
"include/mbgl/shaders/gl/background.hpp",
"include/mbgl/shaders/gl/drawable_background.hpp",
"include/mbgl/shaders/gl/drawable_background_pattern.hpp",
"include/mbgl/shaders/gl/drawable_circle.hpp",
"include/mbgl/shaders/gl/drawable_fill.hpp",
"include/mbgl/shaders/gl/drawable_fill_outline.hpp",
"include/mbgl/shaders/gl/drawable_fill_outline_pattern.hpp",
"include/mbgl/shaders/gl/drawable_fill_pattern.hpp",
"include/mbgl/shaders/gl/drawable_raster.hpp",
"include/mbgl/shaders/gl/background_pattern.hpp",
"include/mbgl/shaders/gl/circle.hpp",
"include/mbgl/shaders/gl/clipping_mask.hpp",
"include/mbgl/shaders/gl/collision_box.hpp",
"include/mbgl/shaders/gl/collision_circle.hpp",
"include/mbgl/shaders/gl/debug.hpp",
"include/mbgl/shaders/gl/fill_extrusion_pattern.hpp",
"include/mbgl/shaders/gl/fill_extrusion.hpp",
"include/mbgl/shaders/gl/fill_outline_pattern.hpp",
"include/mbgl/shaders/gl/fill_outline.hpp",
"include/mbgl/shaders/gl/fill_pattern.hpp",
"include/mbgl/shaders/gl/fill.hpp",
"include/mbgl/shaders/gl/heatmap_texture.hpp",
"include/mbgl/shaders/gl/heatmap.hpp",
"include/mbgl/shaders/gl/hillshade_prepare.hpp",
"include/mbgl/shaders/gl/hillshade.hpp",
"include/mbgl/shaders/gl/line_gradient.hpp",
"include/mbgl/shaders/gl/line_pattern.hpp",
"include/mbgl/shaders/gl/line_sdf.hpp",
"include/mbgl/shaders/gl/line.hpp",
"include/mbgl/shaders/gl/raster.hpp",
"include/mbgl/shaders/gl/symbol_icon.hpp",
"include/mbgl/shaders/gl/symbol_sdf_text.hpp",
"include/mbgl/shaders/gl/symbol_sdf_icon.hpp",
"include/mbgl/shaders/gl/symbol_text_and_icon.hpp"
]
MLN_DRAWABLES_SOURCE = [
"src/mbgl/gfx/drawable.cpp",
"src/mbgl/gfx/drawable_builder.cpp",
"src/mbgl/gfx/drawable_builder_impl.hpp",
"src/mbgl/gfx/drawable_tweaker.cpp",
"src/mbgl/gfx/uniform_block.cpp",
"src/mbgl/gfx/uniform_buffer.cpp",
"src/mbgl/gfx/vertex_attribute.cpp",
"src/mbgl/renderer/change_request.cpp",
"src/mbgl/renderer/layer_group.cpp",
"src/mbgl/renderer/tile_layer_group.cpp",
"src/mbgl/renderer/layer_tweaker.cpp",
"src/mbgl/renderer/layers/background_layer_tweaker.cpp",
"src/mbgl/renderer/layers/background_layer_tweaker.hpp",
"src/mbgl/renderer/layers/circle_layer_tweaker.cpp",
"src/mbgl/renderer/layers/circle_layer_tweaker.hpp",
"src/mbgl/renderer/layers/fill_layer_tweaker.cpp",
"src/mbgl/renderer/layers/fill_layer_tweaker.hpp",
"src/mbgl/renderer/layers/raster_layer_tweaker.cpp",
"src/mbgl/renderer/layers/raster_layer_tweaker.hpp",
"src/mbgl/shaders/shader_program_base.cpp",
"src/mbgl/shaders/mtl/shader_program_mtl.cpp",
"src/mbgl/util/identity.cpp",
"src/mbgl/shaders/gl/shader_program_gl.cpp",
"src/mbgl/gl/drawable_gl.cpp",
"src/mbgl/gl/drawable_gl_builder.cpp",
"src/mbgl/gl/drawable_gl_impl.hpp",
"src/mbgl/gl/drawable_gl_tweaker.cpp",
"src/mbgl/gl/layer_group_gl.cpp",
"src/mbgl/gl/texture2d.cpp",
"src/mbgl/gl/uniform_block_gl.cpp",
"src/mbgl/gl/uniform_buffer_gl.cpp",
"src/mbgl/gl/vertex_attribute_gl.cpp"
]
MLN_DRAWABLES_HEADERS = [
"include/mbgl/gfx/drawable.hpp",
"include/mbgl/gfx/drawable_data.hpp",
"include/mbgl/gfx/drawable_impl.hpp",
"include/mbgl/gfx/drawable_builder.hpp",
"include/mbgl/gfx/drawable_tweaker.hpp",
"include/mbgl/gfx/uniform_block.hpp",
"include/mbgl/gfx/uniform_buffer.hpp",
"include/mbgl/gfx/vertex_attribute.hpp",
"include/mbgl/gfx/texture2d.hpp",
"include/mbgl/renderer/change_request.hpp",
"include/mbgl/renderer/layer_group.hpp",
"include/mbgl/renderer/layer_tweaker.hpp",
"include/mbgl/shaders/shader_program_base.hpp",
"include/mbgl/shaders/mtl/shader_program_mtl.hpp",
"include/mbgl/util/identity.hpp",
"include/mbgl/util/suppress_copies.hpp",
"include/mbgl/shaders/gl/shader_program_gl.hpp",
"include/mbgl/gl/drawable_gl.hpp",
"include/mbgl/gl/drawable_gl_builder.hpp",
"include/mbgl/gl/drawable_gl_tweaker.hpp",
"include/mbgl/gl/layer_group_gl.hpp",
"include/mbgl/gl/uniform_block_gl.hpp",
"include/mbgl/gl/uniform_buffer_gl.hpp",
"include/mbgl/gl/vertex_attribute_gl.hpp",
"include/mbgl/gl/texture2d.hpp"
]

View File

@@ -44,8 +44,10 @@ public:
/// Returns a reference to the default surface that should be rendered on.
virtual Renderable& getDefaultRenderable() = 0;
#if MLN_DRAWABLE_RENDERER
/// One-time shader initialization
virtual void initShaders(gfx::ShaderRegistry&, const ProgramParameters&) = 0;
#endif
protected:
virtual std::unique_ptr<Context> createContext() = 0;

View File

@@ -11,8 +11,6 @@ class Size;
namespace gfx {
constexpr int32_t MaxActiveTextureUnits = 8;
class Context;
class UploadPass;
class TextureResource;

View File

@@ -22,8 +22,10 @@ public:
/// Called prior to rendering to update the internally assumed OpenGL state.
virtual void updateAssumedState() = 0;
#if MLN_DRAWABLE_RENDERER
/// One-time shader initialization
void initShaders(gfx::ShaderRegistry&, const ProgramParameters& programParameters) override;
#endif
protected:
std::unique_ptr<gfx::Context> createContext() override;

View File

@@ -1,6 +1,8 @@
#pragma once
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/drawable.hpp>
#endif
#include <memory>

View File

@@ -58,6 +58,40 @@ android {
buildConfigField "String", "MAPBOX_VERSION_STRING", String.format("\"Mapbox/%s\"", project.VERSION_NAME)
buildConfigField "String", "MAPBOX_EVENTS_USER_AGENT", String.format("\"mapbox-maps-android/%s\"", project.VERSION_NAME)
consumerProguardFiles 'proguard-rules.pro'
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=OFF", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
flavorDimensions += "renderer"
productFlavors {
create("legacy") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=OFF", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
create("drawable") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=OFF", "-DMLN_DRAWABLE_RENDERER=ON", "-DMLN_RENDERER_SPLIT_VIEW=OFF"
}
}
}
create("split") {
dimension = "renderer"
externalNativeBuild {
cmake {
arguments "-DMLN_LEGACY_RENDERER=ON", "-DMLN_DRAWABLE_RENDERER=ON", "-DMLN_RENDERER_SPLIT_VIEW=ON"
}
}
}
}
// build native libraries
@@ -93,6 +127,7 @@ android {
debug {
testCoverageEnabled false
jniDebuggable true
debuggable true
}
}
namespace 'org.maplibre.android'

View File

@@ -37,4 +37,13 @@
# while we don't include this dependency directly
# a large amount of users combine it with our SDK
# we aren't able to provide a proguard config in that project (jar vs aar)
-dontwarn com.sun.xml.internal.ws.spi.db.*
-dontwarn com.sun.xml.internal.ws.spi.db.*
# okhttp
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.*
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE

View File

@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-feature
android:glEsVersion="0x00020000"
android:glEsVersion="0x00030000"
android:required="true"/>
<uses-feature
android:name="android.hardware.wifi"

View File

@@ -392,6 +392,10 @@ public class MapLibreGLSurfaceView extends SurfaceView implements SurfaceHolder.
mEglContext = null;
} else {
mEglConfig = view.eglConfigChooser.chooseConfig(mEgl, mEglDisplay);
if (mEglConfig == null) {
Log.e(TAG, "failed to select an EGL configuration");
return;
}
/*
* Create an EGL context. We want to do this as rarely as we can, because an

View File

@@ -33,6 +33,8 @@ android {
buildTypes {
debug {
jniDebuggable true
debuggable true
testCoverageEnabled true
minifyEnabled false
shrinkResources false
@@ -46,6 +48,19 @@ android {
}
}
flavorDimensions += "renderer"
productFlavors {
create("legacy") {
dimension = "renderer"
}
create("drawable") {
dimension = "renderer"
}
create("split") {
dimension = "renderer"
}
}
buildFeatures {
viewBinding = true
}
@@ -78,7 +93,7 @@ dependencies {
implementation dependenciesList.okhttp3
implementation dependenciesList.leakCanary
debugImplementation dependenciesList.leakCanary
androidTestImplementation dependenciesList.supportAnnotations
androidTestImplementation dependenciesList.testRunner

View File

@@ -11,4 +11,13 @@
# GMS
-dontnote com.google.android.gms.**
-keep class org.maplibre.android.testapp.model.customlayer.ExampleCustomLayer { *; }
-keep class com.mapbox.mapboxsdk.testapp.model.customlayer.ExampleCustomLayer { *; }
# okhttp
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.*
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE

View File

@@ -3,9 +3,10 @@ package org.maplibre.android.testapp.activity.maplayout
import android.os.Bundle
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import org.maplibre.android.maps.*
import org.maplibre.android.testapp.R
import org.maplibre.android.testapp.utils.NavUtils
import com.mapbox.mapboxsdk.maps.*
import com.mapbox.mapboxsdk.testapp.R
import com.mapbox.mapboxsdk.testapp.utils.ApiKeyUtils
import com.mapbox.mapboxsdk.testapp.utils.NavUtils
/**
* Test activity showcasing a simple MapView without any MapboxMap interaction.
@@ -18,11 +19,16 @@ class SimpleMapActivity : AppCompatActivity() {
mapView = findViewById(R.id.mapView)
mapView.onCreate(savedInstanceState)
mapView.getMapAsync(
OnMapReadyCallback { maplibreMap: MapLibreMap ->
val styles = Style.getPredefinedStyles()
if (styles != null && styles.size > 0) {
val styleUrl = styles[0].url
maplibreMap.setStyle(Style.Builder().fromUri(styleUrl))
OnMapReadyCallback { mapboxMap: MapboxMap ->
var key = ApiKeyUtils.getApiKey(applicationContext)
if (key == null || key == "YOUR_API_KEY_GOES_HERE") {
mapboxMap.setStyle(Style.Builder().fromUri("https://demotiles.maplibre.org/style.json"))
} else {
val styles = Style.getPredefinedStyles()
if (styles != null && styles.size > 0) {
val styleUrl = styles[0].url
mapboxMap.setStyle(Style.Builder().fromUri(styleUrl))
}
}
}
)

View File

@@ -44,7 +44,7 @@ afterEvaluate {
artifactId project.ext.mapLibreArtifactId
version this.version
from components.release
from components.legacyRelease
artifact androidSourcesJar
artifact androidJavadocsJar

View File

@@ -1,23 +1,26 @@
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework", "apple_xcframework")
load("@build_bazel_rules_apple//apple:apple.bzl", "apple_static_xcframework", "apple_xcframework", "local_provisioning_profile")
load("@build_bazel_rules_apple//apple:ios.bzl", "ios_application", "ios_framework")
load("@build_bazel_rules_apple//apple:resources.bzl", "apple_resource_bundle")
load(
"@rules_xcodeproj//xcodeproj:defs.bzl",
"top_level_target",
"xcodeproj",
"xcode_provisioning_profile"
)
load("//platform/ios/bazel:macros.bzl", "info_plist")
load("//platform/ios/bazel:config.bzl", "BUILD_MODE", "BUNDLE_ID_PREFIX")
load(
"//platform/ios/bazel:files.bzl",
"MLN_IOS_PRIVATE_HEADERS",
"MLN_IOS_PUBLIC_HEADERS",
"MLN_IOS_PUBLIC_OBJCPP_SOURCE",
"MLN_IOS_PUBLIC_OBJC_SOURCE",
"MLN_IOS_SDK_HEADERS",
"MLN_PUBLIC_IOS_APP_SOPURCE",
load("bazel/macros.bzl", "info_plist")
load("bazel/__generated__/provisioning_profile.bzl", "APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID", "APPLE_MOBILE_PROVISIONING_PROFILE_UUID")
local_provisioning_profile(
name = "provisioning_profile",
profile_name = APPLE_MOBILE_PROVISIONING_PROFILE_UUID,
team_id = APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID
)
xcode_provisioning_profile(
name = "xcode_profile",
managed_by_xcode = True,
provisioning_profile = ":provisioning_profile"
)
load("//platform/ios/bazel:provisioning.bzl", "configure_device_profiles")
configure_device_profiles()
@@ -138,7 +141,237 @@ apple_resource_bundle(
"resources/*.lproj/**",
"resources/*.xcassets/**",
]),
visibility = ["//visibility:public"],
)
# Objcpp files for the iOS source
objc_library(
name = "objcpp-sdk",
srcs = [
"platform/darwin/src/MLNAttributionInfo.mm",
"platform/darwin/src/MLNBackgroundStyleLayer.mm",
"platform/darwin/src/MLNCircleStyleLayer.mm",
"platform/darwin/src/MLNComputedShapeSource.mm",
"platform/darwin/src/MLNDefaultStyle.mm",
"platform/darwin/src/MLNFeature.mm",
"platform/darwin/src/MLNFillExtrusionStyleLayer.mm",
"platform/darwin/src/MLNFillStyleLayer.mm",
"platform/darwin/src/MLNForegroundStyleLayer.mm",
"platform/darwin/src/MLNFoundation.mm",
"platform/darwin/src/MLNGeometry.mm",
"platform/darwin/src/MLNHeatmapStyleLayer.mm",
"platform/darwin/src/MLNHillshadeStyleLayer.mm",
"platform/darwin/src/MLNImageSource.mm",
"platform/darwin/src/MLNLight.mm",
"platform/darwin/src/MLNLineStyleLayer.mm",
"platform/darwin/src/MLNLoggingConfiguration.mm",
"platform/darwin/src/MLNMapCamera.mm",
"platform/darwin/src/MLNMapSnapshotter.mm",
"platform/darwin/src/MLNMultiPoint.mm",
"platform/darwin/src/MLNNetworkConfiguration.mm",
"platform/darwin/src/MLNOfflinePack.mm",
"platform/darwin/src/MLNOfflineStorage.mm",
"platform/darwin/src/MLNOpenGLStyleLayer.mm",
"platform/darwin/src/MLNPointAnnotation.mm",
"platform/darwin/src/MLNPointCollection.mm",
"platform/darwin/src/MLNPolygon.mm",
"platform/darwin/src/MLNPolyline.mm",
"platform/darwin/src/MLNRasterDEMSource.mm",
"platform/darwin/src/MLNRasterStyleLayer.mm",
"platform/darwin/src/MLNRasterTileSource.mm",
"platform/darwin/src/MLNSettings.mm",
"platform/darwin/src/MLNShape.mm",
"platform/darwin/src/MLNShapeCollection.mm",
"platform/darwin/src/MLNShapeOfflineRegion.mm",
"platform/darwin/src/MLNShapeSource.mm",
"platform/darwin/src/MLNSource.mm",
"platform/darwin/src/MLNStyle.mm",
"platform/darwin/src/MLNStyleLayer.mm",
"platform/darwin/src/MLNStyleLayerManager.mm",
"platform/darwin/src/MLNStyleValue.mm",
"platform/darwin/src/MLNSymbolStyleLayer.mm",
"platform/darwin/src/MLNTilePyramidOfflineRegion.mm",
"platform/darwin/src/MLNTileServerOptions.mm",
"platform/darwin/src/MLNTileSource.mm",
"platform/darwin/src/MLNVectorStyleLayer.mm",
"platform/darwin/src/MLNVectorTileSource.mm",
"platform/darwin/src/NSArray+MLNAdditions.mm",
"platform/darwin/src/NSBundle+MLNAdditions.mm",
"platform/darwin/src/NSCoder+MLNAdditions.mm",
"platform/darwin/src/NSComparisonPredicate+MLNAdditions.mm",
"platform/darwin/src/NSCompoundPredicate+MLNAdditions.mm",
"platform/darwin/src/NSDate+MLNAdditions.mm",
"platform/darwin/src/NSDictionary+MLNAdditions.mm",
"platform/darwin/src/NSExpression+MLNAdditions.mm",
"platform/darwin/src/NSPredicate+MLNAdditions.mm",
"platform/darwin/src/NSValue+MLNStyleAttributeAdditions.mm",
"platform/ios/src/MLNAnnotationView.mm",
"platform/ios/src/MLNCompassButton.mm",
"platform/ios/src/MLNFaux3DUserLocationAnnotationView.mm",
"platform/ios/src/MLNMapAccessibilityElement.mm",
"platform/ios/src/MLNMapProjection.mm",
"platform/ios/src/MLNMapView.mm",
"platform/ios/src/MLNMapView+Impl.mm",
"platform/ios/src/MLNMapView+OpenGL.mm",
"platform/ios/src/MLNScaleBar.mm",
"platform/ios/src/UIColor+MLNAdditions.mm",
"platform/ios/src/UIImage+MLNAdditions.mm",
],
copts = CPP_FLAGS + MAPLIBRE_FLAGS + [
"-fcxx-modules",
"-fmodules",
"-Wno-c99-extensions",
"-Wno-gnu-zero-variadic-macro-arguments",
"-Wno-gnu-conditional-omitted-operand",
"-Wno-gnu-statement-expression",
],
includes = [
"platform/darwin/include",
],
sdk_frameworks = [
"CoreImage",
"CoreLocation",
"GLKit",
"OpenGLES",
"QuartzCore",
],
defines = ["GLES_SILENCE_DEPRECATION=1"],
deps = [
"objc-headers",
"//:mbgl-core",
"//platform/darwin:darwin-objcpp",
"//platform/default:mbgl-default",
"//platform/ios/platform/ios/vendor:SMCalloutView",
],
)
# platform/ios/sdk-files.json
# Objc files for the iOS source
objc_library(
name = "objc-sdk",
srcs = [
"platform/darwin/src/MLNAttributedExpression.m",
"platform/darwin/src/MLNClockDirectionFormatter.m",
"platform/darwin/src/MLNCompassDirectionFormatter.m",
"platform/darwin/src/MLNCoordinateFormatter.m",
"platform/darwin/src/MLNDistanceFormatter.m",
"platform/darwin/src/MLNLocationManager.m",
"platform/darwin/src/MLNReachability.m",
"platform/darwin/src/MLNRendererConfiguration.m",
"platform/darwin/src/MLNTypes.m",
"platform/darwin/src/NSString+MLNAdditions.m",
"platform/darwin/src/NSURL+MLNAdditions.m",
"platform/darwin/src/NSValue+MLNAdditions.m",
"platform/ios/src/MLNAnnotationContainerView.m",
"platform/ios/src/MLNAnnotationImage.m",
"platform/ios/src/MLNCompactCalloutView.m",
"platform/ios/src/MLNUserLocation.m",
"platform/ios/src/MLNUserLocationAnnotationView.m",
"platform/ios/src/MLNUserLocationAnnotationViewStyle.m",
"platform/ios/src/MLNUserLocationHeadingArrowLayer.m",
"platform/ios/src/MLNUserLocationHeadingBeamLayer.m",
"platform/ios/src/NSOrthography+MLNAdditions.m",
"platform/ios/src/UIDevice+MLNAdditions.m",
"platform/ios/src/UIView+MLNAdditions.m",
"platform/ios/src/UIViewController+MLNAdditions.m",
],
hdrs = [
"platform/darwin/include/mbgl/util/image+MLNAdditions.hpp",
],
copts = WARNING_FLAGS + MAPLIBRE_FLAGS + [
"-fmodules",
"-Wno-gnu-zero-variadic-macro-arguments",
"-Wno-variadic-macros",
"-Wno-gnu-conditional-omitted-operand",
],
includes = [
"platform/darwin/include",
],
deps = [
"objc-headers",
"//:mbgl-core",
"//platform/darwin:darwin-objc",
"//platform/default:mbgl-default",
"//platform/ios/platform/ios/vendor:SMCalloutView",
],
)
# Common headers between objc and objcpp libraries.
objc_library(
name = "objc-headers",
srcs = glob([
"platform/darwin/src/*.h",
"platform/ios/src/*.h",
]),
includes = [
"platform/darwin/src",
"platform/ios/src",
],
sdk_frameworks = [
"CoreGraphics",
"CoreLocation",
"QuartzCore",
],
deps = [
"//platform/darwin:darwin-objc",
"//platform/darwin:darwin-objcpp",
],
)
objc_library(
name = "sdk-headers",
hdrs = ["platform/ios/src/Mapbox.h"] + _PUBLIC_HEADERS,
)
objc_library(
name = "iosapp",
srcs = [
"platform/darwin/app/LimeGreenStyleLayer.h",
"platform/darwin/app/LimeGreenStyleLayer.m",
"platform/ios/app/MBXAnnotationView.m",
"platform/ios/app/MBXAppDelegate.m",
"platform/ios/app/MBXCustomCalloutView.h",
"platform/ios/app/MBXCustomCalloutView.m",
"platform/ios/app/MBXCustomLocationViewController.m",
"platform/ios/app/MBXEmbeddedMapViewController.m",
"platform/ios/app/MBXFrameTimeGraphView.m",
"platform/ios/app/MBXOfflinePacksTableViewController.m",
"platform/ios/app/MBXOrnamentsViewController.m",
"platform/ios/app/MBXSnapshotsViewController.m",
"platform/ios/app/MBXState.m",
"platform/ios/app/MBXStateManager.m",
"platform/ios/app/MBXUserLocationAnnotationView.m",
"platform/ios/app/MBXViewController.m",
"platform/ios/app/main.m",
],
hdrs = [
"platform/ios/app/MBXAnnotationView.h",
"platform/ios/app/MBXAppDelegate.h",
"platform/ios/app/MBXCustomLocationViewController.h",
"platform/ios/app/MBXEmbeddedMapViewController.h",
"platform/ios/app/MBXFrameTimeGraphView.h",
"platform/ios/app/MBXOfflinePacksTableViewController.h",
"platform/ios/app/MBXOrnamentsViewController.h",
"platform/ios/app/MBXSnapshotsViewController.h",
"platform/ios/app/MBXState.h",
"platform/ios/app/MBXStateManager.h",
"platform/ios/app/MBXUserLocationAnnotationView.h",
"platform/ios/app/MBXViewController.h",
"platform/ios/app/MLNMapView_Experimental.h",
],
data = glob([
"platform/ios/app/Assets.xcassets/**",
]),
includes = [
"platform/darwin/app",
"platform/darwin/src",
"platform/ios/src",
],
sdk_frameworks = [
"GLKit", # needed for LimeGreenStyleLayer
],
deps = [
"sdk-headers",
],
)
_IOS_APPLICATION_RESOURCES = [
@@ -165,11 +398,12 @@ ios_application(
"iphone",
"ipad",
],
infoplists = ["app/Info.plist"],
infoplists = ["build/Info-app.plist"],
minimum_os_version = "12.0",
provisioning_profile = "xcode_profile",
resources = _IOS_APPLICATION_RESOURCES,
visibility = ["//visibility:public"],
provisioning_profile = ":xcode_profile",
deps = [
"//platform:iosapp",
],
@@ -190,6 +424,7 @@ ios_application(
provisioning_profile = ":xcode_profile",
resources = _IOS_APPLICATION_RESOURCES,
visibility = ["//visibility:public"],
provisioning_profile = ":xcode_profile",
deps = [
"//platform:iosapp",
],
@@ -220,39 +455,8 @@ xcodeproj(
tags = ["manual"],
top_level_targets = [
top_level_target(
"App",
target_environments = [
"simulator",
"device",
],
),
top_level_target(
"//render-test/ios:RenderTest",
target_environments = [
"simulator",
"device",
],
),
top_level_target(
"//platform/ios/iosapp-UITests:uitest",
target_environments = [
"simulator",
"device",
],
),
top_level_target(
"//platform/ios/test:ios_test",
target_environments = [
"simulator",
"device",
],
),
top_level_target(
"//platform/ios/test/core:CppUnitTests",
target_environments = [
"simulator",
"device",
],
":App",
target_environments = ["device", "simulator"],
),
],
xcode_configurations = {

View File

@@ -8,6 +8,15 @@ build_type="static"
# "release" or "debug"
release_type="release"
# Renderer flavor
flavor="legacy"
# Provisioning team ID
teamid="0000000000"
# Provisioning profile name/UUID
uuid="iOS Team Provisioning Profile: *"
while [[ $# -gt 0 ]]; do
case $1 in
--static)
@@ -36,6 +45,21 @@ while [[ $# -gt 0 ]]; do
echo "Defaults to \"--static --release\""
exit 1
;;
--flavor)
shift
flavor="$1"
shift
;;
--teamid)
shift
teamid="$1"
shift
;;
--profile-uuid)
shift
uuid="$1"
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
@@ -75,13 +99,28 @@ plutil -replace MLNCommitHash -string "$hash" "$temp_info_plist"
echo "------ Building Maplibre version: $sem_version hash: $hash ------"
# Generate provisioning team ID
if [ ! -d platform/ios/bazel/__generated__ ]; then
mkdir platform/ios/bazel/__generated__
fi
cat > platform/ios/bazel/__generated__/provisioning_profile.bzl <<EOF
APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID = "$teamid"
APPLE_MOBILE_PROVISIONING_PROFILE_UUID = "$uuid"
EOF
# Build
ncpu=$(sysctl -n hw.ncpu)
bazel build //platform/ios:"$target" --apple_platform_type=ios \
--apple_generate_dsym \
--compilation_mode="$compilation_mode" \
--features=dead_strip \
--objc_enable_binary_stripping \
--copt=-Wall --copt=-Wextra --copt=-Wpedantic \
--copt=-Werror
--copt=-Werror \
--jobs "$ncpu" \
--//:renderer=$flavor \
--//:maplibre_platform=ios
echo "Done."
echo "Package will be available in \"/bazel-bin/platform/ios/$target.xcframework.zip\""

View File

@@ -1,28 +1,93 @@
#!/bin/bash
set -euo pipefail
set -eo pipefail
echo "------ Determining Maplibre version and hash ------"
sem_version=0.0.0
hash=$(git log | head -1 | awk '{ print $2 }' | cut -c 1-10) && true
echo "------ Configuring project ------"
# Move and configure the info plists with the semantic version and hash.
temp_info_static_plist="platform/ios/build/Info-static.plist"
temp_info_plist="platform/ios/build/Info.plist"
# Move and configure the app plist
temp_app_info_plist="platform/ios/build/Info-app.plist"
if [ ! -d platform/ios/build ]; then
mkdir platform/ios/build
fi
cp platform/ios/framework/Info-static.plist "$temp_info_static_plist"
cp platform/ios/framework/Info.plist "$temp_info_plist"
cp platform/ios/platform/ios/framework/Info-static.plist "$temp_info_static_plist"
cp platform/ios/platform/ios/framework/Info.plist "$temp_info_plist"
cp platform/ios/platform/ios/app/Info.plist "$temp_app_info_plist"
# Replace semver and hash
plutil -replace MLNSemanticVersionString -string "$sem_version" "$temp_info_static_plist"
plutil -replace MLNCommitHash -string "$hash" "$temp_info_static_plist"
plutil -replace MLNSemanticVersionString -string "$sem_version" "$temp_info_plist"
plutil -replace MLNCommitHash -string "$hash" "$temp_info_plist"
# Build parameters
token_file=~/.maplibre
token_file2=~/maplibre
token="$(cat $token_file 2>/dev/null || cat $token_file2 2>/dev/null || echo $MLN_API_KEY)"
flavor="legacy" # Renderer build flavor: legacy, drawable, split
teamid="0000000000" # Provisioning profile team ID, required for targeting physical devices
uuid="iOS Team Provisioning Profile: *" # provisioning profile name/UUID
while [[ $# -gt 0 ]]; do
case $1 in
--flavor)
shift
flavor="$1"
shift
;;
--teamid)
shift
teamid="$1"
shift
;;
--profile-uuid)
shift
uuid="$1"
shift
;;
--apikey)
shift
token="$1"
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
esac
done
# Insert API Key
echo "Inserting MapLibre API key..."
if [ "$token" ]; then
plutil -replace MLNApiKey -string $token "$temp_app_info_plist"
echo "API key insertion successful"
else
echo "Warning: Missing API key."
fi
# Generate the team ID for Xcode device provisioning
if [ ! -d platform/ios/bazel/__generated__ ]; then
mkdir platform/ios/bazel/__generated__
fi
cat > platform/ios/bazel/__generated__/provisioning_profile.bzl <<EOF
APPLE_MOBILE_PROVISIONING_PROFILE_TEAM_ID = "$teamid"
APPLE_MOBILE_PROVISIONING_PROFILE_UUID = "$uuid"
EOF
echo "------ Building Maplibre version: $sem_version hash: $hash ------"
bazel run //platform/ios:xcodeproj
# Generate the Xcode project
# Example invocation: ./bazel-xcodeproj.sh flavor split teamid 1234567890
# Find your team ID inside a .mobileprovision file or in your keychain (Apple development: your@email -> Get Info -> Organizational Unit)
bazel run //platform/ios:xcodeproj --@rules_xcodeproj//xcodeproj:extra_common_flags="--//:renderer=$flavor --//:maplibre_platform=ios"
popd

View File

@@ -207,6 +207,7 @@ DashPatternTexture::DashPatternTexture(const std::vector<float>& from_,
}
void DashPatternTexture::upload(gfx::UploadPass& uploadPass) {
#if MLN_DRAWABLE_RENDERER
if (std::holds_alternative<AlphaImage>(texture)) {
auto tempTexture = uploadPass.getContext().createTexture2D();
tempTexture->upload(std::get<AlphaImage>(texture));
@@ -214,23 +215,41 @@ void DashPatternTexture::upload(gfx::UploadPass& uploadPass) {
{gfx::TextureFilterType::Linear, gfx::TextureWrapType::Repeat, gfx::TextureWrapType::Clamp});
texture = std::move(tempTexture);
}
#else
if (texture.is<AlphaImage>()) {
texture = uploadPass.createTexture(texture.get<AlphaImage>());
}
#endif
}
gfx::TextureBinding DashPatternTexture::textureBinding() const {
// The texture needs to have been uploaded already.
#if MLN_DRAWABLE_RENDERER
assert(std::holds_alternative<gfx::Texture2DPtr>(texture));
return {std::get<gfx::Texture2DPtr>(texture)->getResource(),
gfx::TextureFilterType::Linear,
gfx::TextureMipMapType::No,
gfx::TextureWrapType::Repeat,
gfx::TextureWrapType::Clamp};
#else
assert(texture.is<gfx::Texture>());
return {texture.get<gfx::Texture>().getResource(),
gfx::TextureFilterType::Linear,
gfx::TextureMipMapType::No,
gfx::TextureWrapType::Repeat,
gfx::TextureWrapType::Clamp};
#endif
}
Size DashPatternTexture::getSize() const {
#if MLN_DRAWABLE_RENDERER
if (std::holds_alternative<AlphaImage>(texture)) {
return std::get<AlphaImage>(texture).size;
}
return std::get<gfx::Texture2DPtr>(texture)->getSize();
#else
return texture.match([](const auto& obj) { return obj.size; });
#endif
}
LineAtlas::LineAtlas() = default;

View File

@@ -1,14 +1,20 @@
#pragma once
#include <mbgl/gfx/texture.hpp>
#include <mbgl/gfx/texture2d.hpp>
#include <mbgl/gfx/context.hpp>
#include <mbgl/util/image.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/texture2d.hpp>
#include <variant>
#else
#include <mbgl/util/variant.hpp>
#include <optional>
#endif
#include <map>
#include <memory>
#include <vector>
#include <variant>
namespace mbgl {
@@ -55,7 +61,12 @@ public:
private:
LinePatternPos from, to;
#if MLN_DRAWABLE_RENDERER
std::variant<AlphaImage, gfx::Texture2DPtr> texture;
#else
variant<AlphaImage, gfx::Texture> texture;
#endif
};
class LineAtlas {

View File

@@ -6,10 +6,13 @@
#include <mbgl/gfx/program.hpp>
#include <mbgl/gfx/renderbuffer.hpp>
#include <mbgl/gfx/rendering_stats.hpp>
#include <mbgl/gfx/uniform_buffer.hpp>
#include <mbgl/gfx/texture.hpp>
#include <mbgl/gfx/types.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/uniform_buffer.hpp>
#endif
#include <memory>
#include <string>
@@ -17,19 +20,24 @@ namespace mbgl {
class PaintParameters;
class ProgramParameters;
#if MLN_DRAWABLE_RENDERER
class TileLayerGroup;
class LayerGroup;
using TileLayerGroupPtr = std::shared_ptr<TileLayerGroup>;
using LayerGroupPtr = std::shared_ptr<LayerGroup>;
#endif
namespace gfx {
class OffscreenTexture;
class ShaderRegistry;
#if MLN_DRAWABLE_RENDERER
class Drawable;
class DrawableBuilder;
class DrawableTweaker;
class OffscreenTexture;
class ShaderProgramBase;
class ShaderRegistry;
class Texture2D;
using DrawablePtr = std::shared_ptr<Drawable>;
@@ -38,6 +46,7 @@ using DrawableTweakerPtr = std::shared_ptr<DrawableTweaker>;
using UniformBufferPtr = std::shared_ptr<UniformBuffer>;
using ShaderProgramBasePtr = std::shared_ptr<ShaderProgramBase>;
using Texture2DPtr = std::shared_ptr<Texture2D>;
#endif
class Context {
protected:
@@ -104,6 +113,7 @@ public:
virtual void clearStencilBuffer(int32_t) = 0;
#if MLN_DRAWABLE_RENDERER
public:
/// Create a new drawable builder
virtual UniqueDrawableBuilder createDrawableBuilder(std::string name) = 0;
@@ -127,6 +137,7 @@ public:
/// Create a texture
virtual Texture2DPtr createTexture2D() = 0;
#endif
};
} // namespace gfx

View File

@@ -19,6 +19,7 @@
namespace mbgl {
namespace gfx {
constexpr int32_t MaxActiveTextureUnits = 8;
class TextureResource {
protected:
TextureResource() = default;
@@ -39,6 +40,8 @@ public:
return static_cast<T&>(*resource);
}
const Size& getSize() const noexcept { return size; }
Size size;
protected:

View File

@@ -7,21 +7,27 @@
#include <mbgl/gfx/index_vector.hpp>
#include <mbgl/gfx/index_buffer.hpp>
#include <mbgl/gfx/texture.hpp>
#include <mbgl/gfx/texture2d.hpp>
#include <mbgl/util/size.hpp>
#include <mbgl/util/image.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/texture2d.hpp>
#endif
#include <optional>
#include <vector>
namespace mbgl {
namespace gfx {
#if MLN_DRAWABLE_RENDERER
class Conext;
class Texture2D;
class VertexAttributeArray;
using AttributeBindingArray = std::vector<std::optional<gfx::AttributeBinding>>;
using Texture2DPtr = std::shared_ptr<Texture2D>;
#endif
class UploadPass {
protected:
@@ -38,8 +44,10 @@ public:
DebugGroup<UploadPass> createDebugGroup(const char* name) { return {*this, name}; }
#if MLN_DRAWABLE_RENDERER
virtual Context& getContext() = 0;
virtual const Context& getContext() const = 0;
#endif
public:
template <class Vertex>
@@ -66,6 +74,7 @@ public:
updateIndexBufferResource(buffer.getResource(), v.data(), v.bytes());
}
#if MLN_DRAWABLE_RENDERER
virtual gfx::AttributeBindingArray buildAttributeBindings(
const std::size_t vertexCount,
const gfx::AttributeDataType vertexType,
@@ -75,6 +84,7 @@ public:
const gfx::VertexAttributeArray& overrides,
gfx::BufferUsageType,
/*out*/ std::unique_ptr<gfx::VertexBufferResource>& outBuffer) = 0;
#endif
protected:
virtual std::unique_ptr<VertexBufferResource> createVertexBufferResource(const void* data,
@@ -117,6 +127,7 @@ public:
updateTextureResourceSub(texture.getResource(), offsetX, offsetY, image.size, image.data.get(), format, type);
}
#if MLN_DRAWABLE_RENDERER
template <typename Image>
void updateTexture(Texture2D& texture,
const Image& image,
@@ -136,6 +147,7 @@ public:
const auto format = image.channels == 4 ? TexturePixelType::RGBA : TexturePixelType::Alpha;
updateTextureResourceSub(texture.getResource(), offsetX, offsetY, image.size, image.data.get(), format, type);
}
#endif
public:
virtual std::unique_ptr<TextureResource> createTextureResource(Size,

View File

@@ -3,26 +3,29 @@
#include <mbgl/gfx/shader_registry.hpp>
#include <mbgl/gl/command_encoder.hpp>
#include <mbgl/gl/defines.hpp>
#include <mbgl/gl/drawable_gl.hpp>
#include <mbgl/gl/drawable_gl_builder.hpp>
#include <mbgl/gl/drawable_gl_tweaker.hpp>
#include <mbgl/gl/draw_scope_resource.hpp>
#include <mbgl/gl/enum.hpp>
#include <mbgl/gl/layer_group_gl.hpp>
#include <mbgl/gl/renderer_backend.hpp>
#include <mbgl/gl/renderbuffer_resource.hpp>
#include <mbgl/gl/uniform_buffer_gl.hpp>
#include <mbgl/gl/texture_resource.hpp>
#include <mbgl/gl/texture.hpp>
#include <mbgl/gl/texture2d.hpp>
#include <mbgl/gl/offscreen_texture.hpp>
#include <mbgl/gl/debugging_extension.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/shaders/gl/shader_program_gl.hpp>
#include <mbgl/util/traits.hpp>
#include <mbgl/util/std.hpp>
#include <mbgl/util/logging.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gl/drawable_gl.hpp>
#include <mbgl/gl/drawable_gl_builder.hpp>
#include <mbgl/gl/drawable_gl_tweaker.hpp>
#include <mbgl/gl/layer_group_gl.hpp>
#include <mbgl/gl/uniform_buffer_gl.hpp>
#include <mbgl/gl/texture2d.hpp>
#include <mbgl/shaders/gl/shader_program_gl.hpp>
#endif
#include <cstring>
#include <iterator>
@@ -455,6 +458,7 @@ void Context::setDirtyState() {
globalVertexArrayState.setDirty();
}
#if MLN_DRAWABLE_RENDERER
gfx::UniqueDrawableBuilder Context::createDrawableBuilder(std::string name) {
return std::make_unique<gl::DrawableGLBuilder>(std::move(name));
}
@@ -484,6 +488,7 @@ LayerGroupPtr Context::createLayerGroup(int32_t layerIndex, std::size_t initialC
gfx::Texture2DPtr Context::createTexture2D() {
return std::make_shared<gl::Texture2D>(*this);
}
#endif
void Context::clear(std::optional<mbgl::Color> color, std::optional<float> depth, std::optional<int32_t> stencil) {
GLbitfield mask = 0;

View File

@@ -1,7 +1,6 @@
#pragma once
#include <mbgl/gfx/texture.hpp>
#include <mbgl/gfx/texture2d.hpp>
#include <mbgl/gfx/draw_mode.hpp>
#include <mbgl/gfx/depth_mode.hpp>
#include <mbgl/gfx/stencil_mode.hpp>
@@ -16,6 +15,10 @@
#include <mbgl/platform/gl_functions.hpp>
#include <mbgl/util/noncopyable.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/texture2d.hpp>
#endif
#include <array>
#include <functional>
#include <vector>
@@ -103,6 +106,7 @@ public:
void setCleanupOnDestruction(bool cleanup) { cleanupOnDestruction = cleanup; }
#if MLN_DRAWABLE_RENDERER
gfx::UniqueDrawableBuilder createDrawableBuilder(std::string name) override;
gfx::DrawableTweakerPtr createDrawableTweaker() override;
gfx::UniformBufferPtr createUniformBuffer(const void* data, std::size_t size) override;
@@ -114,6 +118,7 @@ public:
LayerGroupPtr createLayerGroup(int32_t layerIndex, std::size_t initialCapacity, std::string name) override;
gfx::Texture2DPtr createTexture2D() override;
#endif
private:
RendererBackend& backend;

View File

@@ -4,9 +4,12 @@
#include <mbgl/gl/context.hpp>
#include <mbgl/gl/extension.hpp>
#include <mbgl/shaders/shader_manifest.hpp>
#include <mbgl/shaders/gl/shader_group_gl.hpp>
#include <mbgl/util/logging.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/shaders/gl/shader_group_gl.hpp>
#endif
#include <cassert>
namespace mbgl {
@@ -66,6 +69,7 @@ void RendererBackend::setScissorTest(bool enabled) {
RendererBackend::~RendererBackend() = default;
#if MLN_DRAWABLE_RENDERER
/// @brief Register a list of types with a shader registry instance
/// @tparam ...ShaderID Pack of BuiltIn:: shader IDs
/// @param registry A shader registry instance
@@ -98,6 +102,7 @@ void RendererBackend::initShaders(gfx::ShaderRegistry& shaders, const ProgramPar
shaders::BuiltIn::FillPatternShader,
shaders::BuiltIn::RasterShader>(shaders, programParameters);
}
#endif
} // namespace gl
} // namespace mbgl

View File

@@ -3,13 +3,16 @@
#include <mbgl/gl/enum.hpp>
#include <mbgl/gl/defines.hpp>
#include <mbgl/gl/command_encoder.hpp>
#include <mbgl/gl/vertex_attribute_gl.hpp>
#include <mbgl/gl/vertex_buffer_resource.hpp>
#include <mbgl/gl/index_buffer_resource.hpp>
#include <mbgl/gl/texture_resource.hpp>
#include <mbgl/gl/texture2d.hpp>
#include <mbgl/util/logging.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gl/vertex_attribute_gl.hpp>
#include <mbgl/gl/texture2d.hpp>
#endif
#include <algorithm>
namespace mbgl {
@@ -123,6 +126,7 @@ void UploadPass::updateTextureResourceSub(gfx::TextureResource& resource,
data));
}
#if MLN_DRAWABLE_RENDERER
static std::size_t padSize(std::size_t size, std::size_t padding) {
return (padding - (size % padding)) % padding;
}
@@ -231,6 +235,7 @@ gfx::AttributeBindingArray UploadPass::buildAttributeBindings(
return {};
}
#endif
void UploadPass::pushDebugGroup(const char* name) {
commandEncoder.pushDebugGroup(name);
@@ -240,6 +245,7 @@ void UploadPass::popDebugGroup() {
commandEncoder.popDebugGroup();
}
#if MLN_DRAWABLE_RENDERER
gfx::Context& UploadPass::getContext() {
return commandEncoder.context;
}
@@ -247,6 +253,7 @@ gfx::Context& UploadPass::getContext() {
const gfx::Context& UploadPass::getContext() const {
return commandEncoder.context;
}
#endif
} // namespace gl
} // namespace mbgl

View File

@@ -26,8 +26,10 @@ private:
void popDebugGroup() override;
public:
#if MLN_DRAWABLE_RENDERER
gfx::Context& getContext() override;
const gfx::Context& getContext() const override;
#endif
std::unique_ptr<gfx::VertexBufferResource> createVertexBufferResource(const void* data,
std::size_t size,
@@ -38,6 +40,7 @@ public:
gfx::BufferUsageType) override;
void updateIndexBufferResource(gfx::IndexBufferResource&, const void* data, std::size_t size) override;
#if MLN_DRAWABLE_RENDERER
gfx::AttributeBindingArray buildAttributeBindings(
const std::size_t vertexCount,
const gfx::AttributeDataType vertexType,
@@ -47,6 +50,7 @@ public:
const gfx::VertexAttributeArray& overrides,
gfx::BufferUsageType,
/*out*/ std::unique_ptr<gfx::VertexBufferResource>& outBuffer) override;
#endif
public:
std::unique_ptr<gfx::TextureResource> createTextureResource(Size,

View File

@@ -1,5 +1,4 @@
#include <mbgl/programs/programs.hpp>
#include <mbgl/programs/background_program.hpp>
#include <mbgl/programs/circle_program.hpp>
#include <mbgl/programs/heatmap_program.hpp>
@@ -9,7 +8,6 @@
#include <mbgl/programs/line_program.hpp>
#include <mbgl/programs/raster_program.hpp>
#include <mbgl/programs/symbol_program.hpp>
#include <mbgl/util/logging.hpp>
#include <exception>
@@ -42,6 +40,7 @@ void registerTypes(gfx::ShaderRegistry& registry, const ProgramParameters& progr
}
void Programs::registerWith(gfx::ShaderRegistry& registry) {
#if MLN_LEGACY_RENDERER
/// The following types will be registered
registerTypes<BackgroundProgram,
BackgroundPatternProgram,
@@ -69,6 +68,10 @@ void Programs::registerWith(gfx::ShaderRegistry& registry) {
CollisionCircleProgram,
DebugProgram,
ClippingMaskProgram>(registry, programParameters);
#else
/// The following types will be registered
registerTypes<DebugProgram, ClippingMaskProgram>(registry, programParameters);
#endif
}
} // namespace mbgl

View File

@@ -1,26 +1,29 @@
#include <mbgl/renderer/layers/render_background_layer.hpp>
#include <mbgl/renderer/layers/background_layer_tweaker.hpp>
#include <mbgl/gfx/context.hpp>
#include <mbgl/gfx/cull_face_mode.hpp>
#include <mbgl/gfx/drawable_builder.hpp>
#include <mbgl/map/transform_state.hpp>
#include <mbgl/programs/programs.hpp>
#include <mbgl/renderer/bucket.hpp>
#include <mbgl/renderer/change_request.hpp>
#include <mbgl/renderer/image_manager.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/renderer/pattern_atlas.hpp>
#include <mbgl/renderer/render_pass.hpp>
#include <mbgl/renderer/render_static_data.hpp>
#include <mbgl/renderer/upload_parameters.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#include <mbgl/style/layers/background_layer_impl.hpp>
#include <mbgl/style/layer_properties.hpp>
#include <mbgl/util/tile_cover.hpp>
#include <mbgl/util/convert.hpp>
#include <mbgl/util/logging.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/renderer/layers/background_layer_tweaker.hpp>
#include <mbgl/gfx/drawable_builder.hpp>
#include <mbgl/renderer/change_request.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#endif
#include <unordered_set>
namespace mbgl {
@@ -61,9 +64,12 @@ void RenderBackgroundLayer::evaluate(const PropertyEvaluationParameters& paramet
properties->renderPasses = mbgl::underlying_type(passes);
evaluatedProperties = std::move(properties);
#if MLN_DRAWABLE_RENDERER
if (tileLayerGroup) {
tileLayerGroup->setLayerTweaker(std::make_shared<BackgroundLayerTweaker>(evaluatedProperties));
}
#endif
}
bool RenderBackgroundLayer::hasTransition() const {
@@ -74,6 +80,7 @@ bool RenderBackgroundLayer::hasCrossfade() const {
return getCrossfade<BackgroundLayerProperties>(evaluatedProperties).t != 1;
}
#if MLN_LEGACY_RENDERER
void RenderBackgroundLayer::render(PaintParameters& parameters) {
// Note that for bottommost layers without a pattern, the background color
// is drawn with glClear rather than this method.
@@ -167,6 +174,7 @@ void RenderBackgroundLayer::render(PaintParameters& parameters) {
}
}
}
#endif // MLN_LEGACY_RENDERER
std::optional<Color> RenderBackgroundLayer::getSolidBackground() const {
const auto& evaluated = getEvaluated<BackgroundLayerProperties>(evaluatedProperties);
@@ -197,6 +205,7 @@ void RenderBackgroundLayer::prepare(const LayerPrepareParameters& params) {
}
}
#if MLN_DRAWABLE_RENDERER
static constexpr std::string_view BackgroundPlainShaderName = "BackgroundShader";
static constexpr std::string_view BackgroundPatternShaderName = "BackgroundPatternShader";
@@ -311,5 +320,6 @@ void RenderBackgroundLayer::update(gfx::ShaderRegistry& shaders,
}
}
}
#endif
} // namespace mbgl

View File

@@ -23,12 +23,14 @@ public:
explicit RenderBackgroundLayer(Immutable<style::BackgroundLayer::Impl>);
~RenderBackgroundLayer() override;
#if MLN_DRAWABLE_RENDERER
/// Generate any changes needed by the layer
void update(gfx::ShaderRegistry&,
gfx::Context&,
const TransformState&,
const RenderTree&,
UniqueChangeRequestVec&) override;
#endif
private:
void transition(const TransitionParameters&) override;
@@ -36,20 +38,27 @@ private:
bool hasTransition() const override;
bool hasCrossfade() const override;
std::optional<Color> getSolidBackground() const override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
void prepare(const LayerPrepareParameters&) override;
// Paint properties
style::BackgroundPaintProperties::Unevaluated unevaluated;
SegmentVector<BackgroundAttributes> segments;
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<BackgroundProgram> backgroundProgram;
std::shared_ptr<BackgroundPatternProgram> backgroundPatternProgram;
#endif
#if MLN_DRAWABLE_RENDERER
// Drawable shaders
gfx::ShaderProgramBasePtr plainShader;
gfx::ShaderProgramBasePtr patternShader;
#endif
};
} // namespace mbgl

View File

@@ -1,28 +1,32 @@
#include <mbgl/renderer/layers/render_circle_layer.hpp>
#include <mbgl/renderer/layers/circle_layer_tweaker.hpp>
#include <mbgl/renderer/buckets/circle_bucket.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/programs/programs.hpp>
#include <mbgl/programs/circle_program.hpp>
#include <mbgl/tile/tile.hpp>
#include <mbgl/style/layers/circle_layer_impl.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#include <mbgl/geometry/feature_index.hpp>
#include <mbgl/gfx/drawable_builder.hpp>
#include <mbgl/gfx/cull_face_mode.hpp>
#include <mbgl/gfx/shader_group.hpp>
#include <mbgl/gfx/shader_registry.hpp>
#include <mbgl/util/math.hpp>
#include <mbgl/util/intersection_tests.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/renderer/layers/circle_layer_tweaker.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#include <mbgl/gfx/drawable_builder.hpp>
#endif
namespace mbgl {
using namespace style;
namespace {
#if MLN_LEGACY_RENDERER
struct RenderableSegment {
RenderableSegment(const Segment<CircleAttributes>& segment_,
const RenderTile& tile_,
@@ -43,6 +47,7 @@ struct RenderableSegment {
return lhs.sortKey < rhs.sortKey;
}
};
#endif
inline const style::CircleLayer::Impl& impl_cast(const Immutable<style::Layer::Impl>& impl) {
assert(impl->getTypeInfo() == CircleLayer::Impl::staticTypeInfo());
@@ -74,9 +79,12 @@ void RenderCircleLayer::evaluate(const PropertyEvaluationParameters& parameters)
: RenderPass::None;
properties->renderPasses = mbgl::underlying_type(passes);
evaluatedProperties = std::move(properties);
#if MLN_DRAWABLE_RENDERER
if (tileLayerGroup) {
tileLayerGroup->setLayerTweaker(std::make_shared<CircleLayerTweaker>(evaluatedProperties));
}
#endif
}
bool RenderCircleLayer::hasTransition() const {
@@ -87,6 +95,7 @@ bool RenderCircleLayer::hasCrossfade() const {
return false;
}
#if MLN_LEGACY_RENDERER
void RenderCircleLayer::render(PaintParameters& parameters) {
assert(renderTiles);
@@ -166,6 +175,7 @@ void RenderCircleLayer::render(PaintParameters& parameters) {
}
}
}
#endif // MLN_LEGACY_RENDERER
GeometryCoordinate projectPoint(const GeometryCoordinate& p, const mat4& posMatrix, const Size& size) {
vec4 pos = {{static_cast<double>(p.x), static_cast<double>(p.y), 0, 1}};
@@ -245,6 +255,7 @@ bool RenderCircleLayer::queryIntersectsFeature(const GeometryCoordinates& queryG
return false;
}
#if MLN_DRAWABLE_RENDERER
struct alignas(16) CircleInterpolateUBO {
float color_t;
float radius_t;
@@ -401,5 +412,6 @@ void RenderCircleLayer::update(gfx::ShaderRegistry& shaders,
}
}
}
#endif
} // namespace mbgl

View File

@@ -13,19 +13,24 @@ public:
explicit RenderCircleLayer(Immutable<style::CircleLayer::Impl>);
~RenderCircleLayer() final = default;
#if MLN_DRAWABLE_RENDERER
/// Generate any changes needed by the layer
void update(gfx::ShaderRegistry&,
gfx::Context&,
const TransformState&,
const RenderTree&,
UniqueChangeRequestVec&) override;
#endif
private:
void transition(const TransitionParameters&) override;
void evaluate(const PropertyEvaluationParameters&) override;
bool hasTransition() const override;
bool hasCrossfade() const override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
bool queryIntersectsFeature(const GeometryCoordinates&,
const GeometryTileFeature&,
@@ -38,10 +43,13 @@ private:
// Paint properties
style::CirclePaintProperties::Unevaluated unevaluated;
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<CircleProgram> circleProgram;
#endif
#if MLN_DRAWABLE_RENDERER
gfx::ShaderGroupPtr circleShaderGroup;
#endif
};
} // namespace mbgl

View File

@@ -65,6 +65,7 @@ bool RenderFillExtrusionLayer::is3D() const {
return true;
}
#if MLN_LEGACY_RENDERER
void RenderFillExtrusionLayer::render(PaintParameters& parameters) {
assert(renderTiles);
if (parameters.pass != RenderPass::Translucent) {
@@ -219,6 +220,7 @@ void RenderFillExtrusionLayer::render(PaintParameters& parameters) {
drawTiles(parameters.stencilModeFor3D(), parameters.colorModeForRenderPass(), "color");
}
}
#endif // MLN_LEGACY_RENDERER
bool RenderFillExtrusionLayer::queryIntersectsFeature(const GeometryCoordinates& queryGeometry,
const GeometryTileFeature& feature,

View File

@@ -21,7 +21,10 @@ private:
bool hasTransition() const override;
bool hasCrossfade() const override;
bool is3D() const override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
bool queryIntersectsFeature(const GeometryCoordinates&,
const GeometryTileFeature&,
@@ -34,9 +37,11 @@ private:
// Paint properties
style::FillExtrusionPaintProperties::Unevaluated unevaluated;
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<FillExtrusionProgram> fillExtrusionProgram;
std::shared_ptr<FillExtrusionPatternProgram> fillExtrusionPatternProgram;
#endif
std::unique_ptr<gfx::OffscreenTexture> renderTexture;
};

View File

@@ -1,6 +1,5 @@
#include <mbgl/geometry/feature_index.hpp>
#include <mbgl/gfx/context.hpp>
#include <mbgl/gfx/drawable_builder.hpp>
#include <mbgl/gfx/cull_face_mode.hpp>
#include <mbgl/gfx/renderable.hpp>
#include <mbgl/gfx/renderer_backend.hpp>
@@ -8,14 +7,11 @@
#include <mbgl/programs/programs.hpp>
#include <mbgl/renderer/buckets/fill_bucket.hpp>
#include <mbgl/renderer/image_manager.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/renderer/layers/fill_layer_tweaker.hpp>
#include <mbgl/renderer/layers/render_fill_layer.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/renderer/render_source.hpp>
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/renderer/tile_render_data.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#include <mbgl/style/expression/image.hpp>
#include <mbgl/style/layers/fill_layer_impl.hpp>
#include <mbgl/tile/geometry_tile.hpp>
@@ -26,6 +22,13 @@
#include <mbgl/util/math.hpp>
#include <mbgl/util/std.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/drawable_builder.hpp>
#include <mbgl/renderer/layers/fill_layer_tweaker.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#endif
namespace mbgl {
using namespace style;
@@ -74,9 +77,12 @@ void RenderFillLayer::evaluate(const PropertyEvaluationParameters& parameters) {
}
properties->renderPasses = mbgl::underlying_type(passes);
evaluatedProperties = std::move(properties);
#if MLN_DRAWABLE_RENDERER
if (tileLayerGroup) {
tileLayerGroup->setLayerTweaker(std::make_shared<FillLayerTweaker>(evaluatedProperties));
}
#endif
}
bool RenderFillLayer::hasTransition() const {
@@ -87,6 +93,7 @@ bool RenderFillLayer::hasCrossfade() const {
return getCrossfade<FillLayerProperties>(evaluatedProperties).t != 1;
}
#if MLN_LEGACY_RENDERER
void RenderFillLayer::render(PaintParameters& parameters) {
assert(renderTiles);
@@ -254,6 +261,7 @@ void RenderFillLayer::render(PaintParameters& parameters) {
}
}
}
#endif // MLN_LEGACY_RENDERER
bool RenderFillLayer::queryIntersectsFeature(const GeometryCoordinates& queryGeometry,
const GeometryTileFeature& feature,
@@ -273,6 +281,7 @@ bool RenderFillLayer::queryIntersectsFeature(const GeometryCoordinates& queryGeo
feature.getGeometries());
}
#if MLN_DRAWABLE_RENDERER
void RenderFillLayer::update(gfx::ShaderRegistry& shaders,
gfx::Context& context,
const TransformState& state,
@@ -560,5 +569,6 @@ void RenderFillLayer::update(gfx::ShaderRegistry& shaders,
}
}
}
#endif
} // namespace mbgl

View File

@@ -20,19 +20,24 @@ public:
explicit RenderFillLayer(Immutable<style::FillLayer::Impl>);
~RenderFillLayer() override;
#if MLN_DRAWABLE_RENDERER
/// Generate any changes needed by the layer
void update(gfx::ShaderRegistry&,
gfx::Context&,
const TransformState&,
const RenderTree&,
UniqueChangeRequestVec&) override;
#endif
private:
void transition(const TransitionParameters&) override;
void evaluate(const PropertyEvaluationParameters&) override;
bool hasTransition() const override;
bool hasCrossfade() const override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
bool queryIntersectsFeature(const GeometryCoordinates&,
const GeometryTileFeature&,
@@ -45,16 +50,19 @@ private:
// Paint properties
style::FillPaintProperties::Unevaluated unevaluated;
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<FillProgram> fillProgram;
std::shared_ptr<FillPatternProgram> fillPatternProgram;
std::shared_ptr<FillOutlineProgram> fillOutlineProgram;
std::shared_ptr<FillOutlinePatternProgram> fillOutlinePatternProgram;
#endif
#if MLN_DRAWABLE_RENDERER
gfx::ShaderGroupPtr fillShaderGroup;
gfx::ShaderGroupPtr outlineShaderGroup;
gfx::ShaderGroupPtr patternShaderGroup;
gfx::ShaderGroupPtr outlinePatternShaderGroup;
#endif
};
} // namespace mbgl

View File

@@ -63,6 +63,7 @@ void RenderHeatmapLayer::upload(gfx::UploadPass& uploadPass) {
}
}
#if MLN_LEGACY_RENDERER
void RenderHeatmapLayer::render(PaintParameters& parameters) {
assert(renderTiles);
if (parameters.pass == RenderPass::Opaque) {
@@ -171,6 +172,7 @@ void RenderHeatmapLayer::render(PaintParameters& parameters) {
getID());
}
}
#endif // MLN_LEGACY_RENDERER
void RenderHeatmapLayer::updateColorRamp() {
auto colorValue = unevaluated.get<HeatmapColor>().getValue();

View File

@@ -22,7 +22,10 @@ private:
bool hasTransition() const override;
bool hasCrossfade() const override;
void upload(gfx::UploadPass&) override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
bool queryIntersectsFeature(const GeometryCoordinates&,
const GeometryTileFeature&,
@@ -40,9 +43,11 @@ private:
std::optional<gfx::Texture> colorRampTexture;
SegmentVector<HeatmapTextureAttributes> segments;
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<HeatmapProgram> heatmapProgram;
std::shared_ptr<HeatmapTextureProgram> heatmapTextureProgram;
#endif
};
} // namespace mbgl

View File

@@ -75,6 +75,7 @@ void RenderHillshadeLayer::prepare(const LayerPrepareParameters& params) {
maxzoom = params.source->getMaxZoom();
}
#if MLN_LEGACY_RENDERER
void RenderHillshadeLayer::render(PaintParameters& parameters) {
assert(renderTiles);
if (parameters.pass != RenderPass::Translucent && parameters.pass != RenderPass::Pass3D) return;
@@ -218,5 +219,6 @@ void RenderHillshadeLayer::render(PaintParameters& parameters) {
}
}
}
#endif // MLN_LEGACY_RENDERER
} // namespace mbgl

View File

@@ -21,7 +21,10 @@ private:
bool hasTransition() const override;
bool hasCrossfade() const override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
void prepare(const LayerPrepareParameters&) override;
// Paint properties
@@ -31,9 +34,11 @@ private:
std::array<float, 2> getLatRange(const UnwrappedTileID& id);
std::array<float, 2> getLight(const PaintParameters& parameters);
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<HillshadeProgram> hillshadeProgram;
std::shared_ptr<HillshadePrepareProgram> hillshadePrepareProgram;
#endif
};
} // namespace mbgl

View File

@@ -89,6 +89,7 @@ void RenderLineLayer::upload(gfx::UploadPass& uploadPass) {
}
}
#if MLN_LEGACY_RENDERER
void RenderLineLayer::render(PaintParameters& parameters) {
assert(renderTiles);
if (parameters.pass == RenderPass::Opaque) {
@@ -208,6 +209,7 @@ void RenderLineLayer::render(PaintParameters& parameters) {
}
}
}
#endif // MLN_LEGACY_RENDERER
namespace {

View File

@@ -27,7 +27,10 @@ private:
bool hasCrossfade() const override;
void prepare(const LayerPrepareParameters&) override;
void upload(gfx::UploadPass&) override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
bool queryIntersectsFeature(const GeometryCoordinates&,
const GeometryTileFeature&,
@@ -46,11 +49,13 @@ private:
PremultipliedImage colorRamp;
std::optional<gfx::Texture> colorRampTexture;
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<LineProgram> lineProgram;
std::shared_ptr<LineGradientProgram> lineGradientProgram;
std::shared_ptr<LineSDFProgram> lineSDFProgram;
std::shared_ptr<LinePatternProgram> linePatternProgram;
#endif
};
} // namespace mbgl

View File

@@ -1,7 +1,5 @@
#include <mbgl/renderer/layers/render_raster_layer.hpp>
#include <mbgl/renderer/layers/raster_layer_tweaker.hpp>
#include <mbgl/renderer/buckets/raster_bucket.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/renderer/render_tile.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/renderer/render_static_data.hpp>
@@ -10,12 +8,17 @@
#include <mbgl/programs/raster_program.hpp>
#include <mbgl/tile/tile.hpp>
#include <mbgl/gfx/context.hpp>
#include <mbgl/gfx/drawable_builder.hpp>
#include <mbgl/gfx/cull_face_mode.hpp>
#include <mbgl/math/angles.hpp>
#include <mbgl/style/layers/raster_layer_impl.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/renderer/layers/raster_layer_tweaker.hpp>
#include <mbgl/gfx/image_drawable_data.hpp>
#include <mbgl/gfx/drawable_builder.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/shaders/shader_program_base.hpp>
#endif
namespace mbgl {
@@ -47,9 +50,11 @@ void RenderRasterLayer::evaluate(const PropertyEvaluationParameters& parameters)
properties->renderPasses = mbgl::underlying_type(passes);
evaluatedProperties = std::move(properties);
#if MLN_DRAWABLE_RENDERER
if (tileLayerGroup && tileLayerGroup->getLayerTweaker()) {
tileLayerGroup->setLayerTweaker(std::make_shared<RasterLayerTweaker>(evaluatedProperties));
}
#endif
}
bool RenderRasterLayer::hasTransition() const {
@@ -60,6 +65,7 @@ bool RenderRasterLayer::hasCrossfade() const {
return false;
}
#if MLN_LEGACY_RENDERER
static float saturationFactor(float saturation) {
if (saturation > 0) {
return 1.f - 1.f / (1.001f - saturation);
@@ -84,6 +90,7 @@ static std::array<float, 3> spinWeights(float spin) {
{(2 * c + 1) / 3, (-std::sqrt(3.0f) * s - c + 1) / 3, (std::sqrt(3.0f) * s - c + 1) / 3}};
return spin_weights;
}
#endif
void RenderRasterLayer::prepare(const LayerPrepareParameters& params) {
renderTiles = params.source->getRenderTiles();
@@ -92,6 +99,7 @@ void RenderRasterLayer::prepare(const LayerPrepareParameters& params) {
assert(renderTiles || imageData || !params.source->isEnabled());
}
#if MLN_LEGACY_RENDERER
void RenderRasterLayer::render(PaintParameters& parameters) {
if (parameters.pass != RenderPass::Translucent || (!renderTiles && !imageData)) {
return;
@@ -206,7 +214,9 @@ void RenderRasterLayer::render(PaintParameters& parameters) {
}
}
}
#endif // MLN_LEGACY_RENDERER
#if MLN_DRAWABLE_RENDERER
void RenderRasterLayer::update(gfx::ShaderRegistry& shaders,
gfx::Context& context,
const TransformState& /*state*/,
@@ -445,5 +455,6 @@ void RenderRasterLayer::update(gfx::ShaderRegistry& shaders,
}
}
}
#endif // MLN_DRAWABLE_RENDERER
} // namespace mbgl

View File

@@ -15,12 +15,14 @@ public:
explicit RenderRasterLayer(Immutable<style::RasterLayer::Impl>);
~RenderRasterLayer() override;
#if MLN_DRAWABLE_RENDERER
/// Generate any changes needed by the layer
void update(gfx::ShaderRegistry&,
gfx::Context&,
const TransformState&,
const RenderTree&,
UniqueChangeRequestVec&) override;
#endif
private:
void transition(const TransitionParameters&) override;
@@ -28,17 +30,24 @@ private:
bool hasTransition() const override;
bool hasCrossfade() const override;
void prepare(const LayerPrepareParameters&) override;
#if MLN_LEGACY_RENDERER
void render(PaintParameters&) override;
#endif
// Paint properties
style::RasterPaintProperties::Unevaluated unevaluated;
const ImageSourceRenderData* imageData = nullptr;
#if MLN_LEGACY_RENDERER
// Programs
std::shared_ptr<RasterProgram> rasterProgram;
#endif
#if MLN_DRAWABLE_RENDERER
gfx::ShaderProgramBasePtr rasterShader;
LayerGroupPtr imageLayerGroup;
#endif
};
} // namespace mbgl

View File

@@ -1,7 +1,9 @@
#include <mbgl/renderer/pattern_atlas.hpp>
#include <mbgl/gfx/upload_pass.hpp>
#include <mbgl/gfx/context.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/texture2d.hpp>
#endif
namespace mbgl {
@@ -88,25 +90,40 @@ Size PatternAtlas::getPixelSize() const {
}
void PatternAtlas::upload([[maybe_unused]] gfx::UploadPass& uploadPass) {
#if MLN_DRAWABLE_RENDERER
if (!atlasTexture2D) {
atlasTexture2D = uploadPass.getContext().createTexture2D();
atlasTexture2D->upload(atlasImage);
} else if (dirty) {
atlasTexture2D->upload(atlasImage);
}
#else
if (!atlasTexture) {
atlasTexture = uploadPass.createTexture(atlasImage);
} else if (dirty) {
uploadPass.updateTexture(*atlasTexture, atlasImage);
}
#endif
dirty = false;
}
// @note: Deprecated
gfx::TextureBinding PatternAtlas::textureBinding() const {
#if MLN_DRAWABLE_RENDERER
assert(atlasTexture2D);
assert(!dirty);
return {atlasTexture2D->getResource(), gfx::TextureFilterType::Linear};
#else
assert(atlasTexture);
assert(!dirty);
return {atlasTexture->getResource(), gfx::TextureFilterType::Linear};
#endif
}
#if MLN_DRAWABLE_RENDERER
const std::shared_ptr<gfx::Texture2D>& PatternAtlas::texture() const {
return atlasTexture2D;
}
#endif
} // namespace mbgl

View File

@@ -15,7 +15,9 @@ template <class T>
class Actor;
namespace gfx {
#if MLN_DRAWABLE_RENDERER
class Texture2D;
#endif
class UploadPass;
} // namespace gfx
@@ -31,7 +33,9 @@ public:
void removePattern(const std::string&);
gfx::TextureBinding textureBinding() const; // @TODO: Migrate
#if MLN_DRAWABLE_RENDERER
const std::shared_ptr<gfx::Texture2D>& texture() const;
#endif
void upload(gfx::UploadPass&);
Size getPixelSize() const;
@@ -48,7 +52,11 @@ private:
mapbox::ShelfPack shelfPack;
std::unordered_map<std::string, Pattern> patterns;
PremultipliedImage atlasImage;
#if MLN_DRAWABLE_RENDERER
std::shared_ptr<gfx::Texture2D> atlasTexture2D{nullptr};
#else
std::optional<gfx::Texture> atlasTexture;
#endif
bool dirty = true;
};

View File

@@ -1,6 +1,4 @@
#include <mbgl/renderer/change_request.hpp>
#include <mbgl/renderer/render_layer.hpp>
#include <mbgl/renderer/layer_group.hpp>
#include <mbgl/renderer/paint_parameters.hpp>
#include <mbgl/renderer/render_source.hpp>
#include <mbgl/renderer/render_tile.hpp>
@@ -10,6 +8,10 @@
#include <mbgl/gfx/context.hpp>
#include <mbgl/util/logging.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/renderer/layer_group.hpp>
#endif
namespace mbgl {
using namespace style;
@@ -60,6 +62,7 @@ std::optional<Color> RenderLayer::getSolidBackground() const {
return std::nullopt;
}
#if MLN_DRAWABLE_RENDERER
void RenderLayer::layerRemoved(UniqueChangeRequestVec& changes) {
// Remove everything
if (tileLayerGroup) {
@@ -67,6 +70,7 @@ void RenderLayer::layerRemoved(UniqueChangeRequestVec& changes) {
tileLayerGroup.reset();
}
}
#endif
void RenderLayer::markContextDestroyed() {
// no-op
@@ -120,6 +124,7 @@ const LayerRenderData* RenderLayer::getRenderDataForPass(const RenderTile& tile,
return nullptr;
}
#if MLN_DRAWABLE_RENDERER
void RenderLayer::removeTile(RenderPass renderPass, const OverscaledTileID& tileID) {
stats.tileDrawablesRemoved += tileLayerGroup->removeDrawables(renderPass, tileID).size();
}
@@ -158,5 +163,6 @@ void RenderLayer::markLayerRenderable(bool willRender, UniqueChangeRequestVec& c
changes.emplace_back(std::make_unique<RemoveLayerGroupRequest>(tileLayerGroup->getLayerIndex()));
}
}
#endif
} // namespace mbgl

View File

@@ -1,7 +1,9 @@
#pragma once
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/drawable.hpp>
#include <mbgl/layout/layout.hpp>
#include <mbgl/renderer/change_request.hpp>
#endif
#include <mbgl/layout/layout.hpp>
#include <mbgl/renderer/render_pass.hpp>
#include <mbgl/renderer/render_source.hpp>
#include <mbgl/style/layer_properties.hpp>
@@ -14,7 +16,6 @@
namespace mbgl {
class Bucket;
class ChangeRequest;
class DynamicFeatureIndex;
class LineAtlas;
class PropertyEvaluationParameters;
@@ -23,22 +24,28 @@ class PatternAtlas;
class RenderTile;
class RenderTree;
class SymbolBucket;
class TileLayerGroup;
class TransformState;
class TransitionParameters;
class UploadParameters;
#if MLN_DRAWABLE_RENDERER
class ChangeRequest;
class TileLayerGroup;
using TileLayerGroupPtr = std::shared_ptr<TileLayerGroup>;
using UniqueChangeRequest = std::unique_ptr<ChangeRequest>;
using UniqueChangeRequestVec = std::vector<UniqueChangeRequest>;
#endif
namespace gfx {
class Context;
class ShaderGroup;
class ShaderRegistry;
class UniformBuffer;
using ShaderGroupPtr = std::shared_ptr<ShaderGroup>;
#if MLN_DRAWABLE_RENDERER
class UniformBuffer;
using UniformBufferPtr = std::shared_ptr<UniformBuffer>;
#endif
} // namespace gfx
class LayerRenderData {
@@ -118,7 +125,7 @@ public:
bool supportsZoom(float zoom) const;
virtual void upload(gfx::UploadPass&) {}
virtual void render(PaintParameters&) = 0;
virtual void render(PaintParameters&){};
// Check wether the given geometry intersects
// with the feature
@@ -148,6 +155,7 @@ public:
// TODO: Only for background layers.
virtual std::optional<Color> getSolidBackground() const;
#if MLN_DRAWABLE_RENDERER
/// Generate any changes needed by the layer
virtual void update(
gfx::ShaderRegistry&, gfx::Context&, const TransformState&, const RenderTree&, UniqueChangeRequestVec&) {}
@@ -165,6 +173,7 @@ public:
/// @param willRender Indicates if this layer should render or not
/// @param changes The collection of current pending change requests
virtual void markLayerRenderable(bool willRender, UniqueChangeRequestVec& changes);
#endif
protected:
// Checks whether the current hardware can render this layer. If it can't,
@@ -175,11 +184,13 @@ protected:
const LayerRenderData* getRenderDataForPass(const RenderTile&, RenderPass) const;
#if MLN_DRAWABLE_RENDERER
/// Remove all drawables for the tile from the layer group
void removeTile(RenderPass, const OverscaledTileID&);
/// Remove all the drawables for tiles
void removeAllTiles();
#endif
protected:
// Stores current set of tiles to be rendered for this layer.
@@ -191,7 +202,9 @@ protected:
LayerPlacementData placementData;
#if MLN_DRAWABLE_RENDERER
TileLayerGroupPtr tileLayerGroup;
#endif
// Current layer index as specified by the layerIndexChanged event
int32_t layerIndex{0};
// Current renderable status as specified by the markLayerRenderable event

View File

@@ -2,7 +2,9 @@
#include <mbgl/annotation/annotation_manager.hpp>
#include <mbgl/layermanager/layer_manager.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/renderer/change_request.hpp>
#endif
#include <mbgl/renderer/renderer_observer.hpp>
#include <mbgl/renderer/render_source.hpp>
#include <mbgl/renderer/render_layer.hpp>
@@ -222,13 +224,17 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree(
layerImpls = updateParameters->layers;
const bool layersAddedOrRemoved = !layerDiff.added.empty() || !layerDiff.removed.empty();
#if MLN_DRAWABLE_RENDERER
std::vector<std::unique_ptr<ChangeRequest>> changes;
#endif
// Remove render layers for removed layers.
for (const auto& entry : layerDiff.removed) {
const auto hit = renderLayers.find(entry.first);
if (hit != renderLayers.end()) {
#if MLN_DRAWABLE_RENDERER
hit->second->layerRemoved(changes);
#endif
renderLayers.erase(hit);
}
}
@@ -248,14 +254,16 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree(
if (layersAddedOrRemoved) {
orderedLayers.clear();
orderedLayers.reserve(layerImpls->size());
int32_t layerIndex = 0;
[[maybe_unused]] int32_t layerIndex = 0;
for (const auto& layerImpl : *layerImpls) {
RenderLayer* layer = renderLayers.at(layerImpl->id).get();
assert(layer);
orderedLayers.emplace_back(*layer);
#if MLN_DRAWABLE_RENDERER
// We're mutating the list of ordered layers and must notify them of their new assigned indices
layer->layerIndexChanged(layerIndex++, changes);
#endif
}
}
assert(orderedLayers.size() == renderLayers.size());
@@ -338,7 +346,6 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree(
}
}
}
continue;
}
@@ -360,6 +367,7 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree(
filteredLayersForSource.clear();
}
#if MLN_DRAWABLE_RENDERER
// Mark layers included in the renderable set as renderable
// @TODO: Optimize this logic, combine with the above
for (size_t i = 0; i < orderedLayers.size(); ++i) {
@@ -371,6 +379,7 @@ std::unique_ptr<RenderTree> RenderOrchestrator::createRenderTree(
// Add all change requests up to this point
addChanges(changes);
#endif
renderTreeParameters->loaded = updateParameters->styleLoaded && isLoaded();
if (!isMapModeContinuous && !renderTreeParameters->loaded) {
@@ -766,6 +775,7 @@ void RenderOrchestrator::clearData() {
glyphManager->evict(fontStacks(*layerImpls));
}
#if MLN_DRAWABLE_RENDERER
void RenderOrchestrator::addChanges(UniqueChangeRequestVec& changes) {
pendingChanges.insert(
pendingChanges.end(), std::make_move_iterator(changes.begin()), std::make_move_iterator(changes.end()));
@@ -879,6 +889,7 @@ void RenderOrchestrator::processChanges() {
void RenderOrchestrator::markLayerGroupOrderDirty() {
layerGroupOrderDirty = true;
}
#endif // MLN_DRAWABLE_RENDERER
void RenderOrchestrator::onGlyphsError(const FontStack& fontStack, const GlyphRange& glyphRange, std::exception_ptr error) {
Log::Error(Event::Style, "Failed to load glyph range " + std::to_string(glyphRange.first) + "-" + std::to_string(glyphRange.second) +

View File

@@ -1,6 +1,7 @@
#pragma once
#if MLN_DRAWABLE_RENDERER
#include <mbgl/renderer/layer_group.hpp>
#endif
#include <mbgl/renderer/renderer.hpp>
#include <mbgl/renderer/render_source_observer.hpp>
#include <mbgl/renderer/render_light.hpp>
@@ -21,8 +22,9 @@
#include <vector>
namespace mbgl {
#if MLN_DRAWABLE_RENDERER
class ChangeRequest;
#endif
class RendererObserver;
class RenderSource;
class UpdateParameters;
@@ -37,10 +39,11 @@ class CrossTileSymbolIndex;
class RenderTree;
namespace gfx {
class Drawable;
class ShaderRegistry;
#if MLN_DRAWABLE_RENDERER
class Drawable;
using DrawablePtr = std::shared_ptr<Drawable>;
#endif
} // namespace gfx
namespace style {
@@ -95,6 +98,7 @@ public:
void update(const std::shared_ptr<UpdateParameters>&);
#if MLN_DRAWABLE_RENDERER
bool addLayerGroup(LayerGroupBasePtr, bool replace);
bool removeLayerGroup(const int32_t layerIndex);
size_t numLayerGroups() const noexcept;
@@ -111,6 +115,7 @@ public:
void processChanges();
/// @brief Indicate that the orchestrator needs to re-sort layer groups when processing changes
void markLayerGroupOrderDirty();
#endif
const ZoomHistory& getZoomHistory() const { return zoomHistory; }
@@ -143,12 +148,14 @@ private:
void onStyleImageMissing(const std::string&, const std::function<void()>&) override;
void onRemoveUnusedStyleImages(const std::vector<std::string>&) override;
#if MLN_DRAWABLE_RENDERER
/// Move changes into the pending set, clearing the provided collection
void addChanges(UniqueChangeRequestVec&);
void onRemoveLayerGroup(LayerGroupBase&);
void updateLayerGroupOrder();
#endif
RendererObserver* observer;
@@ -181,11 +188,13 @@ private:
RenderLayerReferences orderedLayers;
RenderLayerReferences layersNeedPlacement;
#if MLN_DRAWABLE_RENDERER
std::vector<std::unique_ptr<ChangeRequest>> pendingChanges;
using LayerGroupMap = std::map<int32_t, LayerGroupBasePtr>;
LayerGroupMap layerGroupsByLayerIndex;
bool layerGroupOrderDirty = false;
#endif
};
} // namespace mbgl

View File

@@ -96,6 +96,7 @@ std::optional<ImagePosition> RenderTile::getPattern(const std::string& pattern)
return renderData->getPattern(pattern);
}
#if MLN_DRAWABLE_RENDERER
static const gfx::Texture2DPtr noTexture;
bool RenderTile::hasGlyphAtlasTexture() const {
@@ -129,6 +130,28 @@ const std::shared_ptr<TileAtlasTextures>& RenderTile::getAtlasTextures() const {
return renderData ? renderData->getAtlasTextures() : noAtlas;
}
#else
gfx::TextureBinding RenderTile::getGlyphAtlasTextureBinding(gfx::TextureFilterType filter) const {
assert(renderData);
return {getGlyphAtlasTexture()->getResource(), filter};
}
gfx::TextureBinding RenderTile::getIconAtlasTextureBinding(gfx::TextureFilterType filter) const {
assert(renderData);
return {getIconAtlasTexture()->getResource(), filter};
}
const gfx::Texture* RenderTile::getGlyphAtlasTexture() const {
assert(renderData);
return &renderData->getGlyphAtlasTexture();
}
const gfx::Texture* RenderTile::getIconAtlasTexture() const {
assert(renderData);
return &renderData->getIconAtlasTexture();
}
#endif
void RenderTile::upload(gfx::UploadPass& uploadPass) const {
assert(renderData);
renderData->upload(uploadPass);

View File

@@ -14,9 +14,12 @@
namespace mbgl {
namespace gfx {
#if MLN_DRAWABLE_RENDERER
class Texture2D;
class UploadPass;
using Texture2DPtr = std::shared_ptr<Texture2D>;
#endif
class UploadPass;
} // namespace gfx
class Bucket;
@@ -59,6 +62,7 @@ public:
const LayerRenderData* getLayerRenderData(const style::Layer::Impl&) const;
std::optional<ImagePosition> getPattern(const std::string& pattern) const;
#if MLN_DRAWABLE_RENDERER
bool hasGlyphAtlasTexture() const;
const gfx::Texture2DPtr& getGlyphAtlasTexture() const;
gfx::TextureBinding getGlyphAtlasTextureBinding(gfx::TextureFilterType) const;
@@ -68,6 +72,13 @@ public:
gfx::TextureBinding getIconAtlasTextureBinding(gfx::TextureFilterType) const;
const std::shared_ptr<TileAtlasTextures>& getAtlasTextures() const;
#else
gfx::TextureBinding getGlyphAtlasTextureBinding(gfx::TextureFilterType) const;
gfx::TextureBinding getIconAtlasTextureBinding(gfx::TextureFilterType) const;
const gfx::Texture* getGlyphAtlasTexture() const;
const gfx::Texture* getIconAtlasTexture() const;
#endif
void upload(gfx::UploadPass&) const;
void prepare(const SourcePrepareParameters&);

View File

@@ -1,6 +1,7 @@
#pragma once
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/drawable.hpp>
#endif
#include <mbgl/renderer/paint_parameters.hpp>
#include <cassert>

View File

@@ -33,6 +33,7 @@ void Renderer::render(const std::shared_ptr<UpdateParameters>& updateParameters)
if (auto renderTree = impl->orchestrator.createRenderTree(updateParameters)) {
renderTree->prepare();
#if MLN_DRAWABLE_RENDERER
const auto& renderTreeParameters = renderTree->getParameters();
const auto& state = renderTreeParameters.transformParams.state;
@@ -41,6 +42,7 @@ void Renderer::render(const std::shared_ptr<UpdateParameters>& updateParameters)
auto& shaders = *impl->staticData->shaders;
impl->orchestrator.updateLayers(shaders, context, state, updateParameters, *renderTree);
}
#endif
impl->render(*renderTree);
}

View File

@@ -4,32 +4,37 @@
#include <mbgl/gfx/backend_scope.hpp>
#include <mbgl/gfx/context.hpp>
#include <mbgl/gfx/cull_face_mode.hpp>
#include <mbgl/gfx/drawable_tweaker.hpp>
#include <mbgl/gfx/render_pass.hpp>
#include <mbgl/gfx/renderer_backend.hpp>
#include <mbgl/gfx/renderable.hpp>
#include <mbgl/gfx/upload_pass.hpp>
#include <mbgl/gl/drawable_gl.hpp>
#include <mbgl/programs/programs.hpp>
#include <mbgl/renderer/layer_tweaker.hpp>
#include <mbgl/renderer/pattern_atlas.hpp>
#include <mbgl/renderer/renderer_observer.hpp>
#include <mbgl/renderer/render_static_data.hpp>
#include <mbgl/renderer/render_tree.hpp>
#include <mbgl/shaders/gl/shader_program_gl.hpp>
#include <mbgl/util/convert.hpp>
#include <mbgl/util/string.hpp>
#include <mbgl/util/logging.hpp>
#if MLN_DRAWABLE_RENDERER
#include <mbgl/gfx/drawable_tweaker.hpp>
#include <mbgl/gl/drawable_gl.hpp>
#include <mbgl/renderer/layer_tweaker.hpp>
#include <mbgl/shaders/gl/shader_program_gl.hpp>
#endif
#if (MLN_LEGACY_RENDERER && MLN_DRAWABLE_RENDERER)
// DEBUG: Enable a debugging split view to compare drawables and vanilla rendering pathways
// Drawables will be on the left, vanilla rendering on the right
// #define SPLIT_VIEW
// If using SPLIT_VIEW, QUAD_SPLIT_VIEW will split each half, showing just the opaque
// #define MLN_RENDERER_SPLIT_VIEW 1
// If using SPLIT_VIEW, MLN_RENDERER_QUAD_SPLIT_VIEW will split each half, showing just the opaque
// pass on top and then a composited opaque+translucent pass on the bottom
// #define QUAD_SPLIT_VIEW
#ifdef SPLIT_VIEW
#if MLN_RENDERER_SPLIT_VIEW
#include <mbgl/gl/context.hpp>
#endif
#endif
namespace mbgl {
@@ -74,9 +79,11 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
// Initialize legacy shader programs
staticData->programs.registerWith(*staticData->shaders);
#if MLN_DRAWABLE_RENDERER
// Initialize shaders for drawables
const auto programParameters = ProgramParameters{pixelRatio, false};
backend.initShaders(*staticData->shaders, programParameters);
#endif
// Notify post-shader registration
observer->onRegisterShaders(*staticData->shaders);
@@ -100,6 +107,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
const auto& sourceRenderItems = renderTree.getSourceRenderItems();
const auto& layerRenderItems = renderTree.getLayerRenderItems();
#if MLN_DRAWABLE_RENDERER
// Run changes
orchestrator.processChanges();
@@ -111,8 +119,9 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
});
// Give the layers a chance to do setup
// orchestrator.observeLayerGroups([&](LayerGroup& layerGroup) { layerGroup.preRender(orchestrator, parameters);
// });
// orchestrator.observeLayerGroups([&](LayerGroup& layerGroup) { layerGroup.preRender(orchestrator, parameters);
// });
#endif
// - UPLOAD PASS -------------------------------------------------------------------------------
// Uploads all required buffers and images before we do any actual rendering.
@@ -130,8 +139,10 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
renderTree.getLineAtlas().upload(*uploadPass);
renderTree.getPatternAtlas().upload(*uploadPass);
#if MLN_DRAWABLE_RENDERER
// Give the layers a chance to upload
orchestrator.observeLayerGroups([&](LayerGroupBase& layerGroup) { layerGroup.upload(*uploadPass); });
#endif
}
// - 3D PASS
@@ -152,6 +163,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
}
parameters.staticData.depthRenderbuffer->setShouldClear(true);
#if MLN_LEGACY_RENDERER
int32_t i = static_cast<int32_t>(layerRenderItems.size()) - 1;
for (auto it = layerRenderItems.begin(); it != layerRenderItems.end() && i >= 0; ++it, --i) {
parameters.currentLayer = i;
@@ -161,6 +173,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
renderItem.render(parameters);
}
}
#endif
}
// - CLEAR
@@ -179,7 +192,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
}
// Actually render the layers
#if MLN_DRAWABLE_RENDERER
// Drawables
const auto drawableOpaquePass = [&] {
const auto debugGroup(parameters.renderPass->createDebugGroup("drawables-opaque"));
@@ -210,7 +223,9 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
}
});
};
#endif
#if MLN_LEGACY_RENDERER
// Render everything top-to-bottom by using reverse iterators. Render opaque objects first.
const auto renderLayerOpaquePass = [&] {
const auto debugGroup(parameters.renderPass->createDebugGroup("opaque"));
@@ -246,8 +261,16 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
}
}
};
#endif // MLN_LEGACY_RENDERER
#ifdef SPLIT_VIEW
#if (MLN_DRAWABLE_RENDERER && !MLN_LEGACY_RENDERER)
drawableOpaquePass();
drawableTranslucentPass();
#elif (MLN_LEGACY_RENDERER && !MLN_DRAWABLE_RENDERER)
renderLayerOpaquePass();
renderLayerTranslucentPass();
#elif (MLN_DRAWABLE_RENDERER && MLN_LEGACY_RENDERER)
#if MLN_RENDERER_SPLIT_VIEW
[[maybe_unused]] const auto W = backend.getDefaultRenderable().getSize().width;
[[maybe_unused]] const auto H = backend.getDefaultRenderable().getSize().height;
[[maybe_unused]] const auto halfW = static_cast<platform::GLsizei>(backend.getDefaultRenderable().getSize().width *
@@ -255,7 +278,7 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
[[maybe_unused]] const auto halfH = static_cast<platform::GLsizei>(backend.getDefaultRenderable().getSize().height *
0.5f);
platform::glEnable(GL_SCISSOR_TEST);
#ifdef QUAD_SPLIT_VIEW
#if MLN_RENDERER_QUAD_SPLIT_VIEW
// Drawable LayerGroups on the left
// Opaque only on top
platform::glScissor(0, 0, halfW, H);
@@ -293,17 +316,21 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
// Reset viewport
platform::glScissor(0, 0, W, H);
platform::glDisable(GL_SCISSOR_TEST);
#else // ifdef SPLIT_VIEW
#else // ifdef MLN_RENDERER_SPLIT_VIEW
// Do RenderLayers first, drawables last
renderLayerOpaquePass();
drawableOpaquePass();
renderLayerTranslucentPass();
drawableOpaquePass();
drawableTranslucentPass();
#endif // MLN_RENDERER_SPLIT_VIEW
#else
static_assert(0, "Must define one of (MLN_DRAWABLE_RENDERER, MLN_LEGACY_RENDERER)");
#endif
// - DEBUG PASS --------------------------------------------------------------------------------
#if MLN_LEGACY_RENDERER
// - DEBUG PASS
// --------------------------------------------------------------------------------
// Renders debug overlays.
{
const auto debugGroup(parameters.renderPass->createDebugGroup("debug"));
@@ -326,10 +353,13 @@ void Renderer::Impl::render(const RenderTree& renderTree) {
parameters.context.visualizeDepthBuffer(parameters.depthRangeSize);
}
#endif
#endif // MLN_LEGACY_RENDERER
#if MLN_DRAWABLE_RENDERER
// Give the layers a chance to do cleanup
orchestrator.observeLayerGroups(
[&](LayerGroupBase& layerGroup) { layerGroup.postRender(orchestrator, parameters); });
#endif
// Ends the RenderPass
parameters.renderPass.reset();

View File

@@ -9,6 +9,7 @@ TileRenderData::TileRenderData(std::shared_ptr<TileAtlasTextures> atlasTextures_
TileRenderData::~TileRenderData() = default;
#if MLN_DRAWABLE_RENDERER
static gfx::Texture2DPtr noTexture;
const gfx::Texture2DPtr& TileRenderData::getGlyphAtlasTexture() const {
@@ -18,6 +19,19 @@ const gfx::Texture2DPtr& TileRenderData::getGlyphAtlasTexture() const {
const gfx::Texture2DPtr& TileRenderData::getIconAtlasTexture() const {
return atlasTextures ? atlasTextures->icon : noTexture;
}
#else
const gfx::Texture& TileRenderData::getGlyphAtlasTexture() const {
assert(atlasTextures);
assert(atlasTextures->glyph);
return *atlasTextures->glyph;
}
const gfx::Texture& TileRenderData::getIconAtlasTexture() const {
assert(atlasTextures);
assert(atlasTextures->icon);
return *atlasTextures->icon;
}
#endif
std::optional<ImagePosition> TileRenderData::getPattern(const std::string&) const {
assert(false);

View File

@@ -10,9 +10,12 @@
namespace mbgl {
namespace gfx {
#if MLN_DRAWABLE_RENDERER
class Texture2D;
class UploadPass;
using Texture2DPtr = std::shared_ptr<gfx::Texture2D>;
#endif
class UploadPass;
} // namespace gfx
class Bucket;
@@ -21,15 +24,27 @@ class SourcePrepareParameters;
class TileAtlasTextures {
public:
#if MLN_DRAWABLE_RENDERER
gfx::Texture2DPtr glyph;
gfx::Texture2DPtr icon;
#else
std::optional<gfx::Texture> glyph;
std::optional<gfx::Texture> icon;
#endif
};
class TileRenderData {
public:
virtual ~TileRenderData();
#if MLN_DRAWABLE_RENDERER
const gfx::Texture2DPtr& getGlyphAtlasTexture() const;
const gfx::Texture2DPtr& getIconAtlasTexture() const;
#else
const gfx::Texture& getGlyphAtlasTexture() const;
const gfx::Texture& getIconAtlasTexture() const;
#endif
const std::shared_ptr<TileAtlasTextures>& getAtlasTextures() const { return atlasTextures; }
// To be implemented for concrete tile types.
virtual std::optional<ImagePosition> getPattern(const std::string&) const;

View File

@@ -87,24 +87,39 @@ void GeometryTileRenderData::upload(gfx::UploadPass& uploadPass) {
assert(atlasTextures);
if (layoutResult->glyphAtlasImage && layoutResult->glyphAtlasImage->valid()) {
#if MLN_DRAWABLE_RENDERER
atlasTextures->glyph = uploadPass.getContext().createTexture2D();
atlasTextures->glyph->setSamplerConfiguration(
{gfx::TextureFilterType::Linear, gfx::TextureWrapType::Clamp, gfx::TextureWrapType::Clamp});
atlasTextures->glyph->upload(*layoutResult->glyphAtlasImage);
#else
atlasTextures->glyph = uploadPass.createTexture(*layoutResult->glyphAtlasImage);
#endif
layoutResult->glyphAtlasImage = {};
}
if (layoutResult->iconAtlas.image.valid()) {
#if MLN_DRAWABLE_RENDERER
atlasTextures->icon = uploadPass.getContext().createTexture2D();
atlasTextures->icon->upload(layoutResult->iconAtlas.image);
#else
atlasTextures->icon = uploadPass.createTexture(layoutResult->iconAtlas.image);
#endif
layoutResult->iconAtlas.image = {};
}
if (atlasTextures->icon && !imagePatches.empty()) {
for (const auto& imagePatch : imagePatches) { // patch updated images.
#if MLN_DRAWABLE_RENDERER
atlasTextures->icon->uploadSubRegion(imagePatch.image->image,
imagePatch.paddedRect.x + ImagePosition::padding,
imagePatch.paddedRect.y + ImagePosition::padding);
#else
uploadPass.updateTextureSub(*atlasTextures->icon,
imagePatch.image->image,
imagePatch.paddedRect.x + ImagePosition::padding,
imagePatch.paddedRect.y + ImagePosition::padding);
#endif
}
imagePatches.clear();
}

View File

@@ -1,7 +1,7 @@
#pragma once
#include <mbgl/util/size.hpp>
#include "quaternion.hpp"
#include <mbgl/util/quaternion.hpp>
#include <optional>

View File

@@ -1,4 +1,4 @@
#include "quaternion.hpp"
#include <mbgl/util/quaternion.hpp>
#include <cassert>
#include <cmath>

View File

@@ -1,7 +1,7 @@
#pragma once
#include "mat3.hpp"
#include "mat4.hpp"
#include <mbgl/util/mat3.hpp>
#include <mbgl/util/mat4.hpp>
namespace mbgl {
@@ -39,4 +39,4 @@ struct Quaternion {
bool operator==(const Quaternion&, const Quaternion&);
bool operator!=(const Quaternion&, const Quaternion&);
} // namespace mbgl
} // namespace mbgl