diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-09-01 15:07:17 +0300 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-04-14 13:44:08 -0700 |
commit | 204c7fee032bf8509747046b43a788366a189ae7 (patch) | |
tree | 8719b7ab8838bea52babd8bf42f2234ddc43dc9a /include/mbgl/platform | |
parent | 18d8e80f52345a13236ae1da99b5866e7643f85b (diff) | |
download | qtlocation-mapboxgl-204c7fee032bf8509747046b43a788366a189ae7.tar.gz |
[core] Render from the main thread
Do not create a thread for the MapContext anymore.
Diffstat (limited to 'include/mbgl/platform')
-rw-r--r-- | include/mbgl/platform/default/glfw_view.hpp | 5 | ||||
-rw-r--r-- | include/mbgl/platform/default/headless_view.hpp | 19 |
2 files changed, 7 insertions, 17 deletions
diff --git a/include/mbgl/platform/default/glfw_view.hpp b/include/mbgl/platform/default/glfw_view.hpp index 802f61b0c0..74a545d31b 100644 --- a/include/mbgl/platform/default/glfw_view.hpp +++ b/include/mbgl/platform/default/glfw_view.hpp @@ -22,13 +22,10 @@ public: std::array<uint16_t, 2> getSize() const override; std::array<uint16_t, 2> getFramebufferSize() const override; - void initialize(mbgl::Map *map) override; + void initialize(mbgl::Map*) override; void activate() override; void deactivate() override; - void notify() override; void invalidate() override; - void beforeRender() override; - void afterRender() override; static void onKey(GLFWwindow *window, int key, int scancode, int action, int mods); static void onScroll(GLFWwindow *window, double xoffset, double yoffset); diff --git a/include/mbgl/platform/default/headless_view.hpp b/include/mbgl/platform/default/headless_view.hpp index edaa08d01d..9fbbdfd206 100644 --- a/include/mbgl/platform/default/headless_view.hpp +++ b/include/mbgl/platform/default/headless_view.hpp @@ -38,34 +38,31 @@ public: std::array<uint16_t, 2> getSize() const override; std::array<uint16_t, 2> getFramebufferSize() const override; + void invalidate() override; void activate() override; void deactivate() override; - void notify() override; - void invalidate() override; - void beforeRender() override; - void afterRender() override; + PremultipliedImage readStillImage() override; - void resizeFramebuffer(); void resize(uint16_t width, uint16_t height); private: - void loadExtensions(); - bool isActive() const; - // Implementation specific functions static gl::glProc initializeExtension(const char*); void createContext(); void destroyContext(); void clearBuffers(); + void resizeFramebuffer(); void activateContext(); void deactivateContext(); -private: std::shared_ptr<HeadlessDisplay> display; const float pixelRatio; std::array<uint16_t, 2> dimensions; + bool needsResize = false; + bool extensionsLoaded = false; + bool active = false; #if MBGL_USE_CGL CGLContextObj glContext = nullptr; @@ -82,13 +79,9 @@ private: GLXPbuffer glxPbuffer = 0; #endif - bool extensionsLoaded = false; - GLuint fbo = 0; GLuint fboDepthStencil = 0; GLuint fboColor = 0; - - std::thread::id thread; }; } // namespace mbgl |