[core] separate Backend from View for headless rendering
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include <mbgl/util/io.hpp>
|
||||
#include <mbgl/util/run_loop.hpp>
|
||||
|
||||
#include <mbgl/platform/default/headless_display.hpp>
|
||||
#include <mbgl/platform/default/headless_backend.hpp>
|
||||
#include <mbgl/platform/default/headless_view.hpp>
|
||||
#include <mbgl/platform/default/thread_pool.hpp>
|
||||
#include <mbgl/storage/default_file_source.hpp>
|
||||
@@ -84,9 +84,10 @@ int main(int argc, char *argv[]) {
|
||||
fileSource.setAccessToken(std::string(token));
|
||||
}
|
||||
|
||||
HeadlessBackend backend;
|
||||
HeadlessView view(pixelRatio, width, height);
|
||||
ThreadPool threadPool(4);
|
||||
Map map(view, fileSource, threadPool, MapMode::Still);
|
||||
Map map(backend, view, view.getPixelRatio(), fileSource, threadPool, MapMode::Still);
|
||||
|
||||
map.setStyleJSON(style);
|
||||
map.setClasses(classes);
|
||||
|
||||
Reference in New Issue
Block a user