summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2014-08-29 15:43:13 -0400
committerMike Morris <michael.patrick.morris@gmail.com>2014-08-29 15:43:13 -0400
commita8021e84f876c52b5da7428a019cb062e5f80537 (patch)
treef9b4f8db311c040696c2545ca814df2af53b23e8 /include
parentcffd68f9cabb69491ff8f2c43c680f6b345b25be (diff)
parenteb1fbc542b8d8b90d17e9e76f98d7b021b449c7b (diff)
downloadqtlocation-mapboxgl-a8021e84f876c52b5da7428a019cb062e5f80537.tar.gz
Merge branch 'master' into libuv010
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/geometry/glyph_atlas.hpp3
-rw-r--r--include/mbgl/geometry/sprite_atlas.hpp3
-rw-r--r--include/mbgl/platform/event.hpp1
-rw-r--r--include/mbgl/renderer/painter.hpp23
-rw-r--r--include/mbgl/style/property_key.hpp1
-rw-r--r--include/mbgl/style/style.hpp3
-rw-r--r--include/mbgl/style/style_properties.hpp3
-rw-r--r--include/mbgl/text/glyph.hpp6
8 files changed, 29 insertions, 14 deletions
diff --git a/include/mbgl/geometry/glyph_atlas.hpp b/include/mbgl/geometry/glyph_atlas.hpp
index 07011d324e..8df9fd0f73 100644
--- a/include/mbgl/geometry/glyph_atlas.hpp
+++ b/include/mbgl/geometry/glyph_atlas.hpp
@@ -3,6 +3,7 @@
#include <mbgl/geometry/binpack.hpp>
#include <mbgl/text/glyph_store.hpp>
+#include <mbgl/util/noncopyable.hpp>
#include <string>
#include <set>
@@ -12,7 +13,7 @@
namespace mbgl {
-class GlyphAtlas {
+class GlyphAtlas : public util::noncopyable {
public:
private:
diff --git a/include/mbgl/geometry/sprite_atlas.hpp b/include/mbgl/geometry/sprite_atlas.hpp
index c30499a53d..36f0f338ea 100644
--- a/include/mbgl/geometry/sprite_atlas.hpp
+++ b/include/mbgl/geometry/sprite_atlas.hpp
@@ -2,6 +2,7 @@
#define MBGL_GEOMETRY_SPRITE_ATLAS
#include <mbgl/geometry/binpack.hpp>
+#include <mbgl/util/noncopyable.hpp>
#include <string>
#include <map>
@@ -14,7 +15,7 @@ namespace mbgl {
class Sprite;
class SpritePosition;
-class SpriteAtlas {
+class SpriteAtlas : public util::noncopyable {
public:
typedef uint16_t dimension;
diff --git a/include/mbgl/platform/event.hpp b/include/mbgl/platform/event.hpp
index 1676f40d2c..1befd0af3b 100644
--- a/include/mbgl/platform/event.hpp
+++ b/include/mbgl/platform/event.hpp
@@ -59,6 +59,7 @@ constexpr EventSeverity disabledEventSeverities[] = {
#if !DEBUG
EventSeverity::Debug,
#endif
+ EventSeverity(-1) // Avoid zero size array
};
diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp
index fcbafc52d5..a8fe62b550 100644
--- a/include/mbgl/renderer/painter.hpp
+++ b/include/mbgl/renderer/painter.hpp
@@ -81,11 +81,12 @@ public:
void renderDebugText(DebugBucket& bucket, const mat4 &matrix);
void renderDebugText(const std::vector<std::string> &strings);
- void renderFill(FillBucket& bucket, const FillProperties& properties, const Tile::ID& id, const mat4 &matrix);
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);
+
std::array<float, 3> spinWeights(float spin_value);
void preparePrerender(RasterBucket &bucket);
@@ -118,7 +119,7 @@ public:
bool needsAnimation() const;
private:
void setupShaders();
- const mat4 &translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor = TranslateAnchorType::Map);
+ mat4 translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor = TranslateAnchorType::Map);
void prepareTile(const Tile& tile);
@@ -129,7 +130,6 @@ public:
void depthRange(float near, float far);
public:
- mat4 vtxMatrix;
mat4 projMatrix;
mat4 nativeMatrix;
mat4 extrudeMatrix;
@@ -142,11 +142,15 @@ public:
return flipMatrix;
}();
+ const mat4 identityMatrix = []{
+ mat4 identity;
+ matrix::identity(identity);
+ return identity;
+ }();
+
private:
Map& map;
- FrameHistory frameHistory;
-
bool debug = false;
uint32_t gl_program = 0;
@@ -159,6 +163,8 @@ private:
const float strata_epsilon = 1.0f / (1 << 16);
public:
+ FrameHistory frameHistory;
+
std::unique_ptr<PlainShader> plainShader;
std::unique_ptr<OutlineShader> outlineShader;
std::unique_ptr<LineShader> lineShader;
@@ -170,6 +176,13 @@ public:
std::unique_ptr<DotShader> dotShader;
std::unique_ptr<GaussianShader> gaussianShader;
+ StaticVertexBuffer backgroundBuffer = {
+ { -1, -1 }, { 1, -1 },
+ { -1, 1 }, { 1, 1 }
+ };
+
+ VertexArrayObject backgroundArray;
+
// Set up the stencil quad we're using to generate the stencil mask.
StaticVertexBuffer tileStencilBuffer = {
// top left triangle
diff --git a/include/mbgl/style/property_key.hpp b/include/mbgl/style/property_key.hpp
index ec68ea991e..28aa800607 100644
--- a/include/mbgl/style/property_key.hpp
+++ b/include/mbgl/style/property_key.hpp
@@ -60,6 +60,7 @@ enum class PropertyKey {
RasterContrast,
RasterFade,
+ BackgroundOpacity,
BackgroundColor
};
diff --git a/include/mbgl/style/style.hpp b/include/mbgl/style/style.hpp
index 6acb5d0cb8..c09de6ebba 100644
--- a/include/mbgl/style/style.hpp
+++ b/include/mbgl/style/style.hpp
@@ -20,7 +20,6 @@ namespace mbgl {
class Sprite;
class StyleLayer;
class StyleLayerGroup;
-struct BackgroundProperties;
class Style {
public:
@@ -47,8 +46,6 @@ public:
bool hasTransitions() const;
- const BackgroundProperties &getBackgroundProperties() const;
-
const std::string &getSpriteURL() const;
public:
diff --git a/include/mbgl/style/style_properties.hpp b/include/mbgl/style/style_properties.hpp
index bbe8812bc7..20200a0dd7 100644
--- a/include/mbgl/style/style_properties.hpp
+++ b/include/mbgl/style/style_properties.hpp
@@ -61,7 +61,7 @@ struct SymbolProperties {
struct {
float opacity = 1.0f;
- float size = 12.0f;
+ float size = 16.0f;
Color color = {{ 0, 0, 0, 1 }};
Color halo_color = {{ 0, 0, 0, 0 }};
float halo_width = 0.0f;
@@ -92,6 +92,7 @@ struct RasterProperties {
struct BackgroundProperties {
inline BackgroundProperties() {}
+ float opacity = 1.0f;
Color color = {{ 0, 0, 0, 1 }};
};
diff --git a/include/mbgl/text/glyph.hpp b/include/mbgl/text/glyph.hpp
index 38f9e116ab..de7f55bdc6 100644
--- a/include/mbgl/text/glyph.hpp
+++ b/include/mbgl/text/glyph.hpp
@@ -46,12 +46,12 @@ typedef std::map<uint32_t, Glyph> GlyphPositions;
class PositionedGlyph {
public:
- inline explicit PositionedGlyph(uint32_t glyph, uint32_t x, uint32_t y)
+ inline explicit PositionedGlyph(uint32_t glyph, float x, float y)
: glyph(glyph), x(x), y(y) {}
uint32_t glyph = 0;
- int32_t x = 0;
- int32_t y = 0;
+ float x = 0;
+ float y = 0;
};
typedef std::vector<PositionedGlyph> Shaping;