[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:
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user