summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-04-20 18:28:10 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-04-28 14:32:22 -0400
commit75ae956b0e598685117f7f72231677d8841cbea3 (patch)
tree0aadbd3927d2ff5f57a7da8710ef644acaa4ba5b /include
parent32c818feea8af1a355c661978694382245854413 (diff)
downloadqtlocation-mapboxgl-75ae956b0e598685117f7f72231677d8841cbea3.tar.gz
WIP: Use Thread<MapContext>
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/map/environment.hpp3
-rw-r--r--include/mbgl/map/map.hpp12
2 files changed, 7 insertions, 8 deletions
diff --git a/include/mbgl/map/environment.hpp b/include/mbgl/map/environment.hpp
index a00fb24454..07554a7a92 100644
--- a/include/mbgl/map/environment.hpp
+++ b/include/mbgl/map/environment.hpp
@@ -62,9 +62,6 @@ private:
std::vector<uint32_t> abandonedVAOs;
std::vector<uint32_t> abandonedBuffers;
std::vector<uint32_t> abandonedTextures;
-
-public:
- uv_loop_t* const loop;
};
class EnvironmentScope final {
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 07e6b65e16..b217a685f9 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -27,6 +27,10 @@ class MapData;
class MapContext;
class StillImage;
+namespace util {
+template <class T> class Thread;
+}
+
class Map : private util::noncopyable {
friend class View;
@@ -55,6 +59,7 @@ public:
// Triggers a synchronous or asynchronous render.
void renderSync();
+ void renderAsync();
// Notifies the Map thread that the state has changed and an update might be necessary.
void update();
@@ -139,10 +144,7 @@ public:
bool getDebug() const;
private:
- // Runs the map event loop. ONLY run this function when you want to get render a single frame
- // with this map object. It will *not* spawn a separate thread and instead block until the
- // frame is completely rendered.
- void run();
+ void triggerUpdate(Update update = Update::Nothing);
// This may only be called by the View object.
void resize(uint16_t width, uint16_t height, float ratio = 1);
@@ -152,7 +154,7 @@ private:
std::unique_ptr<EnvironmentScope> scope;
View &view;
const std::unique_ptr<MapData> data;
- std::unique_ptr<MapContext> context;
+ std::unique_ptr<util::Thread<MapContext>> context;
};
}