move MapContext to its own file
This commit is contained in:
committed by
John Firebaugh
parent
849febbfc4
commit
67fa80f5e9
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/map/map.hpp>
|
||||
#include <mbgl/map/environment.hpp>
|
||||
#include <mbgl/map/map_context.hpp>
|
||||
#include <mbgl/map/view.hpp>
|
||||
#include <mbgl/map/map_data.hpp>
|
||||
#include <mbgl/map/still_image.hpp>
|
||||
@@ -60,30 +61,6 @@ const static bool uvVersionCheck = []() {
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class MapContext {
|
||||
public:
|
||||
MapContext(Environment& env) :
|
||||
glyphStore(util::make_unique<GlyphStore>(env)),
|
||||
glyphAtlas(util::make_unique<GlyphAtlas>(1024, 1024)),
|
||||
spriteAtlas(util::make_unique<SpriteAtlas>(512, 512)),
|
||||
lineAtlas(util::make_unique<LineAtlas>(512, 512)),
|
||||
texturePool(util::make_unique<TexturePool>()),
|
||||
painter(util::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas))
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public:
|
||||
const std::unique_ptr<GlyphStore> glyphStore;
|
||||
const std::unique_ptr<GlyphAtlas> glyphAtlas;
|
||||
const std::unique_ptr<SpriteAtlas> spriteAtlas;
|
||||
const std::unique_ptr<LineAtlas> lineAtlas;
|
||||
const std::unique_ptr<TexturePool> texturePool;
|
||||
const std::unique_ptr<Painter> painter;
|
||||
util::ptr<Sprite> sprite;
|
||||
};
|
||||
|
||||
|
||||
Map::Map(View& view_, FileSource& fileSource_)
|
||||
: env(util::make_unique<Environment>(fileSource_)),
|
||||
scope(util::make_unique<EnvironmentScope>(*env, ThreadType::Main, "Main")),
|
||||
|
||||
27
src/mbgl/map/map_context.cpp
Normal file
27
src/mbgl/map/map_context.cpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <mbgl/map/map_context.hpp>
|
||||
#include <mbgl/map/environment.hpp>
|
||||
|
||||
#include <mbgl/renderer/painter.hpp>
|
||||
|
||||
#include <mbgl/text/glyph_store.hpp>
|
||||
|
||||
#include <mbgl/geometry/glyph_atlas.hpp>
|
||||
#include <mbgl/geometry/sprite_atlas.hpp>
|
||||
#include <mbgl/geometry/line_atlas.hpp>
|
||||
|
||||
#include <mbgl/util/std.hpp>
|
||||
#include <mbgl/util/uv_detail.hpp>
|
||||
#include <mbgl/util/texture_pool.hpp>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
MapContext::MapContext(Environment& env)
|
||||
: glyphStore(util::make_unique<GlyphStore>(env)),
|
||||
glyphAtlas(util::make_unique<GlyphAtlas>(1024, 1024)),
|
||||
spriteAtlas(util::make_unique<SpriteAtlas>(512, 512)),
|
||||
lineAtlas(util::make_unique<LineAtlas>(512, 512)),
|
||||
texturePool(util::make_unique<TexturePool>()),
|
||||
painter(util::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas)) {
|
||||
}
|
||||
|
||||
}
|
||||
36
src/mbgl/map/map_context.hpp
Normal file
36
src/mbgl/map/map_context.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef MBGL_MAP_MAP_CONTEXT
|
||||
#define MBGL_MAP_MAP_CONTEXT
|
||||
|
||||
#include <mbgl/util/ptr.hpp>
|
||||
|
||||
#include <set>
|
||||
|
||||
namespace mbgl {
|
||||
|
||||
class Environment;
|
||||
class GlyphStore;
|
||||
class GlyphAtlas;
|
||||
class SpriteAtlas;
|
||||
class LineAtlas;
|
||||
class TexturePool;
|
||||
class Painter;
|
||||
class Sprite;
|
||||
class StyleSource;
|
||||
class StyleLayerGroup;
|
||||
|
||||
class MapContext {
|
||||
public:
|
||||
MapContext(Environment&);
|
||||
|
||||
public:
|
||||
const std::unique_ptr<GlyphStore> glyphStore;
|
||||
const std::unique_ptr<GlyphAtlas> glyphAtlas;
|
||||
const std::unique_ptr<SpriteAtlas> spriteAtlas;
|
||||
const std::unique_ptr<LineAtlas> lineAtlas;
|
||||
const std::unique_ptr<TexturePool> texturePool;
|
||||
const std::unique_ptr<Painter> painter;
|
||||
util::ptr<Sprite> sprite;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user