summaryrefslogtreecommitdiff
path: root/include/mbgl/renderer
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-09-16 16:38:32 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-09-24 16:14:09 +0200
commitf26bb724dc164b69b5358f30c6248fdf5cbd076b (patch)
tree4c719a97ff02c86a22bcdcec6fc0f781c3bcd3e9 /include/mbgl/renderer
parent6c526e56370a0f4dee9a4b6ed45489fcb14e3ff1 (diff)
downloadqtlocation-mapboxgl-f26bb724dc164b69b5358f30c6248fdf5cbd076b.tar.gz
use util::ptr as a wrapper around std::shared_ptr that asserts nonemptiness
Diffstat (limited to 'include/mbgl/renderer')
-rw-r--r--include/mbgl/renderer/bucket.hpp6
-rw-r--r--include/mbgl/renderer/debug_bucket.hpp3
-rw-r--r--include/mbgl/renderer/fill_bucket.hpp2
-rw-r--r--include/mbgl/renderer/line_bucket.hpp5
-rw-r--r--include/mbgl/renderer/painter.hpp17
-rw-r--r--include/mbgl/renderer/raster_bucket.hpp4
-rw-r--r--include/mbgl/renderer/symbol_bucket.hpp2
7 files changed, 19 insertions, 20 deletions
diff --git a/include/mbgl/renderer/bucket.hpp b/include/mbgl/renderer/bucket.hpp
index 1391f6e3e3..696bfb1110 100644
--- a/include/mbgl/renderer/bucket.hpp
+++ b/include/mbgl/renderer/bucket.hpp
@@ -1,11 +1,11 @@
#ifndef MBGL_RENDERER_BUCKET
#define MBGL_RENDERER_BUCKET
-#include <string>
-#include <memory>
#include <mbgl/map/tile.hpp>
#include <mbgl/util/noncopyable.hpp>
+#include <string>
+
namespace mbgl {
class Painter;
@@ -13,7 +13,7 @@ class StyleLayer;
class Bucket : private util::noncopyable {
public:
- virtual void render(Painter& painter, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix) = 0;
+ virtual void render(Painter& painter, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix) = 0;
virtual bool hasData() const = 0;
virtual ~Bucket() {}
diff --git a/include/mbgl/renderer/debug_bucket.hpp b/include/mbgl/renderer/debug_bucket.hpp
index 660b7fcba8..fb6cfb4cae 100644
--- a/include/mbgl/renderer/debug_bucket.hpp
+++ b/include/mbgl/renderer/debug_bucket.hpp
@@ -6,7 +6,6 @@
#include <mbgl/geometry/vao.hpp>
#include <vector>
-#include <memory>
#ifndef BUFFER_OFFSET
#define BUFFER_OFFSET(i) ((char *)nullptr + (i))
@@ -20,7 +19,7 @@ class DebugBucket : public Bucket {
public:
DebugBucket(DebugFontBuffer& fontBuffer);
- virtual void render(Painter& painter, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ virtual void render(Painter& painter, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
virtual bool hasData() const;
void drawLines(PlainShader& shader);
diff --git a/include/mbgl/renderer/fill_bucket.hpp b/include/mbgl/renderer/fill_bucket.hpp
index 15868e4092..ae766ec28d 100644
--- a/include/mbgl/renderer/fill_bucket.hpp
+++ b/include/mbgl/renderer/fill_bucket.hpp
@@ -44,7 +44,7 @@ public:
const StyleBucketFill& properties);
~FillBucket();
- virtual void render(Painter& painter, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ virtual void render(Painter& painter, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
virtual bool hasData() const;
void addGeometry(pbf& data);
diff --git a/include/mbgl/renderer/line_bucket.hpp b/include/mbgl/renderer/line_bucket.hpp
index 8babb734ed..7337ca80ad 100644
--- a/include/mbgl/renderer/line_bucket.hpp
+++ b/include/mbgl/renderer/line_bucket.hpp
@@ -1,13 +1,12 @@
#ifndef MBGL_RENDERER_LINEBUCKET
#define MBGL_RENDERER_LINEBUCKET
-#include "bucket.hpp"
+#include <mbgl/renderer/bucket.hpp>
#include <mbgl/geometry/vao.hpp>
#include <mbgl/geometry/elements_buffer.hpp>
#include <mbgl/geometry/line_buffer.hpp>
#include <mbgl/style/style_bucket.hpp>
-#include <memory>
#include <vector>
namespace mbgl {
@@ -30,7 +29,7 @@ public:
PointElementsBuffer& pointElementsBuffer,
const StyleBucketLine& properties);
- virtual void render(Painter& painter, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ virtual void render(Painter& painter, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
virtual bool hasData() const;
void addGeometry(pbf& data);
diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp
index 75529d1136..13c2050bd0 100644
--- a/include/mbgl/renderer/painter.hpp
+++ b/include/mbgl/renderer/painter.hpp
@@ -22,6 +22,7 @@
#include <mbgl/shader/gaussian_shader.hpp>
#include <mbgl/map/transform_state.hpp>
+#include <mbgl/util/ptr.hpp>
#include <map>
#include <unordered_map>
@@ -72,7 +73,7 @@ public:
void changeMatrix();
// Renders a particular layer from a tile.
- void renderTileLayer(const Tile& tile, std::shared_ptr<StyleLayer> layer_desc, const mat4 &matrix);
+ void renderTileLayer(const Tile& tile, util::ptr<StyleLayer> layer_desc, const mat4 &matrix);
// Renders debug information for a tile.
void renderTileDebug(const Tile& tile);
@@ -82,11 +83,11 @@ public:
void renderDebugText(DebugBucket& bucket, const mat4 &matrix);
void renderDebugText(const std::vector<std::string> &strings);
- void renderFill(FillBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
- void renderLine(LineBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
- void renderSymbol(SymbolBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
- void renderRaster(RasterBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
- void renderBackground(std::shared_ptr<StyleLayer> layer_desc);
+ void renderFill(FillBucket& bucket, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ void renderLine(LineBucket& bucket, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ void renderSymbol(SymbolBucket& bucket, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ void renderRaster(RasterBucket& bucket, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ void renderBackground(util::ptr<StyleLayer> layer_desc);
float saturationFactor(float saturation);
float contrastFactor(float contrast);
@@ -96,7 +97,7 @@ public:
void renderPrerenderedTexture(RasterBucket &bucket, const mat4 &matrix, const RasterProperties& properties);
- void createPrerendered(RasterBucket& bucket, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id);
+ void createPrerendered(RasterBucket& bucket, util::ptr<StyleLayer> layer_desc, const Tile::ID& id);
void resize();
@@ -110,7 +111,7 @@ public:
// Configures the painter strata that is used for early z-culling of fragments.
void setStrata(float strata);
- void drawClippingMasks(const std::set<std::shared_ptr<StyleSource>> &sources);
+ void drawClippingMasks(const std::set<util::ptr<StyleSource>> &sources);
void drawClippingMask(const mat4& matrix, const ClipID& clip);
void resetFramebuffer();
diff --git a/include/mbgl/renderer/raster_bucket.hpp b/include/mbgl/renderer/raster_bucket.hpp
index 66cceac8e7..794da3b143 100644
--- a/include/mbgl/renderer/raster_bucket.hpp
+++ b/include/mbgl/renderer/raster_bucket.hpp
@@ -16,9 +16,9 @@ class VertexArrayObject;
class RasterBucket : public Bucket {
public:
- RasterBucket(const std::shared_ptr<Texturepool> &texturepool, const StyleBucketRaster& properties);
+ RasterBucket(const util::ptr<Texturepool> &texturepool, const StyleBucketRaster& properties);
- virtual void render(Painter& painter, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
+ virtual void render(Painter& painter, util::ptr<StyleLayer> layer_desc, const Tile::ID& id, const mat4 &matrix);
virtual bool hasData() const;
bool setImage(const std::string &data);
diff --git a/include/mbgl/renderer/symbol_bucket.hpp b/include/mbgl/renderer/symbol_bucket.hpp
index c71d276456..42682401ef 100644
--- a/include/mbgl/renderer/symbol_bucket.hpp
+++ b/include/mbgl/renderer/symbol_bucket.hpp
@@ -56,7 +56,7 @@ class SymbolBucket : public Bucket {
public:
SymbolBucket(const StyleBucketSymbol &properties, Collision &collision);
- virtual void render(Painter &painter, std::shared_ptr<StyleLayer> layer_desc, const Tile::ID &id, const mat4 &matrix);
+ virtual void render(Painter &painter, util::ptr<StyleLayer> layer_desc, const Tile::ID &id, const mat4 &matrix);
virtual bool hasData() const;
virtual bool hasTextData() const;
virtual bool hasIconData() const;