[core] renderer interface

This commit is contained in:
Ivo van Dongen
2017-06-13 10:50:16 +03:00
committed by Ivo van Dongen
parent 39a732d7ae
commit 3832f8d0d8
44 changed files with 1016 additions and 541 deletions

View File

@@ -6,7 +6,9 @@
#include <mbgl/map/backend_scope.hpp>
#include <mbgl/gl/headless_backend.hpp>
#include <mbgl/gl/offscreen_view.hpp>
#include <mbgl/test/stub_renderer_frontend.hpp>
#include <mbgl/storage/online_file_source.hpp>
#include <mbgl/renderer/renderer.hpp>
#include <mbgl/util/default_thread_pool.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/run_loop.hpp>
@@ -27,10 +29,13 @@ TEST(API, RenderWithoutCallback) {
OffscreenView view { backend.getContext(), { 128, 512 } };
StubFileSource fileSource;
ThreadPool threadPool(4);
float pixelRatio { 1 };
StubRendererFrontend rendererFrontend {
std::make_unique<Renderer>(backend, pixelRatio, fileSource, threadPool), view };
std::unique_ptr<Map> map =
std::make_unique<Map>(backend, MapObserver::nullObserver(), view.getSize(), 1, fileSource, threadPool, MapMode::Still);
map->renderStill(view, nullptr);
auto map = std::make_unique<Map>(rendererFrontend, MapObserver::nullObserver(), view.getSize(),
pixelRatio, fileSource, threadPool, MapMode::Still);
map->renderStill(nullptr);
// Force Map thread to join.
map.reset();