summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-11-28 17:23:05 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-12-02 12:24:25 -0800
commita6522d4a5aa894d260c3fbb246deba95b66061fd (patch)
treed05825100ebd29a1e108b72cd8aa1237adcb98dd
parent8fdf645e121034de2dd6ceca5e1c3bcd7c4c40a4 (diff)
downloadqtlocation-mapboxgl-a6522d4a5aa894d260c3fbb246deba95b66061fd.tar.gz
Texturepool ⇢ TexturePool (fixes #655)
-rw-r--r--include/mbgl/map/map.hpp4
-rw-r--r--include/mbgl/map/raster_tile_data.hpp4
-rw-r--r--include/mbgl/map/source.hpp6
-rw-r--r--include/mbgl/map/tile_parser.hpp10
-rw-r--r--include/mbgl/map/vector_tile_data.hpp6
-rw-r--r--include/mbgl/renderer/raster_bucket.hpp2
-rw-r--r--include/mbgl/util/raster.hpp6
-rw-r--r--include/mbgl/util/texture_pool.hpp (renamed from include/mbgl/util/texturepool.hpp)2
-rw-r--r--src/map/map.cpp8
-rw-r--r--src/map/raster_tile_data.cpp4
-rw-r--r--src/map/source.cpp12
-rw-r--r--src/map/tile_parser.cpp8
-rw-r--r--src/map/vector_tile_data.cpp6
-rw-r--r--src/renderer/raster_bucket.cpp4
-rw-r--r--src/util/raster.cpp8
-rw-r--r--src/util/texture_pool.cpp (renamed from src/util/texturepool.cpp)8
16 files changed, 49 insertions, 49 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 1f4715339d..e97c63138c 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -24,7 +24,7 @@ class Style;
class StyleLayer;
class StyleLayerGroup;
class StyleSource;
-class Texturepool;
+class TexturePool;
class FileSource;
class View;
@@ -184,7 +184,7 @@ private:
util::ptr<GlyphStore> glyphStore;
SpriteAtlas spriteAtlas;
util::ptr<Sprite> sprite;
- util::ptr<Texturepool> texturepool;
+ util::ptr<TexturePool> texturePool;
Painter painter;
diff --git a/include/mbgl/map/raster_tile_data.hpp b/include/mbgl/map/raster_tile_data.hpp
index cbbd864aae..42070d9c61 100644
--- a/include/mbgl/map/raster_tile_data.hpp
+++ b/include/mbgl/map/raster_tile_data.hpp
@@ -10,13 +10,13 @@ namespace mbgl {
class Painter;
class SourceInfo;
class StyleLayer;
-class Texturepool;
+class TexturePool;
class RasterTileData : public TileData {
friend class TileParser;
public:
- RasterTileData(Tile::ID const& id, Texturepool&, const SourceInfo&);
+ RasterTileData(Tile::ID const& id, TexturePool&, const SourceInfo&);
~RasterTileData();
virtual void parse();
diff --git a/include/mbgl/map/source.hpp b/include/mbgl/map/source.hpp
index c36376fd5d..8976f67b05 100644
--- a/include/mbgl/map/source.hpp
+++ b/include/mbgl/map/source.hpp
@@ -23,7 +23,7 @@ class GlyphStore;
class SpriteAtlas;
class Sprite;
class FileSource;
-class Texturepool;
+class TexturePool;
class Style;
class Painter;
class StyleLayer;
@@ -39,7 +39,7 @@ public:
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
- Texturepool&, FileSource&,
+ TexturePool&, FileSource&,
std::function<void ()> callback);
void updateMatrices(const mat4 &projMatrix, const TransformState &transform);
@@ -63,7 +63,7 @@ private:
util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
- FileSource&, Texturepool&,
+ FileSource&, TexturePool&,
const Tile::ID&,
std::function<void ()> callback);
diff --git a/include/mbgl/map/tile_parser.hpp b/include/mbgl/map/tile_parser.hpp
index 460225db9f..beae3af831 100644
--- a/include/mbgl/map/tile_parser.hpp
+++ b/include/mbgl/map/tile_parser.hpp
@@ -13,7 +13,7 @@
namespace mbgl {
class Bucket;
-class Texturepool;
+class TexturePool;
class FontStack;
class GlyphAtlas;
class GlyphStore;
@@ -28,7 +28,7 @@ class StyleBucketSymbol;
class StyleLayerGroup;
class VectorTileData;
class Collision;
-class Texturepool;
+class TexturePool;
class TileParser : private util::noncopyable
{
@@ -39,7 +39,7 @@ public:
GlyphStore & glyphStore,
SpriteAtlas & spriteAtlas,
const util::ptr<Sprite> &sprite,
- Texturepool& texturepool);
+ TexturePool& texturePool);
~TileParser();
public:
@@ -51,7 +51,7 @@ private:
std::unique_ptr<Bucket> createBucket(util::ptr<StyleBucket> bucket_desc);
std::unique_ptr<Bucket> createFillBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketFill &fill);
- std::unique_ptr<Bucket> createRasterBucket(Texturepool& texturepool, const StyleBucketRaster &raster);
+ std::unique_ptr<Bucket> createRasterBucket(const StyleBucketRaster &raster);
std::unique_ptr<Bucket> createLineBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketLine &line);
std::unique_ptr<Bucket> createSymbolBucket(const VectorTileLayer& layer, const FilterExpression &filter, const StyleBucketSymbol &symbol);
@@ -67,7 +67,7 @@ private:
GlyphStore & glyphStore;
SpriteAtlas & spriteAtlas;
util::ptr<Sprite> sprite;
- Texturepool& texturePool;
+ TexturePool& texturePool;
std::unique_ptr<Collision> collision;
};
diff --git a/include/mbgl/map/vector_tile_data.hpp b/include/mbgl/map/vector_tile_data.hpp
index 0a0569f2ee..b9bf55a1b3 100644
--- a/include/mbgl/map/vector_tile_data.hpp
+++ b/include/mbgl/map/vector_tile_data.hpp
@@ -24,7 +24,7 @@ class GlyphAtlas;
class GlyphStore;
class SpriteAtlas;
class Sprite;
-class Texturepool;
+class TexturePool;
class Style;
class VectorTileData : public TileData {
@@ -35,7 +35,7 @@ public:
float mapMaxZoom, util::ptr<Style>,
GlyphAtlas&, GlyphStore&,
SpriteAtlas&, util::ptr<Sprite>,
- Texturepool&,
+ TexturePool&,
const SourceInfo&);
~VectorTileData();
@@ -62,7 +62,7 @@ protected:
GlyphStore& glyphStore;
SpriteAtlas& spriteAtlas;
util::ptr<Sprite> sprite;
- Texturepool& texturepool;
+ TexturePool& texturePool;
util::ptr<Style> style;
public:
diff --git a/include/mbgl/renderer/raster_bucket.hpp b/include/mbgl/renderer/raster_bucket.hpp
index 8c5d9839a5..0a7651d7cc 100644
--- a/include/mbgl/renderer/raster_bucket.hpp
+++ b/include/mbgl/renderer/raster_bucket.hpp
@@ -16,7 +16,7 @@ class VertexArrayObject;
class RasterBucket : public Bucket {
public:
- RasterBucket(Texturepool&, const StyleBucketRaster&);
+ RasterBucket(TexturePool&, const StyleBucketRaster&);
virtual void render(Painter& painter, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
virtual bool hasData() const;
diff --git a/include/mbgl/util/raster.hpp b/include/mbgl/util/raster.hpp
index d74c78f714..ff27f509f4 100644
--- a/include/mbgl/util/raster.hpp
+++ b/include/mbgl/util/raster.hpp
@@ -2,7 +2,7 @@
#define MBGL_UTIL_RASTER
#include <mbgl/util/transition.hpp>
-#include <mbgl/util/texturepool.hpp>
+#include <mbgl/util/texture_pool.hpp>
#include <mbgl/util/image.hpp>
#include <mbgl/util/ptr.hpp>
#include <mbgl/renderer/prerendered_texture.hpp>
@@ -17,7 +17,7 @@ namespace mbgl {
class Raster : public std::enable_shared_from_this<Raster> {
public:
- Raster(Texturepool&);
+ Raster(TexturePool&);
~Raster();
// load image data
@@ -57,7 +57,7 @@ private:
bool loaded = false;
// shared texture pool
- Texturepool& texturepool;
+ TexturePool& texturePool;
// min/mag filter
uint32_t filter = 0;
diff --git a/include/mbgl/util/texturepool.hpp b/include/mbgl/util/texture_pool.hpp
index 566d8c1750..95d918c237 100644
--- a/include/mbgl/util/texturepool.hpp
+++ b/include/mbgl/util/texture_pool.hpp
@@ -9,7 +9,7 @@
namespace mbgl {
-class Texturepool : private util::noncopyable {
+class TexturePool : private util::noncopyable {
public:
GLuint getTextureID();
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 259e212423..b3c83d1be6 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -17,7 +17,7 @@
#include <mbgl/geometry/glyph_atlas.hpp>
#include <mbgl/style/style_layer_group.hpp>
#include <mbgl/style/style_bucket.hpp>
-#include <mbgl/util/texturepool.hpp>
+#include <mbgl/util/texture_pool.hpp>
#include <mbgl/geometry/sprite_atlas.hpp>
#include <mbgl/storage/file_source.hpp>
#include <mbgl/platform/log.hpp>
@@ -94,7 +94,7 @@ Map::Map(View& view_)
transform(view_),
glyphAtlas(1024, 1024),
spriteAtlas(512, 512),
- texturepool(std::make_shared<Texturepool>()),
+ texturePool(std::make_shared<TexturePool>()),
painter(spriteAtlas, glyphAtlas)
{
view.initialize(this);
@@ -114,7 +114,7 @@ Map::~Map() {
sprite.reset();
glyphStore.reset();
style.reset();
- texturepool.reset();
+ texturePool.reset();
fileSource.reset();
workers.reset();
@@ -588,7 +588,7 @@ void Map::updateTiles() {
source->source->update(*this, getWorker(),
style, glyphAtlas, *glyphStore,
spriteAtlas, getSprite(),
- *texturepool, *fileSource, [this](){ update(); });
+ *texturePool, *fileSource, [this](){ update(); });
}
}
diff --git a/src/map/raster_tile_data.cpp b/src/map/raster_tile_data.cpp
index 8b29fedcd8..6fac7862e7 100644
--- a/src/map/raster_tile_data.cpp
+++ b/src/map/raster_tile_data.cpp
@@ -5,9 +5,9 @@
using namespace mbgl;
-RasterTileData::RasterTileData(Tile::ID const& id_, Texturepool& texturepool, const SourceInfo& source_)
+RasterTileData::RasterTileData(Tile::ID const& id_, TexturePool& texturePool, const SourceInfo& source_)
: TileData(id_, source_),
- bucket(texturepool, properties) {
+ bucket(texturePool, properties) {
}
RasterTileData::~RasterTileData() {
diff --git a/src/map/source.cpp b/src/map/source.cpp
index 6523ea5d62..8737e38757 100644
--- a/src/map/source.cpp
+++ b/src/map/source.cpp
@@ -5,7 +5,7 @@
#include <mbgl/util/constants.hpp>
#include <mbgl/util/raster.hpp>
#include <mbgl/util/string.hpp>
-#include <mbgl/util/texturepool.hpp>
+#include <mbgl/util/texture_pool.hpp>
#include <mbgl/storage/file_source.hpp>
#include <mbgl/util/vec.hpp>
#include <mbgl/util/math.hpp>
@@ -155,7 +155,7 @@ TileData::State Source::addTile(Map& map, uv::worker& worker,
util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
- FileSource& fileSource, Texturepool& texturepool,
+ FileSource& fileSource, TexturePool& texturePool,
const Tile::ID& id,
std::function<void ()> callback) {
const TileData::State state = hasTile(id);
@@ -188,9 +188,9 @@ TileData::State Source::addTile(Map& map, uv::worker& worker,
new_tile.data = std::make_shared<VectorTileData>(normalized_id, map.getMaxZoom(), style,
glyphAtlas, glyphStore,
spriteAtlas, sprite,
- texturepool, info);
+ texturePool, info);
} else if (info.type == SourceType::Raster) {
- new_tile.data = std::make_shared<RasterTileData>(normalized_id, texturepool, info);
+ new_tile.data = std::make_shared<RasterTileData>(normalized_id, texturePool, info);
} else {
throw std::runtime_error("source type not implemented");
}
@@ -286,7 +286,7 @@ void Source::update(Map& map, uv::worker& worker,
util::ptr<Style> style,
GlyphAtlas& glyphAtlas, GlyphStore& glyphStore,
SpriteAtlas& spriteAtlas, util::ptr<Sprite> sprite,
- Texturepool& texturepool, FileSource& fileSource,
+ TexturePool& texturePool, FileSource& fileSource,
std::function<void ()> callback) {
if (!loaded || map.getTime() <= updated)
return;
@@ -310,7 +310,7 @@ void Source::update(Map& map, uv::worker& worker,
const TileData::State state = addTile(map, worker, style,
glyphAtlas, glyphStore,
spriteAtlas, sprite,
- fileSource, texturepool,
+ fileSource, texturePool,
id, callback);
if (state != TileData::State::parsed) {
diff --git a/src/map/tile_parser.cpp b/src/map/tile_parser.cpp
index 4e9c320e36..8f55326787 100644
--- a/src/map/tile_parser.cpp
+++ b/src/map/tile_parser.cpp
@@ -35,7 +35,7 @@ TileParser::TileParser(const std::string &data, VectorTileData &tile_,
GlyphStore & glyphStore_,
SpriteAtlas & spriteAtlas_,
const util::ptr<Sprite> &sprite_,
- Texturepool& texturePool_)
+ TexturePool& texturePool_)
: vector_data(pbf((const uint8_t *)data.data(), data.size())),
tile(tile_),
style(style_),
@@ -119,7 +119,7 @@ std::unique_ptr<Bucket> TileParser::createBucket(util::ptr<StyleBucket> bucket_d
fprintf(stderr, "[WARNING] unknown bucket render type for layer '%s' (source layer '%s')\n", bucket_desc->name.c_str(), bucket_desc->source_layer.c_str());
}
} else if (bucket_desc->render.is<StyleBucketRaster>() && bucket_desc->render.get<StyleBucketRaster>().prerendered == true) {
- return createRasterBucket(texturePool, bucket_desc->render.get<StyleBucketRaster>());
+ return createRasterBucket(bucket_desc->render.get<StyleBucketRaster>());
} else {
// The layer specified in the bucket does not exist. Do nothing.
if (debug::tileParseWarnings) {
@@ -155,8 +155,8 @@ std::unique_ptr<Bucket> TileParser::createFillBucket(const VectorTileLayer& laye
return obsolete() ? nullptr : std::move(bucket);
}
-std::unique_ptr<Bucket> TileParser::createRasterBucket(Texturepool& texturepool, const StyleBucketRaster &raster) {
- std::unique_ptr<RasterBucket> bucket = std::make_unique<RasterBucket>(texturepool, raster);
+std::unique_ptr<Bucket> TileParser::createRasterBucket(const StyleBucketRaster &raster) {
+ std::unique_ptr<RasterBucket> bucket = std::make_unique<RasterBucket>(texturePool, raster);
return obsolete() ? nullptr : std::move(bucket);
}
diff --git a/src/map/vector_tile_data.cpp b/src/map/vector_tile_data.cpp
index 1237e3546b..06782057f6 100644
--- a/src/map/vector_tile_data.cpp
+++ b/src/map/vector_tile_data.cpp
@@ -12,14 +12,14 @@ VectorTileData::VectorTileData(Tile::ID const& id_,
float mapMaxZoom, util::ptr<Style> style_,
GlyphAtlas& glyphAtlas_, GlyphStore& glyphStore_,
SpriteAtlas& spriteAtlas_, util::ptr<Sprite> sprite_,
- Texturepool& texturepool_,
+ TexturePool& texturePool_,
const SourceInfo& source_)
: TileData(id_, source_),
glyphAtlas(glyphAtlas_),
glyphStore(glyphStore_),
spriteAtlas(spriteAtlas_),
sprite(sprite_),
- texturepool(texturepool_),
+ texturePool(texturePool_),
style(style_),
depth(id.z >= source.max_zoom ? mapMaxZoom - id.z : 1) {
}
@@ -41,7 +41,7 @@ void VectorTileData::parse() {
TileParser parser(data, *this, style,
glyphAtlas, glyphStore,
spriteAtlas, sprite,
- texturepool);
+ texturePool);
parser.parse();
} catch (const std::exception& ex) {
#if defined(DEBUG)
diff --git a/src/renderer/raster_bucket.cpp b/src/renderer/raster_bucket.cpp
index 12b2b9e514..85bb66970e 100644
--- a/src/renderer/raster_bucket.cpp
+++ b/src/renderer/raster_bucket.cpp
@@ -3,10 +3,10 @@
using namespace mbgl;
-RasterBucket::RasterBucket(Texturepool& texturepool, const StyleBucketRaster& properties_)
+RasterBucket::RasterBucket(TexturePool& texturePool, const StyleBucketRaster& properties_)
: properties(properties_),
texture(properties_),
- raster(texturepool) {
+ raster(texturePool) {
}
void RasterBucket::render(Painter &painter, util::ptr<StyleLayer> layer_desc, const Tile::ID &id, const mat4 &matrix) {
diff --git a/src/util/raster.cpp b/src/util/raster.cpp
index d6a680c391..66c5c13fea 100644
--- a/src/util/raster.cpp
+++ b/src/util/raster.cpp
@@ -11,13 +11,13 @@
using namespace mbgl;
-Raster::Raster(Texturepool& texturepool_)
- : texturepool(texturepool_)
+Raster::Raster(TexturePool& texturePool_)
+ : texturePool(texturePool_)
{}
Raster::~Raster() {
if (textured) {
- texturepool.removeTextureID(texture);
+ texturePool.removeTextureID(texture);
}
}
@@ -46,7 +46,7 @@ void Raster::bind(bool linear) {
}
if (img && !textured) {
- texture = texturepool.getTextureID();
+ texture = texturePool.getTextureID();
glBindTexture(GL_TEXTURE_2D, texture);
#ifndef GL_ES_VERSION_2_0
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
diff --git a/src/util/texturepool.cpp b/src/util/texture_pool.cpp
index 04511348e9..9c8c24b085 100644
--- a/src/util/texturepool.cpp
+++ b/src/util/texture_pool.cpp
@@ -1,4 +1,4 @@
-#include <mbgl/util/texturepool.hpp>
+#include <mbgl/util/texture_pool.hpp>
#include <vector>
@@ -6,7 +6,7 @@ const int TextureMax = 64;
using namespace mbgl;
-GLuint Texturepool::getTextureID() {
+GLuint TexturePool::getTextureID() {
if (texture_ids.empty()) {
GLuint new_texture_ids[TextureMax];
glGenTextures(TextureMax, new_texture_ids);
@@ -26,7 +26,7 @@ GLuint Texturepool::getTextureID() {
return id;
}
-void Texturepool::removeTextureID(GLuint texture_id) {
+void TexturePool::removeTextureID(GLuint texture_id) {
bool needs_clear = false;
texture_ids.insert(texture_id);
@@ -41,7 +41,7 @@ void Texturepool::removeTextureID(GLuint texture_id) {
}
}
-void Texturepool::clearTextureIDs() {
+void TexturePool::clearTextureIDs() {
std::vector<GLuint> ids_to_remove;
ids_to_remove.reserve(texture_ids.size());