core: rename mbgl namespace to mln (#4487)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Bart Louwers
2026-08-14 23:25:20 +02:00
committed by GitHub
parent 836b862984
commit 550f64be22
1970 changed files with 8931 additions and 8967 deletions

View File

@@ -11,7 +11,7 @@
#include <mbgl/util/io.hpp>
#include <mbgl/util/run_loop.hpp>
using namespace mbgl;
using namespace mln;
namespace {

View File

@@ -18,7 +18,7 @@
#include <sstream>
#include <optional>
using namespace mbgl;
using namespace mln;
namespace {
@@ -124,7 +124,7 @@ static void API_renderStill_recreate_map_2(::benchmark::State& state) {
}
static void API_renderStill_multiple_sources(::benchmark::State& state) {
using namespace mbgl::style;
using namespace mln::style;
RenderBenchmark bench;
HeadlessFrontend frontend{size, pixelRatio};
Map map{frontend,

View File

@@ -5,8 +5,8 @@
#include <mbgl/style/conversion/property_value.hpp>
#include <mbgl/style/conversion_impl.hpp>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
static std::string createFunctionJSON(size_t stopCount) {
std::string stops = "[";

View File

@@ -7,8 +7,8 @@
#include <mbgl/style/conversion/property_value.hpp>
#include <mbgl/style/conversion_impl.hpp>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
static std::string createFunctionJSON(size_t stopCount) {
std::string stops = "[";

View File

@@ -6,8 +6,8 @@
#include <mbgl/style/conversion/property_value.hpp>
#include <mbgl/style/conversion_impl.hpp>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
static std::string createFunctionJSON(size_t stopCount) {
std::string stops = "[";

View File

@@ -1,7 +1,7 @@
#pragma once
namespace mbgl {
namespace mln {
int runBenchmark(int argc, char* argv[]);
} // namespace mbgl
} // namespace mln

View File

@@ -22,13 +22,13 @@ bool TestRunner::startTest(const std::string& basePath) {
argv.push_back(nullptr);
if (chdir(basePath.c_str())) {
mbgl::Log::Error(mbgl::Event::General, "Failed to change the directory to " + basePath);
mln::Log::Error(mln::Event::General, "Failed to change the directory to " + basePath);
return false;
}
mbgl::Log::Info(mbgl::Event::General, "Start BenchmarkRunner");
int status = mbgl::runBenchmark(static_cast<uint32_t>(argv.size()), argv.data());
mbgl::Log::Info(mbgl::Event::General, "BenchmarkRunner finished with status: '%d'", status);
mln::Log::Info(mln::Event::General, "Start BenchmarkRunner");
int status = mln::runBenchmark(static_cast<uint32_t>(argv.size()), argv.data());
mln::Log::Info(mln::Event::General, "BenchmarkRunner finished with status: '%d'", status);
return status == 0;
}

View File

@@ -7,7 +7,7 @@
#include <mbgl/tile/geometry_tile_data.hpp>
#include <mbgl/benchmark/stub_geometry_tile_feature.hpp>
using namespace mbgl;
using namespace mln;
style::Filter parse(const char* expression) {
style::conversion::Error error;

View File

@@ -2,7 +2,7 @@
#include <mbgl/algorithm/update_tile_masks.hpp>
using namespace mbgl;
using namespace mln;
class FakeTile {
public:

View File

@@ -3,7 +3,7 @@
#include <mbgl/tile/vector_mvt_tile_data.hpp>
#include <mbgl/util/io.hpp>
using namespace mbgl;
using namespace mln;
static void Parse_VectorTile(benchmark::State& state) {
auto data = std::make_shared<std::string>(

View File

@@ -24,8 +24,8 @@
#include <mbgl/renderer/render_layer.hpp>
#include <mbgl/util/thread_pool.hpp>
using namespace mbgl;
using namespace mbgl::style;
using namespace mln;
using namespace mln::style;
// Minimal FileSource stub for benchmark (doesn't actually fetch resources)
class StubFileSource : public FileSource {

View File

@@ -2,7 +2,7 @@
#include <benchmark/benchmark.h>
namespace mbgl {
namespace mln {
int runBenchmark(int argc, char* argv[]) {
::benchmark::Initialize(&argc, argv);
@@ -10,4 +10,4 @@ int runBenchmark(int argc, char* argv[]) {
return 0;
}
} // namespace mbgl
} // namespace mln

View File

@@ -3,7 +3,7 @@
#include <mbgl/tile/geometry_tile_data.hpp>
#include <mbgl/util/feature.hpp>
using namespace mbgl;
using namespace mln;
class StubGeometryTileFeature : public GeometryTileFeature {
public:

View File

@@ -18,14 +18,14 @@ public:
response.data = std::make_shared<std::string>(50 * 1024, 0);
response.mustRevalidate = false;
response.expires = mbgl::util::now() + 1h;
response.expires = mln::util::now() + 1h;
resetAmbientTiles();
resetRegion();
}
void resetAmbientTiles() {
using namespace mbgl;
using namespace mln;
db.clearAmbientCache();
@@ -37,7 +37,7 @@ public:
}
void resetRegion() {
using namespace mbgl;
using namespace mln;
auto regions = db.listRegions().value();
if (!regions.empty()) {
@@ -58,8 +58,8 @@ public:
}
}
mbgl::Response response;
mbgl::OfflineDatabase db{":memory:", mbgl::TileServerOptions::DefaultConfiguration()};
mln::Response response;
mln::OfflineDatabase db{":memory:", mln::TileServerOptions::DefaultConfiguration()};
const unsigned tileCount = 100;
int64_t regionID = 0;
@@ -78,7 +78,7 @@ BENCHMARK_F(OfflineDatabase, DeleteRegion)(benchmark::State& state) {
}
BENCHMARK_F(OfflineDatabase, InsertTileRegion)(benchmark::State& state) {
using namespace mbgl;
using namespace mln;
while (state.KeepRunning()) {
const Resource offline = Resource::tile(
@@ -99,7 +99,7 @@ BENCHMARK_F(OfflineDatabase, ClearAmbientCache)(benchmark::State& state) {
}
BENCHMARK_F(OfflineDatabase, InsertTileCache)(benchmark::State& state) {
using namespace mbgl;
using namespace mln;
while (state.KeepRunning()) {
const Resource ambient = Resource::tile(
@@ -109,7 +109,7 @@ BENCHMARK_F(OfflineDatabase, InsertTileCache)(benchmark::State& state) {
}
BENCHMARK_F(OfflineDatabase, InsertBigTileCache)(benchmark::State& state) {
using namespace mbgl;
using namespace mln;
Response big;
big.data = std::make_shared<std::string>(util::DEFAULT_MAX_CACHE_SIZE / 100, 0);
@@ -122,7 +122,7 @@ BENCHMARK_F(OfflineDatabase, InsertBigTileCache)(benchmark::State& state) {
}
BENCHMARK_F(OfflineDatabase, GetTile)(benchmark::State& state) {
using namespace mbgl;
using namespace mln;
std::random_device rd;
std::mt19937 gen(rd());
@@ -136,7 +136,7 @@ BENCHMARK_F(OfflineDatabase, GetTile)(benchmark::State& state) {
}
BENCHMARK_F(OfflineDatabase, AddTilesToFullDatabase)(benchmark::State& state) {
using namespace mbgl;
using namespace mln;
Log::setObserver(std::make_unique<Log::NullObserver>());
db.setMaximumAmbientCacheSize(50 * 1024 * 5);
@@ -152,7 +152,7 @@ BENCHMARK_F(OfflineDatabase, AddTilesToFullDatabase)(benchmark::State& state) {
BENCHMARK_F(OfflineDatabase, AddTilesToDisabledDatabase)
(benchmark::State& state) {
using namespace mbgl;
using namespace mln;
auto regions = db.listRegions().value();
if (!regions.empty()) {
@@ -171,7 +171,7 @@ BENCHMARK_F(OfflineDatabase, AddTilesToDisabledDatabase)
BENCHMARK_F(OfflineDatabase, GetTileFromDisabledDatabase)
(benchmark::State& state) {
using namespace mbgl;
using namespace mln;
auto regions = db.listRegions().value();
if (!regions.empty()) {

View File

@@ -20,7 +20,7 @@ namespace {
void ColorParse(benchmark::State& state) {
for (auto _ : state) {
for (const auto& str : testStrings) {
auto result = mbgl::Color::parse(str);
auto result = mln::Color::parse(str);
benchmark::DoNotOptimize(result);
}
}

View File

@@ -5,7 +5,7 @@
#include <mbgl/util/tile_cover.hpp>
#include <mbgl/map/transform.hpp>
using namespace mbgl;
using namespace mln;
static const LatLngBounds sanFrancisco = LatLngBounds::hull({37.6609, -122.5744}, {37.8271, -122.3204});