summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2014-10-22 15:14:21 +0200
committerKonstantin Käfer <mail@kkaefer.com>2014-10-22 15:14:21 +0200
commit905c4294be495d15591885a2438ca0b8abc8decf (patch)
tree851a94849eb7a1f3269b91de6054846cfbda722b /include
parentc6e4cf2f80216c7139b6587dcd6d919080aef20d (diff)
parent8954b3971f5cb90dc4b18e61b58ea6e41c54fffe (diff)
downloadqtlocation-mapboxgl-905c4294be495d15591885a2438ca0b8abc8decf.tar.gz
Merge branch 'libuv-0.10-headless-display' into mason
Conflicts: common/http_request_baton_curl.cpp include/mbgl/map/map.hpp include/mbgl/util/uv_detail.hpp scripts/travis_before_install.sh setup-libraries.sh src/map/map.cpp src/storage/file_request_baton.cpp src/storage/http_request.cpp src/util/uv-messenger.c
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/map.hpp3
-rw-r--r--include/mbgl/map/view.hpp8
-rw-r--r--include/mbgl/renderer/painter.hpp2
-rw-r--r--include/mbgl/style/class_dictionary.hpp13
4 files changed, 17 insertions, 9 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index bea82e6b4c..ab9775a8c9 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -63,6 +63,9 @@ public:
// Triggers a cleanup that releases resources.
void cleanup();
+ // Releases resources immediately
+ void terminate();
+
// Controls buffer swapping.
bool needsSwap();
void swapped();
diff --git a/include/mbgl/map/view.hpp b/include/mbgl/map/view.hpp
index bbdcd97c79..b567cd424f 100644
--- a/include/mbgl/map/view.hpp
+++ b/include/mbgl/map/view.hpp
@@ -35,11 +35,9 @@ public:
// renderer setup since the render thread doesn't switch the contexts.
virtual void make_active() = 0;
- // Returns the base framebuffer object, if any, and 0 if using the system
- // provided framebuffer.
- virtual unsigned int root_fbo() {
- return 0;
- }
+ // Called from the render thread. Makes the GL context inactive in the current
+ // thread. This is called once just before the rendering thread terminates.
+ virtual void make_inactive() = 0;
virtual void notify() = 0;
diff --git a/include/mbgl/renderer/painter.hpp b/include/mbgl/renderer/painter.hpp
index 13c2050bd0..0f9bd79173 100644
--- a/include/mbgl/renderer/painter.hpp
+++ b/include/mbgl/renderer/painter.hpp
@@ -64,6 +64,7 @@ public:
// lazy initialization) in case rendering continues.
void cleanup();
+ void terminate();
// Renders the backdrop of the OpenGL view. This also paints in areas where we don't have any
// tiles whatsoever.
@@ -124,6 +125,7 @@ public:
private:
void setupShaders();
+ void deleteShaders();
mat4 translatedMatrix(const mat4& matrix, const std::array<float, 2> &translation, const Tile::ID &id, TranslateAnchorType anchor);
void prepareTile(const Tile& tile);
diff --git a/include/mbgl/style/class_dictionary.hpp b/include/mbgl/style/class_dictionary.hpp
index c7f9c6a284..ecf80be3e3 100644
--- a/include/mbgl/style/class_dictionary.hpp
+++ b/include/mbgl/style/class_dictionary.hpp
@@ -14,17 +14,22 @@ enum class ClassID : uint32_t {
};
class ClassDictionary {
+private:
+ ClassDictionary();
+
public:
+ static ClassDictionary &Get();
+
// Returns an ID for a class name. If the class name does not yet have an ID, one is
// auto-generated and stored for future reference.
- static ClassID Lookup(const std::string &class_name);
+ ClassID lookup(const std::string &class_name);
// Returns either Fallback, Default or Named, depending on the type of the class id.
- static ClassID Normalize(ClassID id);
+ ClassID normalize(ClassID id);
private:
- static std::unordered_map<std::string, ClassID> store;
- static uint32_t offset;
+ std::unordered_map<std::string, ClassID> store = { { "", ClassID::Default } };
+ uint32_t offset = 0;
};
}