Merge branch 'master' of github.com:mapbox/mapbox-gl-native into android-mason
Conflicts: src/map/map.cpp
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
|
||||
#include "event.hpp"
|
||||
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
@@ -58,7 +60,7 @@ public:
|
||||
|
||||
template<typename T, typename ...Args>
|
||||
static inline const T &Set(Args&& ...args) {
|
||||
Backend = ::std::unique_ptr<T>(new T(::std::forward<Args>(args)...));
|
||||
Backend = util::make_unique<T>(::std::forward<Args>(args)...);
|
||||
return *dynamic_cast<T *>(Backend.get());
|
||||
}
|
||||
|
||||
|
||||
@@ -2,20 +2,35 @@
|
||||
#define MBGL_UTIL_STD
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace std {
|
||||
|
||||
// C++14 backfill from http://herbsutter.com/gotw/_102/
|
||||
template<typename T, typename ...Args>
|
||||
::std::unique_ptr<T> make_unique(Args&& ...args) {
|
||||
return ::std::unique_ptr<T>(new T(::std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
}
|
||||
#include <type_traits>
|
||||
#include <utility>
|
||||
|
||||
namespace mbgl {
|
||||
namespace util {
|
||||
|
||||
// C++14 backfill based on http://llvm.org/svn/llvm-project/libcxx/trunk/include/memory
|
||||
|
||||
namespace detail {
|
||||
template<class T> struct unique_type { typedef ::std::unique_ptr<T> single; };
|
||||
template<class T> struct unique_type<T[]> { typedef ::std::unique_ptr<T[]> unknown_bound; };
|
||||
template<class T, size_t size> struct unique_type<T[size]> { typedef void known_bound; };
|
||||
}
|
||||
|
||||
template<class T, class... Args>
|
||||
typename detail::unique_type<T>::single make_unique(Args&&... args) {
|
||||
return ::std::unique_ptr<T>(new T(::std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
template<class T>
|
||||
typename detail::unique_type<T>::unknown_bound make_unique(size_t size) {
|
||||
return ::std::unique_ptr<T>(new typename ::std::remove_extent<T>::type[size]());
|
||||
}
|
||||
|
||||
template<class T, class... Args>
|
||||
typename detail::unique_type<T>::known_bound make_unique(Args&&...) = delete;
|
||||
|
||||
|
||||
|
||||
template <typename Container, typename ForwardIterator, typename Predicate>
|
||||
void erase_if(Container &container, ForwardIterator it, const ForwardIterator end, Predicate pred) {
|
||||
while (it != end) {
|
||||
|
||||
@@ -51,7 +51,7 @@ void HTTPRequestBaton::start(const util::ptr<HTTPRequestBaton> &ptr) {
|
||||
} else {
|
||||
// TODO: Use different codes for host not found, timeout, invalid URL etc.
|
||||
// These can be categorized in temporary and permanent errors.
|
||||
baton->response = std::make_unique<Response>();
|
||||
baton->response = util::make_unique<Response>();
|
||||
baton->response->code = [(NSHTTPURLResponse *)res statusCode];
|
||||
baton->response->message = [[error localizedDescription] UTF8String];
|
||||
|
||||
@@ -86,7 +86,7 @@ void HTTPRequestBaton::start(const util::ptr<HTTPRequestBaton> &ptr) {
|
||||
// Assume a Response object already exists.
|
||||
assert(baton->response);
|
||||
} else {
|
||||
baton->response = std::make_unique<Response>();
|
||||
baton->response = util::make_unique<Response>();
|
||||
baton->response->code = code;
|
||||
baton->response->data = {(const char *)[data bytes], [data length]};
|
||||
}
|
||||
@@ -117,7 +117,7 @@ void HTTPRequestBaton::start(const util::ptr<HTTPRequestBaton> &ptr) {
|
||||
} else {
|
||||
// This should never happen.
|
||||
baton->type = HTTPResponseType::PermanentError;
|
||||
baton->response = std::make_unique<Response>();
|
||||
baton->response = util::make_unique<Response>();
|
||||
baton->response->code = -1;
|
||||
baton->response->message = "response class is not NSHTTPURLResponse";
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include <mbgl/util/image.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#import <ImageIO/ImageIO.h>
|
||||
|
||||
@@ -97,7 +98,7 @@ Image::Image(const std::string &source_data) {
|
||||
height = uint32_t(CGImageGetHeight(image));
|
||||
CGRect rect = {{ 0, 0 }, { static_cast<CGFloat>(width), static_cast<CGFloat>(height) }};
|
||||
|
||||
img = ::std::unique_ptr<char[]>(new char[width * height * 4]());
|
||||
img = util::make_unique<char[]>(width * height * 4);
|
||||
CGContextRef context = CGBitmapContextCreate(img.get(), width, height, 8, width * 4,
|
||||
color_space, kCGImageAlphaPremultipliedLast);
|
||||
if (!context) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <mbgl/platform/default/headless_view.hpp>
|
||||
#include <mbgl/platform/default/headless_display.hpp>
|
||||
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <stdexcept>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
@@ -253,14 +255,14 @@ std::unique_ptr<uint32_t[]> HeadlessView::readPixels() {
|
||||
const unsigned int w = width_ * pixelRatio_;
|
||||
const unsigned int h = height_ * pixelRatio_;
|
||||
|
||||
auto pixels = std::unique_ptr<uint32_t[]>(new uint32_t[w * h]);
|
||||
auto pixels = util::make_unique<uint32_t[]>(w * h);
|
||||
|
||||
make_active();
|
||||
glReadPixels(0, 0, width_, height_, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
|
||||
make_inactive();
|
||||
|
||||
const int stride = w * 4;
|
||||
auto tmp = std::unique_ptr<char[]>(new char[stride]());
|
||||
auto tmp = util::make_unique<char[]>(stride);
|
||||
char *rgba = reinterpret_cast<char *>(pixels.get());
|
||||
for (int i = 0, j = height_ - 1; i < j; i++, j--) {
|
||||
std::memcpy(tmp.get(), rgba + i * stride, stride);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <mbgl/util/uv-messenger.h>
|
||||
#include <mbgl/util/time.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#ifdef __ANDROID__
|
||||
#include <mbgl/android/jni.hpp>
|
||||
@@ -122,7 +123,7 @@ struct Context {
|
||||
|
||||
CURLMcode error = curl_multi_remove_handle(multi, handle);
|
||||
if (error != CURLM_OK) {
|
||||
baton->response = std::unique_ptr<Response>(new Response());
|
||||
baton->response = util::make_unique<Response>();
|
||||
baton->response->code = -1;
|
||||
baton->response->message = curl_multi_strerror(error);
|
||||
}
|
||||
@@ -534,7 +535,7 @@ void start_request(void *const ptr) {
|
||||
}
|
||||
|
||||
if (!context->baton->response) {
|
||||
context->baton->response = std::unique_ptr<Response>(new Response());
|
||||
context->baton->response = util::make_unique<Response>();
|
||||
}
|
||||
|
||||
// Carry on the shared pointer in the private information of the CURL handle.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <mbgl/util/image.hpp>
|
||||
#include <mbgl/platform/log.hpp>
|
||||
#include <mbgl/util/string.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <png.h>
|
||||
|
||||
@@ -81,7 +82,7 @@ Image::Image(std::string const& data)
|
||||
auto reader = getImageReader(data.c_str(), data.size());
|
||||
width = reader->width();
|
||||
height = reader->height();
|
||||
img = ::std::unique_ptr<char[]>(new char[width * height * 4]());
|
||||
img = util::make_unique<char[]>(width * height * 4);
|
||||
reader->read(0, 0, width, height, img.get());
|
||||
}
|
||||
catch (ImageReaderException const& ex)
|
||||
|
||||
@@ -49,11 +49,11 @@ std::unique_ptr<ImageReader> getImageReader(char const* data, size_t size)
|
||||
{
|
||||
if (*type == "png")
|
||||
{
|
||||
return std::make_unique<PngReader<boost::iostreams::array_source>>(data, size);
|
||||
return util::make_unique<PngReader<boost::iostreams::array_source>>(data, size);
|
||||
}
|
||||
else if (*type == "jpeg")
|
||||
{
|
||||
return std::make_unique<JpegReader<boost::iostreams::array_source>>(data, size);
|
||||
return util::make_unique<JpegReader<boost::iostreams::array_source>>(data, size);
|
||||
}
|
||||
}
|
||||
throw ImageReaderException("ImageReader: can't determine type from input data");
|
||||
|
||||
@@ -91,7 +91,7 @@ const static bool sqlite_version_check = []() {
|
||||
using namespace mbgl;
|
||||
|
||||
Map::Map(View& view_)
|
||||
: loop(std::make_unique<uv::loop>()),
|
||||
: loop(util::make_unique<uv::loop>()),
|
||||
view(view_),
|
||||
#ifndef NDEBUG
|
||||
mainThread(uv_thread_self()),
|
||||
@@ -128,7 +128,7 @@ Map::~Map() {
|
||||
|
||||
uv::worker &Map::getWorker() {
|
||||
if (!workers) {
|
||||
workers = std::make_unique<uv::worker>(**loop, 4, "Tile Worker");
|
||||
workers = util::make_unique<uv::worker>(**loop, 4, "Tile Worker");
|
||||
}
|
||||
return *workers;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ void Map::start(bool startPaused) {
|
||||
isStopped = false;
|
||||
|
||||
// Setup async notifications
|
||||
asyncTerminate = std::make_unique<uv::async>(**loop, [this]() {
|
||||
asyncTerminate = util::make_unique<uv::async>(**loop, [this]() {
|
||||
assert(uv_thread_self() == mapThread);
|
||||
|
||||
// Remove all of these to make sure they are destructed in the correct thread.
|
||||
@@ -163,7 +163,7 @@ void Map::start(bool startPaused) {
|
||||
asyncTerminate.reset();
|
||||
});
|
||||
|
||||
asyncRender = std::make_unique<uv::async>(**loop, [this]() {
|
||||
asyncRender = util::make_unique<uv::async>(**loop, [this]() {
|
||||
assert(uv_thread_self() == mapThread);
|
||||
|
||||
if (state.hasSize()) {
|
||||
@@ -182,7 +182,7 @@ void Map::start(bool startPaused) {
|
||||
}
|
||||
});
|
||||
|
||||
asyncCleanup = std::make_unique<uv::async>(**loop, [this]() {
|
||||
asyncCleanup = util::make_unique<uv::async>(**loop, [this]() {
|
||||
painter.cleanup();
|
||||
});
|
||||
|
||||
@@ -191,7 +191,7 @@ void Map::start(bool startPaused) {
|
||||
pause();
|
||||
}
|
||||
|
||||
thread = std::make_unique<uv::thread>([this]() {
|
||||
thread = util::make_unique<uv::thread>([this]() {
|
||||
#ifndef NDEBUG
|
||||
mapThread = uv_thread_self();
|
||||
#endif
|
||||
|
||||
@@ -164,7 +164,7 @@ TileData::State Source::addTile(Map& map, uv::worker& worker,
|
||||
return state;
|
||||
}
|
||||
|
||||
auto pos = tiles.emplace(id, std::make_unique<Tile>(id));
|
||||
auto pos = tiles.emplace(id, util::make_unique<Tile>(id));
|
||||
Tile& new_tile = *pos.first->second;
|
||||
|
||||
// We couldn't find the tile in the list. Create a new one.
|
||||
|
||||
@@ -101,7 +101,7 @@ bool Sprite::isLoaded() const {
|
||||
}
|
||||
|
||||
void Sprite::parseImage() {
|
||||
raster = std::make_unique<util::Image>(image);
|
||||
raster = util::make_unique<util::Image>(image);
|
||||
if (!*raster) {
|
||||
raster.reset();
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ TileParser::TileParser(const std::string &data, VectorTileData &tile_,
|
||||
spriteAtlas(spriteAtlas_),
|
||||
sprite(sprite_),
|
||||
texturePool(texturePool_),
|
||||
collision(std::make_unique<Collision>(tile.id.z, 4096, tile.source.tile_size, tile.depth)) {
|
||||
collision(util::make_unique<Collision>(tile.id.z, 4096, tile.source.tile_size, tile.depth)) {
|
||||
assert(&tile != nullptr);
|
||||
assert(style);
|
||||
assert(sprite);
|
||||
@@ -150,24 +150,24 @@ void TileParser::addBucketGeometries(Bucket& bucket, const VectorTileLayer& laye
|
||||
}
|
||||
|
||||
std::unique_ptr<Bucket> TileParser::createFillBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketFill &fill) {
|
||||
std::unique_ptr<FillBucket> bucket = std::make_unique<FillBucket>(tile.fillVertexBuffer, tile.triangleElementsBuffer, tile.lineElementsBuffer, fill);
|
||||
std::unique_ptr<FillBucket> bucket = util::make_unique<FillBucket>(tile.fillVertexBuffer, tile.triangleElementsBuffer, tile.lineElementsBuffer, fill);
|
||||
addBucketGeometries(bucket, layer, filter);
|
||||
return obsolete() ? nullptr : std::move(bucket);
|
||||
}
|
||||
|
||||
std::unique_ptr<Bucket> TileParser::createRasterBucket(const StyleBucketRaster &raster) {
|
||||
std::unique_ptr<RasterBucket> bucket = std::make_unique<RasterBucket>(texturePool, raster);
|
||||
std::unique_ptr<RasterBucket> bucket = util::make_unique<RasterBucket>(texturePool, raster);
|
||||
return obsolete() ? nullptr : std::move(bucket);
|
||||
}
|
||||
|
||||
std::unique_ptr<Bucket> TileParser::createLineBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketLine &line) {
|
||||
std::unique_ptr<LineBucket> bucket = std::make_unique<LineBucket>(tile.lineVertexBuffer, tile.triangleElementsBuffer, tile.pointElementsBuffer, line);
|
||||
std::unique_ptr<LineBucket> bucket = util::make_unique<LineBucket>(tile.lineVertexBuffer, tile.triangleElementsBuffer, tile.pointElementsBuffer, line);
|
||||
addBucketGeometries(bucket, layer, filter);
|
||||
return obsolete() ? nullptr : std::move(bucket);
|
||||
}
|
||||
|
||||
std::unique_ptr<Bucket> TileParser::createSymbolBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketSymbol &symbol) {
|
||||
std::unique_ptr<SymbolBucket> bucket = std::make_unique<SymbolBucket>(symbol, *collision);
|
||||
std::unique_ptr<SymbolBucket> bucket = util::make_unique<SymbolBucket>(symbol, *collision);
|
||||
bucket->addFeatures(layer, filter, tile.id, spriteAtlas, *sprite, glyphAtlas, glyphStore);
|
||||
return obsolete() ? nullptr : std::move(bucket);
|
||||
}
|
||||
|
||||
@@ -89,18 +89,18 @@ void Painter::setup() {
|
||||
}
|
||||
|
||||
void Painter::setupShaders() {
|
||||
if (!plainShader) plainShader = std::make_unique<PlainShader>();
|
||||
if (!outlineShader) outlineShader = std::make_unique<OutlineShader>();
|
||||
if (!lineShader) lineShader = std::make_unique<LineShader>();
|
||||
if (!linejoinShader) linejoinShader = std::make_unique<LinejoinShader>();
|
||||
if (!linepatternShader) linepatternShader = std::make_unique<LinepatternShader>();
|
||||
if (!patternShader) patternShader = std::make_unique<PatternShader>();
|
||||
if (!iconShader) iconShader = std::make_unique<IconShader>();
|
||||
if (!rasterShader) rasterShader = std::make_unique<RasterShader>();
|
||||
if (!sdfGlyphShader) sdfGlyphShader = std::make_unique<SDFGlyphShader>();
|
||||
if (!sdfIconShader) sdfIconShader = std::make_unique<SDFIconShader>();
|
||||
if (!dotShader) dotShader = std::make_unique<DotShader>();
|
||||
if (!gaussianShader) gaussianShader = std::make_unique<GaussianShader>();
|
||||
if (!plainShader) plainShader = util::make_unique<PlainShader>();
|
||||
if (!outlineShader) outlineShader = util::make_unique<OutlineShader>();
|
||||
if (!lineShader) lineShader = util::make_unique<LineShader>();
|
||||
if (!linejoinShader) linejoinShader = util::make_unique<LinejoinShader>();
|
||||
if (!linepatternShader) linepatternShader = util::make_unique<LinepatternShader>();
|
||||
if (!patternShader) patternShader = util::make_unique<PatternShader>();
|
||||
if (!iconShader) iconShader = util::make_unique<IconShader>();
|
||||
if (!rasterShader) rasterShader = util::make_unique<RasterShader>();
|
||||
if (!sdfGlyphShader) sdfGlyphShader = util::make_unique<SDFGlyphShader>();
|
||||
if (!sdfIconShader) sdfIconShader = util::make_unique<SDFIconShader>();
|
||||
if (!dotShader) dotShader = util::make_unique<DotShader>();
|
||||
if (!gaussianShader) gaussianShader = util::make_unique<GaussianShader>();
|
||||
}
|
||||
|
||||
void Painter::deleteShaders() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <mbgl/storage/base_request.hpp>
|
||||
#include <mbgl/storage/response.hpp>
|
||||
#include <mbgl/storage/request.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <uv.h>
|
||||
|
||||
@@ -68,7 +69,7 @@ Callback *BaseRequest::add(Callback &&callback, const util::ptr<BaseRequest> &re
|
||||
return nullptr;
|
||||
} else {
|
||||
self = request;
|
||||
callbacks.push_front(std::unique_ptr<Callback>(new Callback(std::move(callback))));
|
||||
callbacks.push_front(util::make_unique<Callback>(std::move(callback)));
|
||||
return callbacks.front().get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <mbgl/storage/file_request_baton.hpp>
|
||||
#include <mbgl/storage/file_request.hpp>
|
||||
#include <mbgl/storage/response.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <limits>
|
||||
|
||||
@@ -29,7 +30,7 @@ void FileRequestBaton::notify_error(uv_fs_t *req) {
|
||||
assert(ptr->thread_id == uv_thread_self());
|
||||
|
||||
if (ptr->request && req->result < 0 && !ptr->canceled && req->result != UV_ECANCELED) {
|
||||
ptr->request->response = std::unique_ptr<Response>(new Response);
|
||||
ptr->request->response = util::make_unique<Response>();
|
||||
ptr->request->response->code = req->result == UV_ENOENT ? 404 : 500;
|
||||
#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
|
||||
ptr->request->response->message = uv_strerror(uv_last_error(req->loop));
|
||||
@@ -86,7 +87,7 @@ void FileRequestBaton::file_stated(uv_fs_t *req) {
|
||||
// File is too large for us to open this way because uv_buf's only support unsigned
|
||||
// ints as maximum size.
|
||||
if (ptr->request) {
|
||||
ptr->request->response = std::unique_ptr<Response>(new Response);
|
||||
ptr->request->response = util::make_unique<Response>();
|
||||
ptr->request->response->code = UV_EFBIG;
|
||||
#if UV_VERSION_MAJOR == 0 && UV_VERSION_MINOR <= 10
|
||||
ptr->request->response->message = uv_strerror(uv_err_t {UV_EFBIG, 0});
|
||||
@@ -123,7 +124,7 @@ void FileRequestBaton::file_read(uv_fs_t *req) {
|
||||
} else {
|
||||
// File was successfully read.
|
||||
if (ptr->request) {
|
||||
ptr->request->response = std::unique_ptr<Response>(new Response);
|
||||
ptr->request->response = util::make_unique<Response>();
|
||||
ptr->request->response->code = 200;
|
||||
ptr->request->response->data = std::move(ptr->body);
|
||||
ptr->request->notify();
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <mbgl/storage/sqlite_store.hpp>
|
||||
#include <mbgl/storage/asset_request.hpp>
|
||||
#include <mbgl/util/uv-messenger.h>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <uv.h>
|
||||
|
||||
@@ -83,7 +84,7 @@ std::unique_ptr<Request> FileSource::request(ResourceType type, const std::strin
|
||||
pending.emplace(absoluteURL, req);
|
||||
}
|
||||
|
||||
return std::unique_ptr<Request>(new Request(req));
|
||||
return util::make_unique<Request>(req);
|
||||
}
|
||||
|
||||
void FileSource::prepare(std::function<void()> fn) {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include <mbgl/storage/sqlite_store.hpp>
|
||||
#include <mbgl/util/compression.hpp>
|
||||
#include <mbgl/util/sqlite3.hpp>
|
||||
#include <mbgl/util/std.hpp>
|
||||
|
||||
#include <mbgl/util/uv-worker.h>
|
||||
|
||||
@@ -127,7 +128,7 @@ void SQLiteStore::get(const std::string &path, GetCallback callback, void *ptr)
|
||||
stmt.bind(1, url.c_str());
|
||||
if (stmt.run()) {
|
||||
// There is data.
|
||||
baton->response = std::unique_ptr<Response>(new Response);
|
||||
baton->response = util::make_unique<Response>();
|
||||
|
||||
baton->response->code = stmt.get<int>(0);
|
||||
baton->type = ResourceType(stmt.get<int>(1));
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
namespace mbgl {
|
||||
|
||||
Style::Style()
|
||||
: mtx(std::make_unique<uv::rwlock>()) {
|
||||
: mtx(util::make_unique<uv::rwlock>()) {
|
||||
}
|
||||
|
||||
// Note: This constructor is seemingly empty, but we need to declare it anyway
|
||||
|
||||
@@ -449,7 +449,7 @@ bool StyleParser::parseOptionalProperty(const char *property_name, const std::ve
|
||||
|
||||
std::unique_ptr<StyleLayerGroup> StyleParser::createLayers(JSVal value) {
|
||||
if (value.IsArray()) {
|
||||
std::unique_ptr<StyleLayerGroup> group = std::make_unique<StyleLayerGroup>();
|
||||
std::unique_ptr<StyleLayerGroup> group = util::make_unique<StyleLayerGroup>();
|
||||
for (rapidjson::SizeType i = 0; i < value.Size(); ++i) {
|
||||
util::ptr<StyleLayer> layer = createLayer(value[i]);
|
||||
if (layer) {
|
||||
|
||||
@@ -271,7 +271,7 @@ std::shared_future<GlyphPBF &> GlyphStore::loadGlyphRange(const std::string &fon
|
||||
auto range_it = rangeSets.find(range);
|
||||
if (range_it == rangeSets.end()) {
|
||||
// We don't have this glyph set yet for this font stack.
|
||||
range_it = rangeSets.emplace(range, std::make_unique<GlyphPBF>(glyphURL, fontStack, range, fileSource)).first;
|
||||
range_it = rangeSets.emplace(range, util::make_unique<GlyphPBF>(glyphURL, fontStack, range, fileSource)).first;
|
||||
}
|
||||
|
||||
return range_it->second->getFuture();
|
||||
@@ -280,7 +280,7 @@ std::shared_future<GlyphPBF &> GlyphStore::loadGlyphRange(const std::string &fon
|
||||
FontStack &GlyphStore::createFontStack(const std::string &fontStack) {
|
||||
auto stack_it = stacks.find(fontStack);
|
||||
if (stack_it == stacks.end()) {
|
||||
stack_it = stacks.emplace(fontStack, std::make_unique<FontStack>()).first;
|
||||
stack_it = stacks.emplace(fontStack, util::make_unique<FontStack>()).first;
|
||||
}
|
||||
return *stack_it->second.get();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ bool Raster::isLoaded() const {
|
||||
}
|
||||
|
||||
bool Raster::load(const std::string &data) {
|
||||
img = std::make_unique<util::Image>(data);
|
||||
img = util::make_unique<util::Image>(data);
|
||||
width = img->getWidth();
|
||||
height = img->getHeight();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user