Use a shared scheduler on threads without a default scheduler
Render threads won't have a scheduler, so we create one that is shared by all the maps rendering at this thread. The bad side effect of this is that we need to wake up the render thread to process events. Mapbox GL should get rid of processing events on the render thread. This solution is a workaround.
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
|
||||
namespace mbgl {
|
||||
class Renderer;
|
||||
@@ -23,7 +22,7 @@ class UpdateParameters;
|
||||
|
||||
class QMapboxGLRendererBackend;
|
||||
|
||||
class QMapboxGLMapRenderer : public QObject, public mbgl::Scheduler
|
||||
class QMapboxGLMapRenderer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -32,9 +31,6 @@ public:
|
||||
mbgl::ThreadPool &, QMapboxGLSettings::GLContextMode);
|
||||
virtual ~QMapboxGLMapRenderer();
|
||||
|
||||
// mbgl::Scheduler implementation.
|
||||
void schedule(std::weak_ptr<mbgl::Mailbox> scheduled) final;
|
||||
|
||||
void render();
|
||||
void updateFramebuffer(quint32 fbo, const mbgl::Size &size);
|
||||
void setObserver(std::shared_ptr<mbgl::RendererObserver>);
|
||||
@@ -56,8 +52,5 @@ private:
|
||||
QMapboxGLRendererBackend m_backend;
|
||||
std::unique_ptr<mbgl::Renderer> m_renderer;
|
||||
|
||||
std::mutex m_taskQueueMutex;
|
||||
std::queue<std::weak_ptr<mbgl::Mailbox>> m_taskQueue;
|
||||
|
||||
bool m_threadWithScheduler;
|
||||
bool m_forceScheduler;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user