diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-11-19 16:08:18 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-12-01 09:15:05 -0800 |
commit | 58886842bc381cd30bac7102d4f70497c0128aa7 (patch) | |
tree | 572ffb0f76aa4bcb6a86ef4ea506335adf636309 /src/mbgl/map/map_context.cpp | |
parent | 40ebf5d0d08138c353d7c0e4bc61ee53dceae410 (diff) | |
download | qtlocation-mapboxgl-58886842bc381cd30bac7102d4f70497c0128aa7.tar.gz |
[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.
Diffstat (limited to 'src/mbgl/map/map_context.cpp')
-rw-r--r-- | src/mbgl/map/map_context.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index 400b2880da..32cf760afa 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -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(); |