diff options
26 files changed, 184 insertions, 156 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2547cfd5ca..9244a5e501 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,6 +163,8 @@ endif() include(platform/${MBGL_PLATFORM}/config.cmake) +add_definitions(-DMBGL_RENDER_BACKEND_OPENGL=1) + if(WITH_EGL) add_definitions(-DMBGL_WITH_EGL=1) endif() diff --git a/cmake/mbgl.cmake b/cmake/mbgl.cmake index 1b4338a0bb..279ead6eb2 100644 --- a/cmake/mbgl.cmake +++ b/cmake/mbgl.cmake @@ -6,6 +6,10 @@ if (NOT MBGL_PLATFORM) endif() endif() +if(MBGL_WITH_OPENGL) + add_definitions(-DMBGL_RENDER_BACKEND_OPENGL=1) +endif() + if(WITH_NODEJS) find_program(NodeJS_EXECUTABLE NAMES nodejs node) if (NOT NodeJS_EXECUTABLE) diff --git a/include/mbgl/style/layers/custom_layer.hpp b/include/mbgl/gl/custom_layer.hpp index 5dce484980..5dce484980 100644 --- a/include/mbgl/style/layers/custom_layer.hpp +++ b/include/mbgl/gl/custom_layer.hpp diff --git a/include/mbgl/layermanager/custom_layer_factory.hpp b/include/mbgl/gl/custom_layer_factory.hpp index 963a3dc2fd..963a3dc2fd 100644 --- a/include/mbgl/layermanager/custom_layer_factory.hpp +++ b/include/mbgl/gl/custom_layer_factory.hpp diff --git a/include/mbgl/platform/gl_functions.hpp b/include/mbgl/platform/gl_functions.hpp index fab3e3aa36..b617b35610 100644 --- a/include/mbgl/platform/gl_functions.hpp +++ b/include/mbgl/platform/gl_functions.hpp @@ -334,4 +334,4 @@ void glCheckError(const char *cmd, const char *file, int line); #endif } // namespace platform -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/next/CMakeLists.txt b/next/CMakeLists.txt index 95b330992b..11b4418aad 100644 --- a/next/CMakeLists.txt +++ b/next/CMakeLists.txt @@ -23,6 +23,7 @@ option(MBGL_WITH_COVERAGE "Enable code coverage collection" OFF) option(MBGL_WITH_QT "Build Mapbox GL Qt bindings" OFF) option(MBGL_WITH_SANITIZER "Use [address|thread|undefined] here" OFF) option(MBGL_WITH_RTTI "Compile with runtime type information" OFF) +option(MBGL_WITH_OPENGL "Build with OpenGL renderer" ON) add_library( mbgl-compiler-options INTERFACE @@ -93,16 +94,12 @@ add_library( ${MBGL_ROOT}/include/mbgl/actor/message.hpp ${MBGL_ROOT}/include/mbgl/actor/scheduler.hpp ${MBGL_ROOT}/include/mbgl/annotation/annotation.hpp - ${MBGL_ROOT}/include/mbgl/gfx/backend.hpp ${MBGL_ROOT}/include/mbgl/gfx/backend_scope.hpp ${MBGL_ROOT}/include/mbgl/gfx/renderable.hpp ${MBGL_ROOT}/include/mbgl/gfx/renderer_backend.hpp ${MBGL_ROOT}/include/mbgl/gfx/rendering_stats.hpp - ${MBGL_ROOT}/include/mbgl/gl/renderable_resource.hpp - ${MBGL_ROOT}/include/mbgl/gl/renderer_backend.hpp ${MBGL_ROOT}/include/mbgl/layermanager/background_layer_factory.hpp ${MBGL_ROOT}/include/mbgl/layermanager/circle_layer_factory.hpp - ${MBGL_ROOT}/include/mbgl/layermanager/custom_layer_factory.hpp ${MBGL_ROOT}/include/mbgl/layermanager/fill_extrusion_layer_factory.hpp ${MBGL_ROOT}/include/mbgl/layermanager/fill_layer_factory.hpp ${MBGL_ROOT}/include/mbgl/layermanager/heatmap_layer_factory.hpp @@ -124,7 +121,6 @@ add_library( ${MBGL_ROOT}/include/mbgl/math/log2.hpp ${MBGL_ROOT}/include/mbgl/math/minmax.hpp ${MBGL_ROOT}/include/mbgl/math/wrap.hpp - ${MBGL_ROOT}/include/mbgl/platform/gl_functions.hpp ${MBGL_ROOT}/include/mbgl/platform/thread.hpp ${MBGL_ROOT}/include/mbgl/renderer/query.hpp ${MBGL_ROOT}/include/mbgl/renderer/renderer.hpp @@ -200,7 +196,6 @@ add_library( ${MBGL_ROOT}/include/mbgl/style/layer_properties.hpp ${MBGL_ROOT}/include/mbgl/style/layers/background_layer.hpp ${MBGL_ROOT}/include/mbgl/style/layers/circle_layer.hpp - ${MBGL_ROOT}/include/mbgl/style/layers/custom_layer.hpp ${MBGL_ROOT}/include/mbgl/style/layers/fill_extrusion_layer.hpp ${MBGL_ROOT}/include/mbgl/style/layers/fill_layer.hpp ${MBGL_ROOT}/include/mbgl/style/layers/heatmap_layer.hpp @@ -324,51 +319,8 @@ add_library( ${MBGL_ROOT}/src/mbgl/gfx/upload_pass.hpp ${MBGL_ROOT}/src/mbgl/gfx/vertex_buffer.hpp ${MBGL_ROOT}/src/mbgl/gfx/vertex_vector.hpp - ${MBGL_ROOT}/src/mbgl/gl/attribute.cpp - ${MBGL_ROOT}/src/mbgl/gl/attribute.hpp - ${MBGL_ROOT}/src/mbgl/gl/command_encoder.cpp - ${MBGL_ROOT}/src/mbgl/gl/command_encoder.hpp - ${MBGL_ROOT}/src/mbgl/gl/context.cpp - ${MBGL_ROOT}/src/mbgl/gl/context.hpp - ${MBGL_ROOT}/src/mbgl/gl/debugging_extension.cpp - ${MBGL_ROOT}/src/mbgl/gl/debugging_extension.hpp - ${MBGL_ROOT}/src/mbgl/gl/defines.hpp - ${MBGL_ROOT}/src/mbgl/gl/draw_scope_resource.hpp - ${MBGL_ROOT}/src/mbgl/gl/enum.cpp - ${MBGL_ROOT}/src/mbgl/gl/enum.hpp - ${MBGL_ROOT}/src/mbgl/gl/extension.hpp - ${MBGL_ROOT}/src/mbgl/gl/framebuffer.hpp - ${MBGL_ROOT}/src/mbgl/gl/index_buffer_resource.cpp - ${MBGL_ROOT}/src/mbgl/gl/index_buffer_resource.hpp - ${MBGL_ROOT}/src/mbgl/gl/object.cpp - ${MBGL_ROOT}/src/mbgl/gl/object.hpp - ${MBGL_ROOT}/src/mbgl/gl/offscreen_texture.cpp - ${MBGL_ROOT}/src/mbgl/gl/offscreen_texture.hpp - ${MBGL_ROOT}/src/mbgl/gl/program.hpp - ${MBGL_ROOT}/src/mbgl/gl/render_pass.cpp - ${MBGL_ROOT}/src/mbgl/gl/render_pass.hpp - ${MBGL_ROOT}/src/mbgl/gl/renderbuffer_resource.hpp - ${MBGL_ROOT}/src/mbgl/gl/renderer_backend.cpp - ${MBGL_ROOT}/src/mbgl/gl/state.hpp - ${MBGL_ROOT}/src/mbgl/gl/texture.cpp - ${MBGL_ROOT}/src/mbgl/gl/texture.hpp - ${MBGL_ROOT}/src/mbgl/gl/texture_resource.cpp - ${MBGL_ROOT}/src/mbgl/gl/texture_resource.hpp - ${MBGL_ROOT}/src/mbgl/gl/types.hpp - ${MBGL_ROOT}/src/mbgl/gl/uniform.cpp - ${MBGL_ROOT}/src/mbgl/gl/uniform.hpp - ${MBGL_ROOT}/src/mbgl/gl/upload_pass.cpp - ${MBGL_ROOT}/src/mbgl/gl/upload_pass.hpp - ${MBGL_ROOT}/src/mbgl/gl/value.cpp - ${MBGL_ROOT}/src/mbgl/gl/value.hpp - ${MBGL_ROOT}/src/mbgl/gl/vertex_array.cpp - ${MBGL_ROOT}/src/mbgl/gl/vertex_array.hpp - ${MBGL_ROOT}/src/mbgl/gl/vertex_array_extension.hpp - ${MBGL_ROOT}/src/mbgl/gl/vertex_buffer_resource.cpp - ${MBGL_ROOT}/src/mbgl/gl/vertex_buffer_resource.hpp ${MBGL_ROOT}/src/mbgl/layermanager/background_layer_factory.cpp ${MBGL_ROOT}/src/mbgl/layermanager/circle_layer_factory.cpp - ${MBGL_ROOT}/src/mbgl/layermanager/custom_layer_factory.cpp ${MBGL_ROOT}/src/mbgl/layermanager/fill_extrusion_layer_factory.cpp ${MBGL_ROOT}/src/mbgl/layermanager/fill_layer_factory.cpp ${MBGL_ROOT}/src/mbgl/layermanager/heatmap_layer_factory.cpp @@ -401,7 +353,6 @@ add_library( ${MBGL_ROOT}/src/mbgl/map/transform_state.hpp ${MBGL_ROOT}/src/mbgl/map/zoom_history.hpp ${MBGL_ROOT}/src/mbgl/math/log2.cpp - ${MBGL_ROOT}/src/mbgl/platform/gl_functions.cpp ${MBGL_ROOT}/src/mbgl/programs/attributes.hpp ${MBGL_ROOT}/src/mbgl/programs/background_pattern_program.hpp ${MBGL_ROOT}/src/mbgl/programs/background_program.cpp @@ -423,37 +374,6 @@ add_library( ${MBGL_ROOT}/src/mbgl/programs/fill_pattern_program.hpp ${MBGL_ROOT}/src/mbgl/programs/fill_program.cpp ${MBGL_ROOT}/src/mbgl/programs/fill_program.hpp - ${MBGL_ROOT}/src/mbgl/programs/gl/background.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/background_pattern.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/circle.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/clipping_mask.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/collision_box.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/collision_circle.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/debug.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/fill.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/fill_extrusion.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/fill_extrusion_pattern.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/fill_outline.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/fill_outline_pattern.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/fill_pattern.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/heatmap.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/heatmap_texture.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/hillshade.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/hillshade_prepare.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/line.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/line_gradient.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/line_pattern.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/line_sdf.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/preludes.hpp - ${MBGL_ROOT}/src/mbgl/programs/gl/raster.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/shader_source.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/shader_source.hpp - ${MBGL_ROOT}/src/mbgl/programs/gl/shaders.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/shaders.hpp - ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_icon.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_sdf_icon.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_sdf_text.cpp - ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_text_and_icon.cpp ${MBGL_ROOT}/src/mbgl/programs/heatmap_program.cpp ${MBGL_ROOT}/src/mbgl/programs/heatmap_program.hpp ${MBGL_ROOT}/src/mbgl/programs/heatmap_texture_program.cpp @@ -519,8 +439,6 @@ add_library( ${MBGL_ROOT}/src/mbgl/renderer/layers/render_background_layer.hpp ${MBGL_ROOT}/src/mbgl/renderer/layers/render_circle_layer.cpp ${MBGL_ROOT}/src/mbgl/renderer/layers/render_circle_layer.hpp - ${MBGL_ROOT}/src/mbgl/renderer/layers/render_custom_layer.cpp - ${MBGL_ROOT}/src/mbgl/renderer/layers/render_custom_layer.hpp ${MBGL_ROOT}/src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp ${MBGL_ROOT}/src/mbgl/renderer/layers/render_fill_extrusion_layer.hpp ${MBGL_ROOT}/src/mbgl/renderer/layers/render_fill_layer.cpp @@ -679,9 +597,6 @@ add_library( ${MBGL_ROOT}/src/mbgl/style/layers/circle_layer_impl.hpp ${MBGL_ROOT}/src/mbgl/style/layers/circle_layer_properties.cpp ${MBGL_ROOT}/src/mbgl/style/layers/circle_layer_properties.hpp - ${MBGL_ROOT}/src/mbgl/style/layers/custom_layer.cpp - ${MBGL_ROOT}/src/mbgl/style/layers/custom_layer_impl.cpp - ${MBGL_ROOT}/src/mbgl/style/layers/custom_layer_impl.hpp ${MBGL_ROOT}/src/mbgl/style/layers/fill_extrusion_layer.cpp ${MBGL_ROOT}/src/mbgl/style/layers/fill_extrusion_layer_impl.cpp ${MBGL_ROOT}/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp @@ -885,6 +800,104 @@ add_library( ${MBGL_ROOT}/src/parsedate/parsedate.hpp ) +if(MBGL_WITH_OPENGL) + message("-- Configuring GL-Native with OpenGL renderer backend") + target_compile_definitions( + mbgl-core + PRIVATE MBGL_RENDER_BACKEND_OPENGL=1 + ) + target_sources( + mbgl-core + PRIVATE + ${MBGL_ROOT}/include/mbgl/gfx/backend.hpp + ${MBGL_ROOT}/include/mbgl/gl/custom_layer.hpp + ${MBGL_ROOT}/include/mbgl/gl/custom_layer_factory.hpp + ${MBGL_ROOT}/include/mbgl/gl/renderable_resource.hpp + ${MBGL_ROOT}/include/mbgl/gl/renderer_backend.hpp + ${MBGL_ROOT}/include/mbgl/platform/gl_functions.hpp + ${MBGL_ROOT}/src/mbgl/gl/attribute.cpp + ${MBGL_ROOT}/src/mbgl/gl/attribute.hpp + ${MBGL_ROOT}/src/mbgl/gl/command_encoder.cpp + ${MBGL_ROOT}/src/mbgl/gl/command_encoder.hpp + ${MBGL_ROOT}/src/mbgl/gl/context.cpp + ${MBGL_ROOT}/src/mbgl/gl/context.hpp + ${MBGL_ROOT}/src/mbgl/gl/custom_layer.cpp + ${MBGL_ROOT}/src/mbgl/gl/custom_layer_factory.cpp + ${MBGL_ROOT}/src/mbgl/gl/custom_layer_impl.cpp + ${MBGL_ROOT}/src/mbgl/gl/custom_layer_impl.hpp + ${MBGL_ROOT}/src/mbgl/gl/debugging_extension.cpp + ${MBGL_ROOT}/src/mbgl/gl/debugging_extension.hpp + ${MBGL_ROOT}/src/mbgl/gl/defines.hpp + ${MBGL_ROOT}/src/mbgl/gl/draw_scope_resource.hpp + ${MBGL_ROOT}/src/mbgl/gl/enum.cpp + ${MBGL_ROOT}/src/mbgl/gl/enum.hpp + ${MBGL_ROOT}/src/mbgl/gl/extension.hpp + ${MBGL_ROOT}/src/mbgl/gl/framebuffer.hpp + ${MBGL_ROOT}/src/mbgl/gl/index_buffer_resource.cpp + ${MBGL_ROOT}/src/mbgl/gl/index_buffer_resource.hpp + ${MBGL_ROOT}/src/mbgl/gl/object.cpp + ${MBGL_ROOT}/src/mbgl/gl/object.hpp + ${MBGL_ROOT}/src/mbgl/gl/offscreen_texture.cpp + ${MBGL_ROOT}/src/mbgl/gl/offscreen_texture.hpp + ${MBGL_ROOT}/src/mbgl/gl/program.hpp + ${MBGL_ROOT}/src/mbgl/gl/render_pass.cpp + ${MBGL_ROOT}/src/mbgl/gl/render_pass.hpp + ${MBGL_ROOT}/src/mbgl/gl/renderbuffer_resource.hpp + ${MBGL_ROOT}/src/mbgl/gl/renderer_backend.cpp + ${MBGL_ROOT}/src/mbgl/gl/render_custom_layer.cpp + ${MBGL_ROOT}/src/mbgl/gl/render_custom_layer.hpp + ${MBGL_ROOT}/src/mbgl/gl/state.hpp + ${MBGL_ROOT}/src/mbgl/gl/texture.cpp + ${MBGL_ROOT}/src/mbgl/gl/texture.hpp + ${MBGL_ROOT}/src/mbgl/gl/texture_resource.cpp + ${MBGL_ROOT}/src/mbgl/gl/texture_resource.hpp + ${MBGL_ROOT}/src/mbgl/gl/types.hpp + ${MBGL_ROOT}/src/mbgl/gl/uniform.cpp + ${MBGL_ROOT}/src/mbgl/gl/uniform.hpp + ${MBGL_ROOT}/src/mbgl/gl/upload_pass.cpp + ${MBGL_ROOT}/src/mbgl/gl/upload_pass.hpp + ${MBGL_ROOT}/src/mbgl/gl/value.cpp + ${MBGL_ROOT}/src/mbgl/gl/value.hpp + ${MBGL_ROOT}/src/mbgl/gl/vertex_array.cpp + ${MBGL_ROOT}/src/mbgl/gl/vertex_array.hpp + ${MBGL_ROOT}/src/mbgl/gl/vertex_array_extension.hpp + ${MBGL_ROOT}/src/mbgl/gl/vertex_buffer_resource.cpp + ${MBGL_ROOT}/src/mbgl/gl/vertex_buffer_resource.hpp + ${MBGL_ROOT}/src/mbgl/platform/gl_functions.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/background.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/background_pattern.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/circle.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/clipping_mask.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/collision_box.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/collision_circle.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/debug.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/fill.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/fill_extrusion.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/fill_extrusion_pattern.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/fill_outline.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/fill_outline_pattern.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/fill_pattern.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/heatmap.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/heatmap_texture.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/hillshade.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/hillshade_prepare.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/line.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/line_gradient.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/line_pattern.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/line_sdf.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/preludes.hpp + ${MBGL_ROOT}/src/mbgl/programs/gl/raster.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/shader_source.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/shader_source.hpp + ${MBGL_ROOT}/src/mbgl/programs/gl/shaders.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/shaders.hpp + ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_icon.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_sdf_icon.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_sdf_text.cpp + ${MBGL_ROOT}/src/mbgl/programs/gl/symbol_text_and_icon.cpp + ) +endif() + if(EXISTS ${MBGL_ROOT}/.git/HEAD) execute_process( COMMAND diff --git a/next/test/CMakeLists.txt b/next/test/CMakeLists.txt index dc6ea3987c..ce980f78d1 100644 --- a/next/test/CMakeLists.txt +++ b/next/test/CMakeLists.txt @@ -110,6 +110,13 @@ add_library( ${MBGL_ROOT}/test/util/url.test.cpp ) +if(MBGL_WITH_OPENGL) + target_compile_definitions( + mbgl-test + PRIVATE MBGL_RENDER_BACKEND_OPENGL=1 + ) +endif() + if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Android) message("Target platform does not support HTTP tests or dependencies not found.") diff --git a/platform/android/src/example_custom_layer.cpp b/platform/android/src/example_custom_layer.cpp index e805532541..e1b80ffba5 100644 --- a/platform/android/src/example_custom_layer.cpp +++ b/platform/android/src/example_custom_layer.cpp @@ -1,8 +1,8 @@ -#include <jni.h> #include <GLES2/gl2.h> -#include <sstream> #include <android/log.h> -#include <mbgl/style/layers/custom_layer.hpp> +#include <jni.h> +#include <mbgl/gl/custom_layer.hpp> +#include <sstream> // DEBUGGING diff --git a/platform/android/src/style/layers/custom_layer.hpp b/platform/android/src/style/layers/custom_layer.hpp index 0d6f4a408d..dc328a2137 100644 --- a/platform/android/src/style/layers/custom_layer.hpp +++ b/platform/android/src/style/layers/custom_layer.hpp @@ -1,9 +1,9 @@ #pragma once -#include "layer.hpp" -#include <mbgl/layermanager/custom_layer_factory.hpp> -#include <mbgl/style/layers/custom_layer.hpp> #include <jni/jni.hpp> +#include <mbgl/gl/custom_layer.hpp> +#include <mbgl/gl/custom_layer_factory.hpp> +#include "layer.hpp" namespace mbgl { namespace android { diff --git a/platform/darwin/src/MGLOpenGLStyleLayer.mm b/platform/darwin/src/MGLOpenGLStyleLayer.mm index b010e363b3..8c9e4b02a2 100644 --- a/platform/darwin/src/MGLOpenGLStyleLayer.mm +++ b/platform/darwin/src/MGLOpenGLStyleLayer.mm @@ -6,7 +6,7 @@ #import "MGLStyleLayer_Private.h" #import "MGLGeometry_Private.h" -#include <mbgl/style/layers/custom_layer.hpp> +#include <mbgl/gl/custom_layer.hpp> #include <mbgl/math/wrap.hpp> class MGLOpenGLLayerHost : public mbgl::style::CustomLayerHost { diff --git a/platform/darwin/src/MGLOpenGLStyleLayer_Private.h b/platform/darwin/src/MGLOpenGLStyleLayer_Private.h index 27a536c60c..15dd6bf816 100644 --- a/platform/darwin/src/MGLOpenGLStyleLayer_Private.h +++ b/platform/darwin/src/MGLOpenGLStyleLayer_Private.h @@ -2,7 +2,7 @@ #include "MGLStyleLayer_Private.h" -#include <mbgl/layermanager/custom_layer_factory.hpp> +#include <mbgl/gl/custom_layer_factory.hpp> namespace mbgl { diff --git a/platform/default/src/mbgl/layermanager/layer_manager.cpp b/platform/default/src/mbgl/layermanager/layer_manager.cpp index b8abf794fc..f9e46d78ab 100644 --- a/platform/default/src/mbgl/layermanager/layer_manager.cpp +++ b/platform/default/src/mbgl/layermanager/layer_manager.cpp @@ -2,7 +2,9 @@ #include <mbgl/layermanager/background_layer_factory.hpp> #include <mbgl/layermanager/circle_layer_factory.hpp> -#include <mbgl/layermanager/custom_layer_factory.hpp> +#ifdef MBGL_RENDER_BACKEND_OPENGL +#include <mbgl/gl/custom_layer_factory.hpp> +#endif #include <mbgl/layermanager/fill_extrusion_layer_factory.hpp> #include <mbgl/layermanager/fill_layer_factory.hpp> #include <mbgl/layermanager/heatmap_layer_factory.hpp> @@ -59,9 +61,11 @@ LayerManagerDefault::LayerManagerDefault() { #if !defined(MBGL_LAYER_HEATMAP_DISABLE_ALL) addLayerType(std::make_unique<HeatmapLayerFactory>()); #endif +#ifdef MBGL_RENDER_BACKEND_OPENGL #if !defined(MBGL_LAYER_CUSTOM_DISABLE_ALL) addLayerType(std::make_unique<CustomLayerFactory>()); #endif +#endif } void LayerManagerDefault::addLayerType(std::unique_ptr<LayerFactory> factory) { diff --git a/platform/ios/src/MGLMapView.mm b/platform/ios/src/MGLMapView.mm index d8470aa999..1f4e2ffa74 100644 --- a/platform/ios/src/MGLMapView.mm +++ b/platform/ios/src/MGLMapView.mm @@ -4,6 +4,7 @@ #include <mbgl/map/map.hpp> #include <mbgl/map/map_options.hpp> #include <mbgl/annotation/annotation.hpp> +#include <mbgl/gl/custom_layer.hpp> #include <mbgl/map/camera.hpp> #include <mbgl/map/mode.hpp> #include <mbgl/util/platform.hpp> @@ -13,7 +14,6 @@ #include <mbgl/style/style.hpp> #include <mbgl/style/image.hpp> #include <mbgl/style/transition_options.hpp> -#include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/renderer/renderer.hpp> #include <mbgl/math/wrap.hpp> #include <mbgl/util/exception.hpp> diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp index fd72e8cf02..ab99173b2a 100644 --- a/platform/qt/src/qmapboxgl.cpp +++ b/platform/qt/src/qmapboxgl.cpp @@ -9,6 +9,7 @@ #include <mbgl/actor/scheduler.hpp> #include <mbgl/annotation/annotation.hpp> +#include <mbgl/gl/custom_layer.hpp> #include <mbgl/map/camera.hpp> #include <mbgl/map/map.hpp> #include <mbgl/map/map_options.hpp> @@ -28,7 +29,6 @@ #include <mbgl/style/image.hpp> #include <mbgl/style/layers/background_layer.hpp> #include <mbgl/style/layers/circle_layer.hpp> -#include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/style/layers/fill_extrusion_layer.hpp> #include <mbgl/style/layers/fill_layer.hpp> #include <mbgl/style/layers/line_layer.hpp> diff --git a/src/core-files.json b/src/core-files.json index fcc508fb3a..3c0e128b18 100644 --- a/src/core-files.json +++ b/src/core-files.json @@ -21,11 +21,15 @@ "src/mbgl/gl/attribute.cpp", "src/mbgl/gl/command_encoder.cpp", "src/mbgl/gl/context.cpp", + "src/mbgl/gl/custom_layer.cpp", + "src/mbgl/gl/custom_layer_factory.cpp", + "src/mbgl/gl/custom_layer_impl.cpp", "src/mbgl/gl/debugging_extension.cpp", "src/mbgl/gl/enum.cpp", "src/mbgl/gl/index_buffer_resource.cpp", "src/mbgl/gl/object.cpp", "src/mbgl/gl/offscreen_texture.cpp", + "src/mbgl/gl/render_custom_layer.cpp", "src/mbgl/gl/render_pass.cpp", "src/mbgl/gl/renderer_backend.cpp", "src/mbgl/gl/texture.cpp", @@ -37,7 +41,6 @@ "src/mbgl/gl/vertex_buffer_resource.cpp", "src/mbgl/layermanager/background_layer_factory.cpp", "src/mbgl/layermanager/circle_layer_factory.cpp", - "src/mbgl/layermanager/custom_layer_factory.cpp", "src/mbgl/layermanager/fill_extrusion_layer_factory.cpp", "src/mbgl/layermanager/fill_layer_factory.cpp", "src/mbgl/layermanager/heatmap_layer_factory.cpp", @@ -120,7 +123,6 @@ "src/mbgl/renderer/image_manager.cpp", "src/mbgl/renderer/layers/render_background_layer.cpp", "src/mbgl/renderer/layers/render_circle_layer.cpp", - "src/mbgl/renderer/layers/render_custom_layer.cpp", "src/mbgl/renderer/layers/render_fill_extrusion_layer.cpp", "src/mbgl/renderer/layers/render_fill_layer.cpp", "src/mbgl/renderer/layers/render_heatmap_layer.cpp", @@ -218,8 +220,6 @@ "src/mbgl/style/layers/circle_layer.cpp", "src/mbgl/style/layers/circle_layer_impl.cpp", "src/mbgl/style/layers/circle_layer_properties.cpp", - "src/mbgl/style/layers/custom_layer.cpp", - "src/mbgl/style/layers/custom_layer_impl.cpp", "src/mbgl/style/layers/fill_extrusion_layer.cpp", "src/mbgl/style/layers/fill_extrusion_layer_impl.cpp", "src/mbgl/style/layers/fill_extrusion_layer_properties.cpp", @@ -339,13 +339,14 @@ "mbgl/gfx/renderable.hpp": "include/mbgl/gfx/renderable.hpp", "mbgl/gfx/renderer_backend.hpp": "include/mbgl/gfx/renderer_backend.hpp", "mbgl/gfx/rendering_stats.hpp": "include/mbgl/gfx/rendering_stats.hpp", + "mbgl/gl/custom_layer.hpp": "include/mbgl/gl/custom_layer.hpp", + "mbgl/gl/custom_layer_factory.hpp": "include/mbgl/gl/custom_layer_factory.hpp", "mbgl/gl/renderable_resource.hpp": "include/mbgl/gl/renderable_resource.hpp", "mbgl/gl/renderer_backend.hpp": "include/mbgl/gl/renderer_backend.hpp", "mbgl/i18n/collator.hpp": "include/mbgl/i18n/collator.hpp", "mbgl/i18n/number_format.hpp": "include/mbgl/i18n/number_format.hpp", "mbgl/layermanager/background_layer_factory.hpp": "include/mbgl/layermanager/background_layer_factory.hpp", "mbgl/layermanager/circle_layer_factory.hpp": "include/mbgl/layermanager/circle_layer_factory.hpp", - "mbgl/layermanager/custom_layer_factory.hpp": "include/mbgl/layermanager/custom_layer_factory.hpp", "mbgl/layermanager/fill_extrusion_layer_factory.hpp": "include/mbgl/layermanager/fill_extrusion_layer_factory.hpp", "mbgl/layermanager/fill_layer_factory.hpp": "include/mbgl/layermanager/fill_layer_factory.hpp", "mbgl/layermanager/heatmap_layer_factory.hpp": "include/mbgl/layermanager/heatmap_layer_factory.hpp", @@ -443,7 +444,6 @@ "mbgl/style/layer_properties.hpp": "include/mbgl/style/layer_properties.hpp", "mbgl/style/layers/background_layer.hpp": "include/mbgl/style/layers/background_layer.hpp", "mbgl/style/layers/circle_layer.hpp": "include/mbgl/style/layers/circle_layer.hpp", - "mbgl/style/layers/custom_layer.hpp": "include/mbgl/style/layers/custom_layer.hpp", "mbgl/style/layers/fill_extrusion_layer.hpp": "include/mbgl/style/layers/fill_extrusion_layer.hpp", "mbgl/style/layers/fill_layer.hpp": "include/mbgl/style/layers/fill_layer.hpp", "mbgl/style/layers/heatmap_layer.hpp": "include/mbgl/style/layers/heatmap_layer.hpp", @@ -558,6 +558,7 @@ "mbgl/gl/attribute.hpp": "src/mbgl/gl/attribute.hpp", "mbgl/gl/command_encoder.hpp": "src/mbgl/gl/command_encoder.hpp", "mbgl/gl/context.hpp": "src/mbgl/gl/context.hpp", + "mbgl/gl/custom_layer_impl.hpp": "src/mbgl/gl/custom_layer_impl.hpp", "mbgl/gl/debugging_extension.hpp": "src/mbgl/gl/debugging_extension.hpp", "mbgl/gl/defines.hpp": "src/mbgl/gl/defines.hpp", "mbgl/gl/draw_scope_resource.hpp": "src/mbgl/gl/draw_scope_resource.hpp", @@ -568,6 +569,7 @@ "mbgl/gl/object.hpp": "src/mbgl/gl/object.hpp", "mbgl/gl/offscreen_texture.hpp": "src/mbgl/gl/offscreen_texture.hpp", "mbgl/gl/program.hpp": "src/mbgl/gl/program.hpp", + "mbgl/gl/render_custom_layer.hpp": "src/mbgl/gl/render_custom_layer.hpp", "mbgl/gl/render_pass.hpp": "src/mbgl/gl/render_pass.hpp", "mbgl/gl/renderbuffer_resource.hpp": "src/mbgl/gl/renderbuffer_resource.hpp", "mbgl/gl/state.hpp": "src/mbgl/gl/state.hpp", @@ -648,7 +650,6 @@ "mbgl/renderer/image_manager_observer.hpp": "src/mbgl/renderer/image_manager_observer.hpp", "mbgl/renderer/layers/render_background_layer.hpp": "src/mbgl/renderer/layers/render_background_layer.hpp", "mbgl/renderer/layers/render_circle_layer.hpp": "src/mbgl/renderer/layers/render_circle_layer.hpp", - "mbgl/renderer/layers/render_custom_layer.hpp": "src/mbgl/renderer/layers/render_custom_layer.hpp", "mbgl/renderer/layers/render_fill_extrusion_layer.hpp": "src/mbgl/renderer/layers/render_fill_extrusion_layer.hpp", "mbgl/renderer/layers/render_fill_layer.hpp": "src/mbgl/renderer/layers/render_fill_layer.hpp", "mbgl/renderer/layers/render_heatmap_layer.hpp": "src/mbgl/renderer/layers/render_heatmap_layer.hpp", @@ -710,7 +711,6 @@ "mbgl/style/layers/background_layer_properties.hpp": "src/mbgl/style/layers/background_layer_properties.hpp", "mbgl/style/layers/circle_layer_impl.hpp": "src/mbgl/style/layers/circle_layer_impl.hpp", "mbgl/style/layers/circle_layer_properties.hpp": "src/mbgl/style/layers/circle_layer_properties.hpp", - "mbgl/style/layers/custom_layer_impl.hpp": "src/mbgl/style/layers/custom_layer_impl.hpp", "mbgl/style/layers/fill_extrusion_layer_impl.hpp": "src/mbgl/style/layers/fill_extrusion_layer_impl.hpp", "mbgl/style/layers/fill_extrusion_layer_properties.hpp": "src/mbgl/style/layers/fill_extrusion_layer_properties.hpp", "mbgl/style/layers/fill_layer_impl.hpp": "src/mbgl/style/layers/fill_layer_impl.hpp", diff --git a/src/mbgl/style/layers/custom_layer.cpp b/src/mbgl/gl/custom_layer.cpp index 30bb2d220e..456467e904 100644 --- a/src/mbgl/style/layers/custom_layer.cpp +++ b/src/mbgl/gl/custom_layer.cpp @@ -1,9 +1,8 @@ -#include <mbgl/style/layers/custom_layer.hpp> -#include <mbgl/style/layers/custom_layer_impl.hpp> +#include <mbgl/gl/custom_layer.hpp> +#include <mbgl/gl/custom_layer_impl.hpp> +#include <mbgl/gl/render_custom_layer.hpp> #include <mbgl/style/layer_observer.hpp> -#include <mbgl/renderer/layers/render_custom_layer.hpp> - namespace mbgl { namespace style { diff --git a/src/mbgl/layermanager/custom_layer_factory.cpp b/src/mbgl/gl/custom_layer_factory.cpp index f84f261e79..616d0271e0 100644 --- a/src/mbgl/layermanager/custom_layer_factory.cpp +++ b/src/mbgl/gl/custom_layer_factory.cpp @@ -1,8 +1,7 @@ -#include <mbgl/layermanager/custom_layer_factory.hpp> - -#include <mbgl/renderer/layers/render_custom_layer.hpp> -#include <mbgl/style/layers/custom_layer.hpp> -#include <mbgl/style/layers/custom_layer_impl.hpp> +#include <mbgl/gl/custom_layer.hpp> +#include <mbgl/gl/custom_layer_factory.hpp> +#include <mbgl/gl/custom_layer_impl.hpp> +#include <mbgl/gl/render_custom_layer.hpp> namespace mbgl { diff --git a/src/mbgl/style/layers/custom_layer_impl.cpp b/src/mbgl/gl/custom_layer_impl.cpp index f82cb1ea2c..85df44bc80 100644 --- a/src/mbgl/style/layers/custom_layer_impl.cpp +++ b/src/mbgl/gl/custom_layer_impl.cpp @@ -1,4 +1,4 @@ -#include <mbgl/style/layers/custom_layer_impl.hpp> +#include <mbgl/gl/custom_layer_impl.hpp> namespace mbgl { namespace style { diff --git a/src/mbgl/style/layers/custom_layer_impl.hpp b/src/mbgl/gl/custom_layer_impl.hpp index d8b8a7f286..0c9339adf1 100644 --- a/src/mbgl/style/layers/custom_layer_impl.hpp +++ b/src/mbgl/gl/custom_layer_impl.hpp @@ -1,8 +1,8 @@ #pragma once +#include <mbgl/gl/custom_layer.hpp> #include <mbgl/style/layer_impl.hpp> #include <mbgl/style/layer_properties.hpp> -#include <mbgl/style/layers/custom_layer.hpp> #include <memory> diff --git a/src/mbgl/renderer/layers/render_custom_layer.cpp b/src/mbgl/gl/render_custom_layer.cpp index c53286a2a0..bb12ec1fcf 100644 --- a/src/mbgl/renderer/layers/render_custom_layer.cpp +++ b/src/mbgl/gl/render_custom_layer.cpp @@ -1,13 +1,13 @@ -#include <mbgl/renderer/layers/render_custom_layer.hpp> -#include <mbgl/renderer/paint_parameters.hpp> -#include <mbgl/gfx/renderer_backend.hpp> #include <mbgl/gfx/backend_scope.hpp> -#include <mbgl/renderer/bucket.hpp> -#include <mbgl/platform/gl_functions.hpp> -#include <mbgl/style/layers/custom_layer_impl.hpp> -#include <mbgl/map/transform_state.hpp> +#include <mbgl/gfx/renderer_backend.hpp> #include <mbgl/gl/context.hpp> +#include <mbgl/gl/custom_layer_impl.hpp> +#include <mbgl/gl/render_custom_layer.hpp> #include <mbgl/gl/renderable_resource.hpp> +#include <mbgl/map/transform_state.hpp> +#include <mbgl/platform/gl_functions.hpp> +#include <mbgl/renderer/bucket.hpp> +#include <mbgl/renderer/paint_parameters.hpp> #include <mbgl/util/mat4.hpp> namespace mbgl { diff --git a/src/mbgl/renderer/layers/render_custom_layer.hpp b/src/mbgl/gl/render_custom_layer.hpp index 698621eae6..2f5ae28209 100644 --- a/src/mbgl/renderer/layers/render_custom_layer.hpp +++ b/src/mbgl/gl/render_custom_layer.hpp @@ -1,7 +1,7 @@ #pragma once +#include <mbgl/gl/custom_layer_impl.hpp> #include <mbgl/renderer/render_layer.hpp> -#include <mbgl/style/layers/custom_layer_impl.hpp> namespace mbgl { diff --git a/src/mbgl/style/style_impl.cpp b/src/mbgl/style/style_impl.cpp index d5961b5901..5b52f1d72c 100644 --- a/src/mbgl/style/style_impl.cpp +++ b/src/mbgl/style/style_impl.cpp @@ -1,3 +1,4 @@ +#include <mbgl/gl/custom_layer.hpp> #include <mbgl/sprite/sprite_loader.hpp> #include <mbgl/storage/file_source.hpp> #include <mbgl/storage/resource.hpp> @@ -6,7 +7,6 @@ #include <mbgl/style/layer_impl.hpp> #include <mbgl/style/layers/background_layer.hpp> #include <mbgl/style/layers/circle_layer.hpp> -#include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/style/layers/fill_extrusion_layer.hpp> #include <mbgl/style/layers/fill_layer.hpp> #include <mbgl/style/layers/heatmap_layer.hpp> diff --git a/src/mbgl/tile/geometry_tile.cpp b/src/mbgl/tile/geometry_tile.cpp index 04ee5f9df7..0271aceb35 100644 --- a/src/mbgl/tile/geometry_tile.cpp +++ b/src/mbgl/tile/geometry_tile.cpp @@ -1,25 +1,25 @@ #include <mbgl/tile/geometry_tile.hpp> -#include <mbgl/tile/geometry_tile_worker.hpp> -#include <mbgl/tile/geometry_tile_data.hpp> -#include <mbgl/tile/tile_observer.hpp> -#include <mbgl/style/layer_impl.hpp> -#include <mbgl/style/layers/background_layer.hpp> -#include <mbgl/style/layers/custom_layer.hpp> -#include <mbgl/renderer/render_source.hpp> -#include <mbgl/renderer/tile_parameters.hpp> +#include <mbgl/actor/scheduler.hpp> +#include <mbgl/geometry/feature_index.hpp> +#include <mbgl/gl/custom_layer.hpp> +#include <mbgl/gl/render_custom_layer.hpp> +#include <mbgl/map/transform_state.hpp> +#include <mbgl/renderer/buckets/symbol_bucket.hpp> +#include <mbgl/renderer/image_atlas.hpp> #include <mbgl/renderer/layers/render_background_layer.hpp> -#include <mbgl/renderer/layers/render_custom_layer.hpp> #include <mbgl/renderer/layers/render_symbol_layer.hpp> -#include <mbgl/renderer/buckets/symbol_bucket.hpp> #include <mbgl/renderer/query.hpp> +#include <mbgl/renderer/render_source.hpp> +#include <mbgl/renderer/tile_parameters.hpp> +#include <mbgl/renderer/tile_render_data.hpp> +#include <mbgl/style/layer_impl.hpp> +#include <mbgl/style/layers/background_layer.hpp> #include <mbgl/text/glyph_atlas.hpp> -#include <mbgl/renderer/image_atlas.hpp> -#include <mbgl/geometry/feature_index.hpp> -#include <mbgl/map/transform_state.hpp> +#include <mbgl/tile/geometry_tile_data.hpp> +#include <mbgl/tile/geometry_tile_worker.hpp> +#include <mbgl/tile/tile_observer.hpp> #include <mbgl/util/logging.hpp> -#include <mbgl/actor/scheduler.hpp> -#include <mbgl/renderer/tile_render_data.hpp> #include <mbgl/gfx/upload_pass.hpp> diff --git a/test/api/custom_layer.test.cpp b/test/api/custom_layer.test.cpp index 2222645147..2cfa7bf400 100644 --- a/test/api/custom_layer.test.cpp +++ b/test/api/custom_layer.test.cpp @@ -1,14 +1,14 @@ #include <mbgl/test/util.hpp> -#include <mbgl/platform/gl_functions.hpp> +#include <mbgl/gfx/headless_frontend.hpp> +#include <mbgl/gl/custom_layer.hpp> +#include <mbgl/gl/defines.hpp> #include <mbgl/map/map.hpp> #include <mbgl/map/map_options.hpp> -#include <mbgl/gl/defines.hpp> -#include <mbgl/gfx/headless_frontend.hpp> +#include <mbgl/platform/gl_functions.hpp> #include <mbgl/storage/resource_options.hpp> -#include <mbgl/style/style.hpp> -#include <mbgl/style/layers/custom_layer.hpp> #include <mbgl/style/layers/fill_layer.hpp> +#include <mbgl/style/style.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/mat4.hpp> #include <mbgl/util/run_loop.hpp> diff --git a/test/gl/context.test.cpp b/test/gl/context.test.cpp index 9c709b7597..2135ed9862 100644 --- a/test/gl/context.test.cpp +++ b/test/gl/context.test.cpp @@ -1,18 +1,18 @@ #include <mbgl/test/util.hpp> -#include <mbgl/platform/gl_functions.hpp> -#include <mbgl/gl/context.hpp> -#include <mbgl/map/map.hpp> -#include <mbgl/map/map_options.hpp> #include <mbgl/gfx/backend_scope.hpp> -#include <mbgl/gl/defines.hpp> #include <mbgl/gfx/headless_frontend.hpp> +#include <mbgl/gl/context.hpp> +#include <mbgl/gl/custom_layer.hpp> +#include <mbgl/gl/defines.hpp> #include <mbgl/gl/renderable_resource.hpp> +#include <mbgl/map/map.hpp> +#include <mbgl/map/map_options.hpp> +#include <mbgl/platform/gl_functions.hpp> #include <mbgl/storage/resource_options.hpp> -#include <mbgl/style/style.hpp> -#include <mbgl/style/layers/custom_layer.hpp> -#include <mbgl/style/layers/fill_layer.hpp> #include <mbgl/style/layers/background_layer.hpp> +#include <mbgl/style/layers/fill_layer.hpp> +#include <mbgl/style/style.hpp> #include <mbgl/util/io.hpp> #include <mbgl/util/mat4.hpp> #include <mbgl/util/run_loop.hpp> diff --git a/test/style/style_layer.test.cpp b/test/style/style_layer.test.cpp index 77e936ff3b..33573636d7 100644 --- a/test/style/style_layer.test.cpp +++ b/test/style/style_layer.test.cpp @@ -1,3 +1,5 @@ +#include <mbgl/gl/custom_layer.hpp> +#include <mbgl/gl/custom_layer_impl.hpp> #include <mbgl/style/expression/dsl.hpp> #include <mbgl/style/expression/format_expression.hpp> #include <mbgl/style/expression/image.hpp> @@ -6,8 +8,6 @@ #include <mbgl/style/layers/background_layer_impl.hpp> #include <mbgl/style/layers/circle_layer.hpp> #include <mbgl/style/layers/circle_layer_impl.hpp> -#include <mbgl/style/layers/custom_layer.hpp> -#include <mbgl/style/layers/custom_layer_impl.hpp> #include <mbgl/style/layers/fill_layer.hpp> #include <mbgl/style/layers/fill_layer_impl.hpp> #include <mbgl/style/layers/line_layer.hpp> |