summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-05-26 15:18:27 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-05-26 17:57:38 +0200
commitf4707f72e0ce7f1c40337c72ae5c0c0c8ef0efed (patch)
tree31102ca2b739d2b21fcfc231585830969f2b4fa4 /src
parentfdf6026e6249f99b260f15ec672a35c7e9db950d (diff)
downloadqtlocation-mapboxgl-f4707f72e0ce7f1c40337c72ae5c0c0c8ef0efed.tar.gz
Replace mbgl::util::make_unique<> with std::make_unique<>
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/geometry/glyph_atlas.cpp4
-rw-r--r--src/mbgl/geometry/line_atlas.cpp3
-rw-r--r--src/mbgl/geometry/sprite_atlas.cpp2
-rw-r--r--src/mbgl/map/annotation.cpp5
-rw-r--r--src/mbgl/map/annotation.hpp1
-rw-r--r--src/mbgl/map/map.cpp5
-rw-r--r--src/mbgl/map/map_context.cpp19
-rw-r--r--src/mbgl/map/resource_loader.cpp2
-rw-r--r--src/mbgl/map/source.cpp3
-rw-r--r--src/mbgl/map/sprite.cpp3
-rw-r--r--src/mbgl/map/tile_parser.cpp7
-rw-r--r--src/mbgl/map/transform.cpp1
-rw-r--r--src/mbgl/map/vector_tile_data.cpp3
-rw-r--r--src/mbgl/renderer/fill_bucket.cpp5
-rw-r--r--src/mbgl/renderer/line_bucket.cpp3
-rw-r--r--src/mbgl/renderer/painter.cpp25
-rw-r--r--src/mbgl/renderer/painter_fill.cpp1
-rw-r--r--src/mbgl/renderer/painter_raster.cpp1
-rw-r--r--src/mbgl/renderer/symbol_bucket.cpp3
-rw-r--r--src/mbgl/shader/shader.cpp6
-rw-r--r--src/mbgl/storage/default_file_source.cpp2
-rw-r--r--src/mbgl/storage/request.cpp5
-rw-r--r--src/mbgl/style/style.cpp3
-rw-r--r--src/mbgl/style/style_parser.cpp1
-rw-r--r--src/mbgl/text/glyph_store.cpp13
-rw-r--r--src/mbgl/util/raster.cpp3
-rw-r--r--src/mbgl/util/run_loop.hpp3
-rw-r--r--src/mbgl/util/worker.cpp4
28 files changed, 57 insertions, 79 deletions
diff --git a/src/mbgl/geometry/glyph_atlas.cpp b/src/mbgl/geometry/glyph_atlas.cpp
index 0c6af54785..067c5a4062 100644
--- a/src/mbgl/geometry/glyph_atlas.cpp
+++ b/src/mbgl/geometry/glyph_atlas.cpp
@@ -6,8 +6,6 @@
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
-#include <mbgl/util/std.hpp>
-
#include <cassert>
#include <algorithm>
@@ -18,7 +16,7 @@ GlyphAtlas::GlyphAtlas(uint16_t width_, uint16_t height_)
: width(width_),
height(height_),
bin(width_, height_),
- data(util::make_unique<uint8_t[]>(width_ * height_)),
+ data(std::make_unique<uint8_t[]>(width_ * height_)),
dirty(true) {
}
diff --git a/src/mbgl/geometry/line_atlas.cpp b/src/mbgl/geometry/line_atlas.cpp
index 91ac15639b..dc5ee0901a 100644
--- a/src/mbgl/geometry/line_atlas.cpp
+++ b/src/mbgl/geometry/line_atlas.cpp
@@ -3,7 +3,6 @@
#include <mbgl/platform/gl.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/platform/platform.hpp>
-#include <mbgl/util/std.hpp>
#include <boost/functional/hash.hpp>
@@ -15,7 +14,7 @@ using namespace mbgl;
LineAtlas::LineAtlas(uint16_t w, uint16_t h)
: width(w),
height(h),
- data(util::make_unique<uint8_t[]>(w * h)),
+ data(std::make_unique<uint8_t[]>(w * h)),
dirty(true) {
}
diff --git a/src/mbgl/geometry/sprite_atlas.cpp b/src/mbgl/geometry/sprite_atlas.cpp
index 30624e2d1c..93bc76aa5c 100644
--- a/src/mbgl/geometry/sprite_atlas.cpp
+++ b/src/mbgl/geometry/sprite_atlas.cpp
@@ -140,7 +140,7 @@ void SpriteAtlas::allocate() {
if (!data) {
dimension w = static_cast<dimension>(width * pixelRatio);
dimension h = static_cast<dimension>(height * pixelRatio);
- data = util::make_unique<uint32_t[]>(w * h);
+ data = std::make_unique<uint32_t[]>(w * h);
std::fill(data.get(), data.get() + w * h, 0);
}
}
diff --git a/src/mbgl/map/annotation.cpp b/src/mbgl/map/annotation.cpp
index 7a7a0ed683..d30052c94a 100644
--- a/src/mbgl/map/annotation.cpp
+++ b/src/mbgl/map/annotation.cpp
@@ -5,7 +5,6 @@
#include <mbgl/map/map_data.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/ptr.hpp>
-#include <mbgl/util/std.hpp>
#include <algorithm>
#include <memory>
@@ -110,7 +109,7 @@ AnnotationManager::addPointAnnotations(const std::vector<LatLng>& points,
// track the annotation global ID and its geometry
auto anno_it = annotations.emplace(
annotationID,
- util::make_unique<Annotation>(AnnotationType::Point,
+ std::make_unique<Annotation>(AnnotationType::Point,
AnnotationSegments({ { points[i] } })));
const uint8_t maxZoom = data.transform.getMaxZoom();
@@ -162,7 +161,7 @@ AnnotationManager::addPointAnnotations(const std::vector<LatLng>& points,
// create tile & record annotation association
auto tile_pos = tiles.emplace(
tileID, std::make_pair(std::unordered_set<uint32_t>({ annotationID }),
- util::make_unique<LiveTile>()));
+ std::make_unique<LiveTile>()));
// add point layer to tile
tile_pos.first->second.second->addLayer(layerID, layer);
}
diff --git a/src/mbgl/map/annotation.hpp b/src/mbgl/map/annotation.hpp
index a80b03226f..0c9a078e57 100644
--- a/src/mbgl/map/annotation.hpp
+++ b/src/mbgl/map/annotation.hpp
@@ -4,7 +4,6 @@
#include <mbgl/map/tile_id.hpp>
#include <mbgl/util/geo.hpp>
#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/vec.hpp>
#include <string>
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 1141cf83bd..026297fb46 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -3,15 +3,14 @@
#include <mbgl/map/view.hpp>
#include <mbgl/map/map_data.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/projection.hpp>
#include <mbgl/util/thread.hpp>
namespace mbgl {
Map::Map(View& view, FileSource& fileSource, MapMode mode)
- : data(util::make_unique<MapData>(view, mode)),
- context(util::make_unique<util::Thread<MapContext>>("Map", util::ThreadPriority::Regular, view, fileSource, *data))
+ : data(std::make_unique<MapData>(view, mode)),
+ context(std::make_unique<util::Thread<MapContext>>("Map", util::ThreadPriority::Regular, view, fileSource, *data))
{
view.initialize(this);
}
diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp
index 2a03adb158..c8948097f7 100644
--- a/src/mbgl/map/map_context.cpp
+++ b/src/mbgl/map/map_context.cpp
@@ -20,7 +20,6 @@
#include <mbgl/style/style.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <mbgl/util/worker.hpp>
#include <mbgl/util/texture_pool.hpp>
@@ -34,12 +33,12 @@ MapContext::MapContext(uv_loop_t* loop, View& view_, FileSource& fileSource, Map
env(fileSource),
envScope(env, ThreadType::Map, "Map"),
updated(static_cast<UpdateType>(Update::Nothing)),
- asyncUpdate(util::make_unique<uv::async>(loop, [this] { update(); })),
- glyphStore(util::make_unique<GlyphStore>(loop, 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>()) {
+ asyncUpdate(std::make_unique<uv::async>(loop, [this] { update(); })),
+ glyphStore(std::make_unique<GlyphStore>(loop, env)),
+ glyphAtlas(std::make_unique<GlyphAtlas>(1024, 1024)),
+ spriteAtlas(std::make_unique<SpriteAtlas>(512, 512)),
+ lineAtlas(std::make_unique<LineAtlas>(512, 512)),
+ texturePool(std::make_unique<TexturePool>()) {
assert(Environment::currentlyOn(ThreadType::Map));
asyncUpdate->unref();
@@ -120,7 +119,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
resourceLoader.reset();
style.reset();
- style = util::make_unique<Style>();
+ style = std::make_unique<Style>();
style->base = base;
style->loadJSON((const uint8_t *)json.c_str());
style->cascade(data.getClasses());
@@ -128,7 +127,7 @@ void MapContext::loadStyleJSON(const std::string& json, const std::string& base)
glyphStore->setURL(style->glyph_url);
- resourceLoader = util::make_unique<ResourceLoader>();
+ resourceLoader = std::make_unique<ResourceLoader>();
resourceLoader->setObserver(this);
resourceLoader->setStyle(style.get());
resourceLoader->setGlyphStore(glyphStore.get());
@@ -221,7 +220,7 @@ void MapContext::render() {
assert(style);
if (!painter) {
- painter = util::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas);
+ painter = std::make_unique<Painter>(*spriteAtlas, *glyphAtlas, *lineAtlas);
painter->setup();
}
diff --git a/src/mbgl/map/resource_loader.cpp b/src/mbgl/map/resource_loader.cpp
index 49c169d201..8e054c0d82 100644
--- a/src/mbgl/map/resource_loader.cpp
+++ b/src/mbgl/map/resource_loader.cpp
@@ -71,7 +71,7 @@ void ResourceLoader::update(MapData& data,
const float pixelRatio = transform.getPixelRatio();
if (!sprite_ || !sprite_->hasPixelRatio(pixelRatio)) {
- sprite_ = util::make_unique<Sprite>(style_->getSpriteURL(), pixelRatio);
+ sprite_ = std::make_unique<Sprite>(style_->getSpriteURL(), pixelRatio);
sprite_->setObserver(this);
spriteAtlas.resize(pixelRatio);
diff --git a/src/mbgl/map/source.cpp b/src/mbgl/map/source.cpp
index b35bdac33c..eb273d785d 100644
--- a/src/mbgl/map/source.cpp
+++ b/src/mbgl/map/source.cpp
@@ -14,6 +14,7 @@
#include <mbgl/style/style_layer.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/util/uv_detail.hpp>
+#include <mbgl/util/std.hpp>
#include <mbgl/util/token.hpp>
#include <mbgl/util/string.hpp>
#include <mbgl/util/tile_cover.hpp>
@@ -264,7 +265,7 @@ TileData::State Source::addTile(MapData& data,
return state;
}
- auto pos = tiles.emplace(id, util::make_unique<Tile>(id));
+ auto pos = tiles.emplace(id, std::make_unique<Tile>(id));
Tile& new_tile = *pos.first->second;
// We couldn't find the tile in the list. Create a new one.
diff --git a/src/mbgl/map/sprite.cpp b/src/mbgl/map/sprite.cpp
index d8cadbeb3f..fd3615f912 100644
--- a/src/mbgl/map/sprite.cpp
+++ b/src/mbgl/map/sprite.cpp
@@ -7,7 +7,6 @@
#include <mbgl/storage/response.hpp>
#include <mbgl/util/exception.hpp>
#include <mbgl/util/raster.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <rapidjson/document.h>
@@ -107,7 +106,7 @@ bool Sprite::hasPixelRatio(float ratio) const {
}
void Sprite::parseImage() {
- raster = util::make_unique<util::Image>(image);
+ raster = std::make_unique<util::Image>(image);
if (!*raster) {
raster.reset();
}
diff --git a/src/mbgl/map/tile_parser.cpp b/src/mbgl/map/tile_parser.cpp
index a932453136..9c0b5e26e1 100644
--- a/src/mbgl/map/tile_parser.cpp
+++ b/src/mbgl/map/tile_parser.cpp
@@ -8,7 +8,6 @@
#include <mbgl/renderer/line_bucket.hpp>
#include <mbgl/renderer/symbol_bucket.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/style/style.hpp>
#include <locale>
@@ -154,7 +153,7 @@ void TileParser::addBucketGeometries(Bucket& bucket, const GeometryTileLayer& la
std::unique_ptr<Bucket> TileParser::createFillBucket(const GeometryTileLayer& layer,
const StyleBucket& bucket_desc) {
- auto bucket = util::make_unique<FillBucket>(tile.fillVertexBuffer,
+ auto bucket = std::make_unique<FillBucket>(tile.fillVertexBuffer,
tile.triangleElementsBuffer,
tile.lineElementsBuffer);
addBucketGeometries(bucket, layer, bucket_desc.filter);
@@ -163,7 +162,7 @@ std::unique_ptr<Bucket> TileParser::createFillBucket(const GeometryTileLayer& la
std::unique_ptr<Bucket> TileParser::createLineBucket(const GeometryTileLayer& layer,
const StyleBucket& bucket_desc) {
- auto bucket = util::make_unique<LineBucket>(tile.lineVertexBuffer,
+ auto bucket = std::make_unique<LineBucket>(tile.lineVertexBuffer,
tile.triangleElementsBuffer);
const float z = tile.id.z;
@@ -180,7 +179,7 @@ std::unique_ptr<Bucket> TileParser::createLineBucket(const GeometryTileLayer& la
std::unique_ptr<Bucket> TileParser::createSymbolBucket(const GeometryTileLayer& layer,
const StyleBucket& bucket_desc) {
- auto bucket = util::make_unique<SymbolBucket>(*tile.getCollision());
+ auto bucket = std::make_unique<SymbolBucket>(*tile.getCollision());
const float z = tile.id.z;
auto& layout = bucket->layout;
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp
index f5e9f00998..182e534295 100644
--- a/src/mbgl/map/transform.cpp
+++ b/src/mbgl/map/transform.cpp
@@ -2,7 +2,6 @@
#include <mbgl/map/view.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/mat4.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/math.hpp>
#include <mbgl/util/unitbezier.hpp>
#include <mbgl/util/interpolate.hpp>
diff --git a/src/mbgl/map/vector_tile_data.cpp b/src/mbgl/map/vector_tile_data.cpp
index 801d9a7c57..4d77c8ef81 100644
--- a/src/mbgl/map/vector_tile_data.cpp
+++ b/src/mbgl/map/vector_tile_data.cpp
@@ -1,6 +1,5 @@
#include <mbgl/map/vector_tile_data.hpp>
#include <mbgl/map/tile_parser.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/style/style_layer.hpp>
#include <mbgl/style/style_bucket.hpp>
#include <mbgl/map/source.hpp>
@@ -26,7 +25,7 @@ VectorTileData::VectorTileData(const TileID& id_,
spriteAtlas(spriteAtlas_),
sprite(sprite_),
style(style_),
- collision(util::make_unique<Collision>(id_.z, 4096, source_.tile_size, depth)) {
+ collision(std::make_unique<Collision>(id_.z, 4096, source_.tile_size, depth)) {
}
VectorTileData::~VectorTileData() {
diff --git a/src/mbgl/renderer/fill_bucket.cpp b/src/mbgl/renderer/fill_bucket.cpp
index c59b0970e0..a98a8b7cdf 100644
--- a/src/mbgl/renderer/fill_bucket.cpp
+++ b/src/mbgl/renderer/fill_bucket.cpp
@@ -7,7 +7,6 @@
#include <mbgl/shader/plain_shader.hpp>
#include <mbgl/shader/pattern_shader.hpp>
#include <mbgl/shader/outline_shader.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/platform/gl.hpp>
#include <mbgl/platform/log.hpp>
@@ -107,7 +106,7 @@ void FillBucket::tessellate() {
if (!lineGroups.size() || (lineGroups.back()->vertex_length + total_vertex_count > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- lineGroups.emplace_back(util::make_unique<LineGroup>());
+ lineGroups.emplace_back(std::make_unique<LineGroup>());
}
assert(lineGroups.back());
@@ -154,7 +153,7 @@ void FillBucket::tessellate() {
if (!triangleGroups.size() || (triangleGroups.back()->vertex_length + total_vertex_count > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- triangleGroups.emplace_back(util::make_unique<TriangleGroup>());
+ triangleGroups.emplace_back(std::make_unique<TriangleGroup>());
}
// We're generating triangle fans, so we always start with the first
diff --git a/src/mbgl/renderer/line_bucket.cpp b/src/mbgl/renderer/line_bucket.cpp
index bbfc02ead1..f696874afe 100644
--- a/src/mbgl/renderer/line_bucket.cpp
+++ b/src/mbgl/renderer/line_bucket.cpp
@@ -8,7 +8,6 @@
#include <mbgl/shader/linesdf_shader.hpp>
#include <mbgl/shader/linepattern_shader.hpp>
#include <mbgl/util/math.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/platform/gl.hpp>
#ifndef BUFFER_OFFSET
@@ -290,7 +289,7 @@ void LineBucket::addGeometry(const std::vector<Coordinate>& vertices) {
if (!triangleGroups.size() ||
(triangleGroups.back()->vertex_length + vertexCount > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- triangleGroups.emplace_back(util::make_unique<TriangleGroup>());
+ triangleGroups.emplace_back(std::make_unique<TriangleGroup>());
}
assert(triangleGroups.back());
diff --git a/src/mbgl/renderer/painter.cpp b/src/mbgl/renderer/painter.cpp
index bcbb75e69a..a8e420215f 100644
--- a/src/mbgl/renderer/painter.cpp
+++ b/src/mbgl/renderer/painter.cpp
@@ -26,7 +26,6 @@
#include <mbgl/shader/dot_shader.hpp>
#include <mbgl/shader/gaussian_shader.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/mat3.hpp>
@@ -94,18 +93,18 @@ void Painter::setup() {
}
void Painter::setupShaders() {
- if (!plainShader) plainShader = util::make_unique<PlainShader>();
- if (!outlineShader) outlineShader = util::make_unique<OutlineShader>();
- if (!lineShader) lineShader = util::make_unique<LineShader>();
- if (!linesdfShader) linesdfShader = util::make_unique<LineSDFShader>();
- 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>();
+ if (!plainShader) plainShader = std::make_unique<PlainShader>();
+ if (!outlineShader) outlineShader = std::make_unique<OutlineShader>();
+ if (!lineShader) lineShader = std::make_unique<LineShader>();
+ if (!linesdfShader) linesdfShader = std::make_unique<LineSDFShader>();
+ 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>();
}
void Painter::resize() {
diff --git a/src/mbgl/renderer/painter_fill.cpp b/src/mbgl/renderer/painter_fill.cpp
index 6f6783f0e2..64dc3d2f0a 100644
--- a/src/mbgl/renderer/painter_fill.cpp
+++ b/src/mbgl/renderer/painter_fill.cpp
@@ -9,7 +9,6 @@
#include <mbgl/shader/outline_shader.hpp>
#include <mbgl/shader/pattern_shader.hpp>
#include <mbgl/shader/plain_shader.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/mat3.hpp>
using namespace mbgl;
diff --git a/src/mbgl/renderer/painter_raster.cpp b/src/mbgl/renderer/painter_raster.cpp
index 61aff9c1a8..2a8f8e7078 100644
--- a/src/mbgl/renderer/painter_raster.cpp
+++ b/src/mbgl/renderer/painter_raster.cpp
@@ -3,7 +3,6 @@
#include <mbgl/renderer/raster_bucket.hpp>
#include <mbgl/style/style_layer.hpp>
#include <mbgl/shader/raster_shader.hpp>
-#include <mbgl/util/std.hpp>
using namespace mbgl;
diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp
index 28113b6184..02e7e0cc6a 100644
--- a/src/mbgl/renderer/symbol_bucket.cpp
+++ b/src/mbgl/renderer/symbol_bucket.cpp
@@ -21,7 +21,6 @@
#include <mbgl/util/token.hpp>
#include <mbgl/util/math.hpp>
#include <mbgl/util/merge_lines.hpp>
-#include <mbgl/util/std.hpp>
#ifndef BUFFER_OFFSET
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -409,7 +408,7 @@ void SymbolBucket::addSymbols(Buffer &buffer, const PlacedGlyphs &symbols, float
if (!buffer.groups.size() ||
(buffer.groups.back()->vertex_length + glyph_vertex_length > 65535)) {
// Move to a new group because the old one can't hold the geometry.
- buffer.groups.emplace_back(util::make_unique<GroupType>());
+ buffer.groups.emplace_back(std::make_unique<GroupType>());
}
// We're generating triangle fans, so we always start with the first
diff --git a/src/mbgl/shader/shader.cpp b/src/mbgl/shader/shader.cpp
index a079409aa0..6210c1c32e 100644
--- a/src/mbgl/shader/shader.cpp
+++ b/src/mbgl/shader/shader.cpp
@@ -51,7 +51,7 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo
if (status == 0) {
GLint logLength;
MBGL_CHECK_ERROR(glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength));
- std::unique_ptr<GLchar[]> log = mbgl::util::make_unique<GLchar[]>(logLength);
+ const auto log = std::make_unique<GLchar[]>(logLength);
if (logLength > 0) {
MBGL_CHECK_ERROR(glGetProgramInfoLog(program, logLength, &logLength, log.get()));
Log::Error(Event::Shader, "Program failed to link: %s", log.get());
@@ -76,7 +76,7 @@ Shader::Shader(const char *name_, const GLchar *vertSource, const GLchar *fragSo
if (status == 0) {
GLint logLength;
MBGL_CHECK_ERROR(glGetProgramiv(program, GL_INFO_LOG_LENGTH, &logLength));
- std::unique_ptr<GLchar[]> log = mbgl::util::make_unique<GLchar[]>(logLength);
+ const auto log = std::make_unique<GLchar[]>(logLength);
if (logLength > 0) {
MBGL_CHECK_ERROR(glGetProgramInfoLog(program, logLength, &logLength, log.get()));
Log::Error(Event::Shader, "Program failed to validate: %s", log.get());
@@ -115,7 +115,7 @@ bool Shader::compileShader(GLuint *shader, GLenum type, const GLchar *source) {
GLint logLength;
MBGL_CHECK_ERROR(glGetShaderiv(*shader, GL_INFO_LOG_LENGTH, &logLength));
if (logLength > 0) {
- std::unique_ptr<GLchar[]> log = mbgl::util::make_unique<GLchar[]>(logLength);
+ const auto log = std::make_unique<GLchar[]>(logLength);
MBGL_CHECK_ERROR(glGetShaderInfoLog(*shader, logLength, &logLength, log.get()));
Log::Error(Event::Shader, "Shader failed to compile: %s", log.get());
}
diff --git a/src/mbgl/storage/default_file_source.cpp b/src/mbgl/storage/default_file_source.cpp
index 78a1132f17..b46696aaa3 100644
--- a/src/mbgl/storage/default_file_source.cpp
+++ b/src/mbgl/storage/default_file_source.cpp
@@ -28,7 +28,7 @@ namespace algo = boost::algorithm;
namespace mbgl {
DefaultFileSource::DefaultFileSource(FileCache* cache, const std::string& root)
- : thread(util::make_unique<util::Thread<Impl>>("FileSource", util::ThreadPriority::Low, cache, root)) {
+ : thread(std::make_unique<util::Thread<Impl>>("FileSource", util::ThreadPriority::Low, cache, root)) {
}
DefaultFileSource::~DefaultFileSource() {
diff --git a/src/mbgl/storage/request.cpp b/src/mbgl/storage/request.cpp
index a6d845ce4a..b653a41e71 100644
--- a/src/mbgl/storage/request.cpp
+++ b/src/mbgl/storage/request.cpp
@@ -4,7 +4,6 @@
#include <mbgl/storage/response.hpp>
#include <mbgl/util/util.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <cassert>
@@ -16,7 +15,7 @@ struct Request::Canceled { std::mutex mutex; bool confirmed = false; };
// Note: This requires that loop is running in the current thread (or not yet running).
Request::Request(const Resource &resource_, uv_loop_t *loop, Callback callback_)
- : async(util::make_unique<uv::async>(loop, [this] { notifyCallback(); })),
+ : async(std::make_unique<uv::async>(loop, [this] { notifyCallback(); })),
callback(callback_),
resource(resource_) {
}
@@ -62,7 +61,7 @@ void Request::notify(const std::shared_ptr<const Response> &response_) {
void Request::cancel() {
assert(async);
assert(!canceled);
- canceled = util::make_unique<Canceled>();
+ canceled = std::make_unique<Canceled>();
}
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp
index 51d92fdcaf..0acf66eb56 100644
--- a/src/mbgl/style/style.cpp
+++ b/src/mbgl/style/style.cpp
@@ -5,7 +5,6 @@
#include <mbgl/style/style_parser.hpp>
#include <mbgl/style/style_bucket.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <mbgl/platform/log.hpp>
#include <csscolorparser/csscolorparser.hpp>
@@ -17,7 +16,7 @@
namespace mbgl {
Style::Style()
- : mtx(util::make_unique<uv::rwlock>()),
+ : mtx(std::make_unique<uv::rwlock>()),
workers(4) {
}
diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp
index 313fe3df89..83a113f885 100644
--- a/src/mbgl/style/style_parser.cpp
+++ b/src/mbgl/style/style_parser.cpp
@@ -3,7 +3,6 @@
#include <mbgl/style/style_layer.hpp>
#include <mbgl/map/annotation.hpp>
#include <mbgl/util/constants.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/vec.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <mbgl/platform/log.hpp>
diff --git a/src/mbgl/text/glyph_store.cpp b/src/mbgl/text/glyph_store.cpp
index c6e00f0591..ea451e278d 100644
--- a/src/mbgl/text/glyph_store.cpp
+++ b/src/mbgl/text/glyph_store.cpp
@@ -3,15 +3,14 @@
#include <mbgl/text/font_stack.hpp>
#include <mbgl/util/exception.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
namespace mbgl {
GlyphStore::GlyphStore(uv_loop_t* loop, Environment& env_)
: env(env_),
- asyncEmitGlyphRangeLoaded(util::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoaded(); })),
- asyncEmitGlyphRangeLoadedingFailed(util::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoadingFailed(); })),
+ asyncEmitGlyphRangeLoaded(std::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoaded(); })),
+ asyncEmitGlyphRangeLoadedingFailed(std::make_unique<uv::async>(loop, [this] { emitGlyphRangeLoadingFailed(); })),
observer(nullptr) {
asyncEmitGlyphRangeLoaded->unref();
asyncEmitGlyphRangeLoadedingFailed->unref();
@@ -51,7 +50,7 @@ bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStackName,
for (const auto& range : glyphRanges) {
const auto& rangeSets_it = rangeSets.find(range);
if (rangeSets_it == rangeSets.end()) {
- auto glyph = util::make_unique<GlyphPBF>(glyphURL, fontStackName, range, env,
+ auto glyph = std::make_unique<GlyphPBF>(glyphURL, fontStackName, range, env,
successCallback, failureCallback);
rangeSets.emplace(range, std::move(glyph));
requestIsNeeded = true;
@@ -67,18 +66,18 @@ bool GlyphStore::requestGlyphRangesIfNeeded(const std::string& fontStackName,
}
util::exclusive<FontStack> GlyphStore::createFontStack(const std::string &fontStack) {
- auto lock = util::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
+ auto lock = std::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
auto stack_it = stacks.find(fontStack);
if (stack_it == stacks.end()) {
- stack_it = stacks.emplace(fontStack, util::make_unique<FontStack>()).first;
+ stack_it = stacks.emplace(fontStack, std::make_unique<FontStack>()).first;
}
return { stack_it->second.get(), std::move(lock) };
}
util::exclusive<FontStack> GlyphStore::getFontStack(const std::string &fontStack) {
- auto lock = util::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
+ auto lock = std::make_unique<std::lock_guard<std::mutex>>(stacksMutex);
const auto& stack_it = stacks.find(fontStack);
if (stack_it == stacks.end()) {
diff --git a/src/mbgl/util/raster.cpp b/src/mbgl/util/raster.cpp
index f2171a6165..b6b5df27f6 100644
--- a/src/mbgl/util/raster.cpp
+++ b/src/mbgl/util/raster.cpp
@@ -4,7 +4,6 @@
#include <mbgl/util/raster.hpp>
#include <mbgl/util/uv_detail.hpp>
-#include <mbgl/util/std.hpp>
#include <cassert>
#include <cstring>
@@ -27,7 +26,7 @@ bool Raster::isLoaded() const {
}
bool Raster::load(const std::string &data) {
- img = util::make_unique<util::Image>(data);
+ img = std::make_unique<util::Image>(data);
width = img->getWidth();
height = img->getHeight();
diff --git a/src/mbgl/util/run_loop.hpp b/src/mbgl/util/run_loop.hpp
index 068215a04e..1c92847b69 100644
--- a/src/mbgl/util/run_loop.hpp
+++ b/src/mbgl/util/run_loop.hpp
@@ -2,7 +2,6 @@
#define MBGL_UTIL_RUN_LOOP
#include <mbgl/util/noncopyable.hpp>
-#include <mbgl/util/std.hpp>
#include <mbgl/util/uv_detail.hpp>
#include <functional>
@@ -24,7 +23,7 @@ public:
template <class Fn, class... Args>
void invoke(Fn&& fn, Args&&... args) {
auto tuple = std::make_tuple(std::move(args)...);
- auto invokable = util::make_unique<Invoker<Fn, decltype(tuple), Args...>>(std::move(fn), std::move(tuple));
+ auto invokable = std::make_unique<Invoker<Fn, decltype(tuple), Args...>>(std::move(fn), std::move(tuple));
withMutex([&] { queue.push(std::move(invokable)); });
async.send();
}
diff --git a/src/mbgl/util/worker.cpp b/src/mbgl/util/worker.cpp
index 984c55c95e..3022d30277 100644
--- a/src/mbgl/util/worker.cpp
+++ b/src/mbgl/util/worker.cpp
@@ -19,7 +19,7 @@ public:
Worker::Worker(std::size_t count) {
for (std::size_t i = 0; i < count; i++) {
- threads.emplace_back(util::make_unique<util::Thread<Impl>>("Worker", util::ThreadPriority::Low));
+ threads.emplace_back(std::make_unique<util::Thread<Impl>>("Worker", util::ThreadPriority::Low));
}
}
@@ -27,7 +27,7 @@ Worker::~Worker() = default;
std::unique_ptr<WorkRequest> Worker::send(Fn work, Fn after) {
auto task = std::make_shared<WorkTask>(work, after);
- auto request = util::make_unique<WorkRequest>(task);
+ auto request = std::make_unique<WorkRequest>(task);
threads[current]->invokeWithResult(&Worker::Impl::doWork, [task] {
task->runAfter();