summaryrefslogtreecommitdiff
path: root/include/mbgl/map/map.hpp
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2015-09-01 15:07:17 +0300
committerJohn Firebaugh <john.firebaugh@gmail.com>2016-04-14 13:44:08 -0700
commit204c7fee032bf8509747046b43a788366a189ae7 (patch)
tree8719b7ab8838bea52babd8bf42f2234ddc43dc9a /include/mbgl/map/map.hpp
parent18d8e80f52345a13236ae1da99b5866e7643f85b (diff)
downloadqtlocation-mapboxgl-204c7fee032bf8509747046b43a788366a189ae7.tar.gz
[core] Render from the main thread
Do not create a thread for the MapContext anymore.
Diffstat (limited to 'include/mbgl/map/map.hpp')
-rw-r--r--include/mbgl/map/map.hpp19
1 files changed, 4 insertions, 15 deletions
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 9d586d8b8a..b70c388183 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -32,10 +32,6 @@ class ShapeAnnotation;
struct CameraOptions;
struct AnimationOptions;
-namespace util {
-template <class T> class Thread;
-} // namespace util
-
class Map : private util::noncopyable {
friend class View;
@@ -46,22 +42,15 @@ public:
ConstrainMode constrainMode = ConstrainMode::HeightOnly);
~Map();
- // Pauses the render thread. The render thread will stop running but will not be terminated and will not lose state until resumed.
- void pause();
- bool isPaused();
-
- // Resumes a paused render thread
- void resume();
-
// Register a callback that will get called (on the render thread) when all resources have
// been loaded and a complete render occurs.
using StillImageCallback = std::function<void (std::exception_ptr, PremultipliedImage&&)>;
void renderStill(StillImageCallback callback);
- // Triggers a synchronous render.
- void renderSync();
+ // Main render function.
+ void render();
- // Notifies the Map thread that the state has changed and an update might be necessary.
+ // Notifies the Map that the state has changed and an update might be necessary.
void update(Update update);
// Styling
@@ -189,7 +178,7 @@ public:
private:
View& view;
const std::unique_ptr<Transform> transform;
- const std::unique_ptr<util::Thread<MapContext>> context;
+ const std::unique_ptr<MapContext> context;
MapData* data;
enum class RenderState {