Remove legacy renderer from source, build files and CI (#3384)

This commit is contained in:
Bart Louwers
2025-04-15 19:48:31 +02:00
committed by GitHub
parent fbfc3c5b12
commit 88fd774e67
130 changed files with 279 additions and 3139 deletions

View File

@@ -1,3 +1,4 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "objc_library")
load("//bazel:flags.bzl", "CPP_FLAGS", "MAPLIBRE_FLAGS")
objc_library(

View File

@@ -1,7 +1,5 @@
#include "example_custom_drawable_style_layer.hpp"
#if MLN_DRAWABLE_RENDERER
#include <mbgl/style/layer.hpp>
#include <mbgl/style/layers/custom_drawable_layer.hpp>
#include <mbgl/util/io.hpp>
@@ -271,8 +269,9 @@ void ExampleCustomDrawableStyleLayerHost::createDrawables(Interface& interface)
Interface::SymbolOptions options;
options.texture = interface.context.createTexture2D();
options.texture->setImage(image);
options.texture->setSamplerConfiguration(
{gfx::TextureFilterType::Linear, gfx::TextureWrapType::Repeat, gfx::TextureWrapType::Repeat});
options.texture->setSamplerConfiguration({.filter = gfx::TextureFilterType::Linear,
.wrapU = gfx::TextureWrapType::Repeat,
.wrapV = gfx::TextureWrapType::Repeat});
const std::array<std::array<float, 2>, 2> textureCoordinates = {{{0.0f, 0.0f}, {10.0f, 10.0f}}};
options.size = {static_cast<uint32_t>(image->size.width), static_cast<uint32_t>(image->size.height)};
@@ -300,8 +299,9 @@ void ExampleCustomDrawableStyleLayerHost::createDrawables(Interface& interface)
Interface::SymbolOptions options;
options.texture = interface.context.createTexture2D();
options.texture->setImage(image);
options.texture->setSamplerConfiguration(
{gfx::TextureFilterType::Linear, gfx::TextureWrapType::Clamp, gfx::TextureWrapType::Clamp});
options.texture->setSamplerConfiguration({.filter = gfx::TextureFilterType::Linear,
.wrapU = gfx::TextureWrapType::Clamp,
.wrapV = gfx::TextureWrapType::Clamp});
options.size = {static_cast<uint32_t>(image->size.width), static_cast<uint32_t>(image->size.height)};
@@ -414,8 +414,9 @@ void ExampleCustomDrawableStyleLayerHost::generateGeometry(Interface& interface)
options.texture = interface.context.createTexture2D();
options.texture->setImage(image);
options.texture->setSamplerConfiguration(
{mbgl::gfx::TextureFilterType::Linear, mbgl::gfx::TextureWrapType::Clamp, mbgl::gfx::TextureWrapType::Clamp});
options.texture->setSamplerConfiguration({.filter = mbgl::gfx::TextureFilterType::Linear,
.wrapU = mbgl::gfx::TextureWrapType::Clamp,
.wrapV = mbgl::gfx::TextureWrapType::Clamp});
const std::shared_ptr<VertexVector> sharedVertices = std::make_shared<VertexVector>();
VertexVector& vertices = *sharedVertices;
@@ -426,7 +427,7 @@ void ExampleCustomDrawableStyleLayerHost::generateGeometry(Interface& interface)
const unsigned long numVtxCircumference = 72;
const float bearingStep = 360.0f / static_cast<float>(numVtxCircumference - 1);
vertices.emplace_back(Interface::GeometryVertex{{0.0f, 0.0f, 0.0f}, {0.5f, 0.5f}});
vertices.emplace_back(Interface::GeometryVertex{.position = {0.0f, 0.0f, 0.0f}, .texcoords = {0.5f, 0.5f}});
for (unsigned long i = 1; i <= numVtxCircumference; ++i) {
const float rad = mbgl::util::deg2radf((i - 1) * bearingStep);
@@ -596,11 +597,10 @@ mbgl::gfx::Texture2DPtr ExampleCustomDrawableStyleLayerHost::createCheckerboardT
}
auto texture = interface.context.createTexture2D();
texture->setSamplerConfiguration(
{mbgl::gfx::TextureFilterType::Linear, mbgl::gfx::TextureWrapType::Clamp, mbgl::gfx::TextureWrapType::Clamp});
texture->setSamplerConfiguration({.filter = mbgl::gfx::TextureFilterType::Linear,
.wrapU = mbgl::gfx::TextureWrapType::Clamp,
.wrapV = mbgl::gfx::TextureWrapType::Clamp});
texture->setImage(std::move(image));
return texture;
}
#endif

View File

@@ -2,8 +2,6 @@
#include <mbgl/style/layers/custom_drawable_layer.hpp>
#if MLN_DRAWABLE_RENDERER
class ExampleCustomDrawableStyleLayerHost : public mbgl::style::CustomDrawableLayerHost {
public:
using VertexVector = mbgl::gfx::VertexVector<Interface::GeometryVertex>;
@@ -39,5 +37,3 @@ protected:
protected:
const std::string assetsPath;
};
#endif

View File

@@ -28,7 +28,7 @@
#include <mbgl/util/platform.hpp>
#include <mbgl/util/string.hpp>
#if !defined(MBGL_LAYER_CUSTOM_DISABLE_ALL) && MLN_DRAWABLE_RENDERER
#if !defined(MBGL_LAYER_CUSTOM_DISABLE_ALL)
#include "example_custom_drawable_style_layer.hpp"
#endif
@@ -829,7 +829,7 @@ void GLFWView::popAnnotation() {
}
void GLFWView::toggleCustomDrawableStyle() {
#if !defined(MBGL_LAYER_CUSTOM_DISABLE_ALL) && MLN_DRAWABLE_RENDERER
#if !defined(MBGL_LAYER_CUSTOM_DISABLE_ALL)
auto &style = map->getStyle();
const std::string identifier = "ExampleCustomDrawableStyleLayer";