summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mbgl/storage/file_source.hpp2
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp2
-rw-r--r--platform/default/src/mbgl/storage/main_resource_loader.cpp2
-rw-r--r--src/mbgl/gfx/context.hpp5
-rw-r--r--src/mbgl/renderer/layers/render_hillshade_layer.cpp3
-rw-r--r--src/mbgl/renderer/sources/render_geojson_source.cpp4
-rw-r--r--test/map/map.test.cpp19
-rw-r--r--test/storage/main_resource_loader.test.cpp4
-rw-r--r--test/util/offscreen_texture.test.cpp2
9 files changed, 22 insertions, 21 deletions
diff --git a/include/mbgl/storage/file_source.hpp b/include/mbgl/storage/file_source.hpp
index 3306d8d76a..0ce88981a5 100644
--- a/include/mbgl/storage/file_source.hpp
+++ b/include/mbgl/storage/file_source.hpp
@@ -48,7 +48,7 @@ public:
// Allows to forward response from one source to another.
// Optionally, callback can be provided to receive notification for forward
// operation.
- virtual void forward(const Resource&, const Response&, std::function<void()> = {}) {}
+ virtual void forward(const Resource&, const Response&, std::function<void()>) {}
// When a file source supports consulting a local cache only, it must return true.
// Cache-only requests are requests that aren't as urgent, but could be useful, e.g.
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index f08f897bea..b728b340ea 100644
--- a/include/mbgl/style/sources/geojson_source.hpp
+++ b/include/mbgl/style/sources/geojson_source.hpp
@@ -50,7 +50,7 @@ public:
// SuperclusterData
virtual Features getChildren(std::uint32_t) = 0;
- virtual Features getLeaves(std::uint32_t, std::uint32_t limit = 10u, std::uint32_t offset = 0u) = 0;
+ virtual Features getLeaves(std::uint32_t, std::uint32_t limit, std::uint32_t offset) = 0;
virtual std::uint8_t getClusterExpansionZoom(std::uint32_t) = 0;
virtual std::shared_ptr<Scheduler> getScheduler() { return nullptr; }
diff --git a/platform/default/src/mbgl/storage/main_resource_loader.cpp b/platform/default/src/mbgl/storage/main_resource_loader.cpp
index 0e7ea367e3..6dcb38b72b 100644
--- a/platform/default/src/mbgl/storage/main_resource_loader.cpp
+++ b/platform/default/src/mbgl/storage/main_resource_loader.cpp
@@ -40,7 +40,7 @@ public:
MBGL_TIMING_START(watch);
return onlineFileSource->request(res, [=, ptr = parentKeepAlive](const Response& response) {
if (databaseFileSource) {
- databaseFileSource->forward(res, response);
+ databaseFileSource->forward(res, response, nullptr);
}
if (res.kind == Resource::Kind::Tile) {
// onlineResponse.data will be null if data not modified
diff --git a/src/mbgl/gfx/context.hpp b/src/mbgl/gfx/context.hpp
index fe0851be11..75670c4c59 100644
--- a/src/mbgl/gfx/context.hpp
+++ b/src/mbgl/gfx/context.hpp
@@ -43,9 +43,8 @@ public:
virtual void reduceMemoryUsage() = 0;
public:
- virtual std::unique_ptr<OffscreenTexture>
- createOffscreenTexture(Size,
- TextureChannelDataType = TextureChannelDataType::UnsignedByte) = 0;
+ virtual std::unique_ptr<OffscreenTexture> createOffscreenTexture(Size, TextureChannelDataType) = 0;
+
public:
// Creates an empty texture with the specified dimensions.
Texture createTexture(const Size size,
diff --git a/src/mbgl/renderer/layers/render_hillshade_layer.cpp b/src/mbgl/renderer/layers/render_hillshade_layer.cpp
index a937c857cc..f3ac5c2a4f 100644
--- a/src/mbgl/renderer/layers/render_hillshade_layer.cpp
+++ b/src/mbgl/renderer/layers/render_hillshade_layer.cpp
@@ -140,7 +140,8 @@ void RenderHillshadeLayer::render(PaintParameters& parameters) {
assert(bucket.dem);
const uint16_t stride = bucket.getDEMData().stride;
const uint16_t tilesize = bucket.getDEMData().dim;
- auto view = parameters.context.createOffscreenTexture({ tilesize, tilesize });
+ auto view = parameters.context.createOffscreenTexture({tilesize, tilesize},
+ gfx::TextureChannelDataType::UnsignedByte);
auto renderPass = parameters.encoder->createRenderPass(
"hillshade prepare", { *view, Color{ 0.0f, 0.0f, 0.0f, 0.0f }, {}, {} });
diff --git a/src/mbgl/renderer/sources/render_geojson_source.cpp b/src/mbgl/renderer/sources/render_geojson_source.cpp
index 4083a96500..2cf5c9f3b9 100644
--- a/src/mbgl/renderer/sources/render_geojson_source.cpp
+++ b/src/mbgl/renderer/sources/render_geojson_source.cpp
@@ -46,11 +46,11 @@ FeatureExtensionValue getLeaves(std::shared_ptr<style::GeoJSONData> clusterData,
static_cast<std::uint32_t>(*limit),
static_cast<std::uint32_t>(*offset));
}
- return clusterData->getLeaves(clusterID, static_cast<std::uint32_t>(*limit));
+ return clusterData->getLeaves(clusterID, static_cast<std::uint32_t>(*limit), 0u);
}
}
- return clusterData->getLeaves(clusterID);
+ return clusterData->getLeaves(clusterID, 10u, 0u);
}
// NOLINTNEXTLINE(performance-unnecessary-value-param)
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp
index 4f25000177..7a8078df27 100644
--- a/test/map/map.test.cpp
+++ b/test/map/map.test.cpp
@@ -350,12 +350,13 @@ TEST(Map, Offline) {
const std::string prefix = "http://127.0.0.1:3000/";
std::shared_ptr<FileSource> dbfs =
FileSourceManager::get()->getFileSource(FileSourceType::Database, ResourceOptions{});
- dbfs->forward(Resource::style(prefix + "style.json"), expiredItem("style.json"));
- dbfs->forward(Resource::source(prefix + "streets.json"), expiredItem("streets.json"));
- dbfs->forward(Resource::spriteJSON(prefix + "sprite", 1.0), expiredItem("sprite.json"));
- dbfs->forward(Resource::spriteImage(prefix + "sprite", 1.0), expiredItem("sprite.png"));
+ dbfs->forward(Resource::style(prefix + "style.json"), expiredItem("style.json"), [] {});
+ dbfs->forward(Resource::source(prefix + "streets.json"), expiredItem("streets.json"), [] {});
+ dbfs->forward(Resource::spriteJSON(prefix + "sprite", 1.0), expiredItem("sprite.json"), [] {});
+ dbfs->forward(Resource::spriteImage(prefix + "sprite", 1.0), expiredItem("sprite.png"), [] {});
dbfs->forward(Resource::tile(prefix + "{z}-{x}-{y}.vector.pbf", 1.0, 0, 0, 0, Tileset::Scheme::XYZ),
- expiredItem("0-0-0.vector.pbf"));
+ expiredItem("0-0-0.vector.pbf"),
+ [] {});
dbfs->forward(Resource::glyphs(prefix + "{fontstack}/{range}.pbf", {{"Helvetica"}}, {0, 255}),
expiredItem("glyph.pbf"),
[&] { test.map.getStyle().loadURL(prefix + "style.json"); });
@@ -1337,10 +1338,10 @@ TEST(Map, TEST_REQUIRES_SERVER(ExpiredSpriteSheet)) {
const std::string prefix = "http://127.0.0.1:3000/online/";
std::shared_ptr<FileSource> dbfs =
FileSourceManager::get()->getFileSource(FileSourceType::Database, ResourceOptions{});
- dbfs->forward(Resource::style(prefix + "style.json"), makeResponse("style.json"));
- dbfs->forward(Resource::source(prefix + "streets.json"), makeResponse("streets.json"));
- dbfs->forward(Resource::spriteJSON(prefix + "sprite", 1.0), makeResponse("sprite.json", true));
- dbfs->forward(Resource::spriteImage(prefix + "sprite", 1.0), makeResponse("sprite.png", true));
+ dbfs->forward(Resource::style(prefix + "style.json"), makeResponse("style.json"), [] {});
+ dbfs->forward(Resource::source(prefix + "streets.json"), makeResponse("streets.json"), [] {});
+ dbfs->forward(Resource::spriteJSON(prefix + "sprite", 1.0), makeResponse("sprite.json", true), [] {});
+ dbfs->forward(Resource::spriteImage(prefix + "sprite", 1.0), makeResponse("sprite.png", true), [] {});
dbfs->forward(Resource::tile(prefix + "{z}-{x}-{y}.vector.pbf", 1.0, 0, 0, 0, Tileset::Scheme::XYZ),
makeResponse("0-0-0.vector.pbf"),
[&] { test.map.getStyle().loadURL(prefix + "style.json"); });
diff --git a/test/storage/main_resource_loader.test.cpp b/test/storage/main_resource_loader.test.cpp
index 2622d91183..1bab30e1f8 100644
--- a/test/storage/main_resource_loader.test.cpp
+++ b/test/storage/main_resource_loader.test.cpp
@@ -692,11 +692,11 @@ TEST(MainResourceLoader, TEST_REQUIRES_SERVER(CachedResourceLowPriority)) {
// Put existing values into the cache.
Resource resource1{Resource::Unknown, "http://127.0.0.1:3000/load/3", {}, Resource::LoadingMethod::All};
response.data = std::make_shared<std::string>("Cached Request 3");
- dbfs->forward(resource1, response);
+ dbfs->forward(resource1, response, [] {});
Resource resource2{Resource::Unknown, "http://127.0.0.1:3000/load/4", {}, Resource::LoadingMethod::All};
response.data = std::make_shared<std::string>("Cached Request 4");
- dbfs->forward(resource2, response);
+ dbfs->forward(resource2, response, [] {});
onlineFs->setProperty(MAX_CONCURRENT_REQUESTS_KEY, 1u);
fs.pause();
diff --git a/test/util/offscreen_texture.test.cpp b/test/util/offscreen_texture.test.cpp
index 78cf7cef60..7bc687d8ca 100644
--- a/test/util/offscreen_texture.test.cpp
+++ b/test/util/offscreen_texture.test.cpp
@@ -187,7 +187,7 @@ TEST(OffscreenTexture, ClearRenderPassColor) {
gfx::BackendScope scope { *backend->getRendererBackend() };
auto& context = backend->getRendererBackend()->getContext();
auto encoder = context.createCommandEncoder();
- auto offscreenTexture = context.createOffscreenTexture({ 128, 256 });
+ auto offscreenTexture = context.createOffscreenTexture({128, 256}, gfx::TextureChannelDataType::UnsignedByte);
auto renderPass = encoder->createRenderPass(
"offscreen texture", { *offscreenTexture, Color{ 1.0f, 0.0f, 0.0f, 1.0f }, {}, {} });
renderPass.reset();