Add shader registry (#924)
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
|
||||
#include <mbgl/gfx/backend_scope.hpp>
|
||||
#include <mbgl/gfx/headless_frontend.hpp>
|
||||
#include <mbgl/gfx/shader_registry.hpp>
|
||||
#include <mbgl/gl/context.hpp>
|
||||
#include <mbgl/map/map_options.hpp>
|
||||
#include <mbgl/math/log2.hpp>
|
||||
@@ -1576,3 +1577,23 @@ TEST(Map, VolatileSource) {
|
||||
test.runLoop.run();
|
||||
EXPECT_EQ(8, requestedTiles);
|
||||
}
|
||||
|
||||
TEST(Map, ObserveShaderRegistration) {
|
||||
MapTest<> test;
|
||||
|
||||
bool observedRegistry = false;
|
||||
test.observer.onRegisterShadersCallback = [&observedRegistry](gfx::ShaderRegistry&) {
|
||||
observedRegistry = true;
|
||||
};
|
||||
|
||||
test.map.jumpTo(CameraOptions().withZoom(10));
|
||||
test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json"));
|
||||
|
||||
test.frontend.render(test.map);
|
||||
EXPECT_EQ(observedRegistry, true);
|
||||
|
||||
// Should not see it again
|
||||
observedRegistry = false;
|
||||
test.frontend.render(test.map);
|
||||
EXPECT_EQ(observedRegistry, false);
|
||||
}
|
||||
Reference in New Issue
Block a user