[core] Move MapData storage to MapContext

This allows MapData members to hold GL resources which must be released
on the MapContext thread -- necessary for the following commit.
This commit is contained in:
John Firebaugh
2015-11-19 16:08:18 -08:00
parent 40ebf5d0d0
commit 58886842bc
5 changed files with 16 additions and 8 deletions

View File

@@ -25,9 +25,10 @@
namespace mbgl {
MapContext::MapContext(View& view_, FileSource& fileSource, MapData& data_)
MapContext::MapContext(View& view_, FileSource& fileSource, MapMode mode_, GLContextMode contextMode_, const float pixelRatio_)
: view(view_),
data(data_),
dataPtr(std::make_unique<MapData>(mode_, contextMode_, pixelRatio_)),
data(*dataPtr),
asyncUpdate([this] { update(); }),
asyncInvalidate([&view_] { view_.invalidate(); }),
texturePool(std::make_unique<TexturePool>()) {
@@ -57,6 +58,7 @@ void MapContext::cleanup() {
style.reset();
painter.reset();
texturePool.reset();
dataPtr.reset();
glObjectStore.performCleanup();