WaylandBaseWindowSystem(const char* displayname, int width, int height, Scene* pScene, InputManager* pInputManager);
virtual ~WaylandBaseWindowSystem();
bool init(BaseGraphicSystem<void*, void*>* sys);
- bool start();
+ bool start(int maxIterationDurationInMS);
void stop();
void signalRedrawEvent();
void wakeUpRendererThread();
struct wl_list m_listFrameCallback;
struct wl_list m_nativeSurfaceList;
+ int m_maxIterationDurationInMS;
+
void createServerinfo(WaylandBaseWindowSystem* windowSystem);
struct native_surface* createNativeSurface();
void postReleaseBuffer(struct wl_buffer *buffer);
return false;
}
- mThreadId = renderThread;
while (false == m_initialized)
{
usleep(10000); // TODO
return m_success;
}
-bool WaylandBaseWindowSystem::start()
+bool WaylandBaseWindowSystem::start(int maxIterationDurationInMS)
{
+ m_maxIterationDurationInMS = maxIterationDurationInMS;
bool result = true;
LOG_DEBUG("WaylandBaseWindowSystem", "Starting / Creating thread");
// let thread actually run
{
public:
WaylandGLESRenderer(ICommandExecutor& executor, Configuration& config);
- bool start(int, int, const char*);
+ bool start(int, int, const char*, int);
void stop();
void doScreenShot(std::string fileToSave);
void doScreenShotOfLayer(std::string fileToSave, uint id);
virtual bool getOptimizationMode(OptimizationType id, OptimizationModeType *mode);
// from PluginBase
- virtual HealthCondition pluginGetHealth();
+ virtual int getIterationCounter();
// implement in inheriting classes
virtual WaylandBaseWindowSystem* getWindowSystem(const char* displayname) = 0;
LOG_DEBUG("WaylandGLESRenderer", "Creating Renderer");
}
-bool WaylandGLESRenderer::start(int width, int height, const char* displayname)
+bool WaylandGLESRenderer::start(int width, int height, const char* displayname, int maxIterationDurationInMS)
{
struct wl_display* nativeDisplayHandle = NULL;
EGLDisplay eglDisplayhandle = NULL;
{
m_pGraphicSystem->setTextureBinder(m_binder);
- if (!m_pWindowSystem->start())
+ if (!m_pWindowSystem->start(maxIterationDurationInMS))
{
goto fail; // TODO bad style
}
return m_pGraphicSystem->getOptimizationMode(id, mode);
}
-HealthCondition WaylandGLESRenderer::pluginGetHealth()
-{
- return BaseRenderer::pluginGetHealth();
-}
-
Shader* WaylandGLESRenderer::createShader(const string* vertexName, const string* fragmentName)
{
Shader *result = NULL;
m_pWindowSystem->setSystemState(IDLE_STATE);
return result;
}
+
+int WaylandGLESRenderer::getIterationCounter()
+{
+ // TODO: add real thread iteration counter here
+ // The renderer plugin thread must wake up at least once in
+ // each health monitoring interval. This interval is passed
+ // to the plugin as argument in its start() method.
+ // Each time the plugin thread gets active, it must
+ // increment the internal iteration counter.
+ // This way the health monitor can detect, if the plugin
+ // thread is running, dead or blocked.
+
+ // TODO: remove this placeholder, which just returns an
+ // incremented interation counter to make health monitoring happy.
+ static int iteration = 0;
+ return ++iteration;
+}