[core] move gl::Context to Backend and refactor View

This commit is contained in:
Konstantin Käfer
2016-10-10 17:16:37 +02:00
parent 5cc390d694
commit a4d259c33f
76 changed files with 914 additions and 1024 deletions

View File

@@ -3,7 +3,7 @@
#include <mbgl/benchmark/util.hpp>
#include <mbgl/map/map.hpp>
#include <mbgl/platform/default/headless_backend.hpp>
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/offscreen_view.hpp>
#include <mbgl/platform/default/thread_pool.hpp>
#include <mbgl/sprite/sprite_image.hpp>
#include <mbgl/storage/default_file_source.hpp>
@@ -29,17 +29,15 @@ public:
auto image = std::make_unique<SpriteImage>(std::move(decoded), 1.0);
map.addImage("test-icon", std::move(image));
view.resize(1000, 1000);
mbgl::benchmark::render(map);
mbgl::benchmark::render(map, view);
}
util::RunLoop loop;
HeadlessBackend backend;
HeadlessView view;
OffscreenView view{ backend.getContext(), {{ 1000, 1000 }} };
DefaultFileSource fileSource{ "benchmark/fixtures/api/cache.db", "." };
ThreadPool threadPool{ 4 };
Map map{ backend, view, view.getPixelRatio(), fileSource, threadPool, MapMode::Still };
Map map{ backend, view.getSize(), 1, fileSource, threadPool, MapMode::Still };
ScreenBox box{{ 0, 0 }, { 1000, 1000 }};
};