From: SooChan Lim Date: Fri, 21 Aug 2020 05:28:34 +0000 (+0900) Subject: DSRenderEngineDaliImpl: register WindowDestroyed callback of window object X-Git-Tag: accepted/tizen/unified/20200827.105812~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0742373162b5525cbb5c19f302bb47b768755a87;p=platform%2Fcore%2Fuifw%2Flibds.git DSRenderEngineDaliImpl: register WindowDestroyed callback of window object need to kick the Dali Renderer when the window is destroyed. Change-Id: I4547baf37dda4863780f1f3d1490641376ba4a76 --- diff --git a/src/DSRender/DSRenderEngineDaliImpl.cpp b/src/DSRender/DSRenderEngineDaliImpl.cpp index 1ab9f6c..082e815 100644 --- a/src/DSRender/DSRenderEngineDaliImpl.cpp +++ b/src/DSRender/DSRenderEngineDaliImpl.cpp @@ -62,16 +62,20 @@ std::shared_ptr DSRenderEngineDaliImpl::makeRenderView(std::shared // callbacks window->registerCallbackBufferChanged(this, std::bind(&DSRenderEngineDaliImpl::__onWindowUpdated, this, std::placeholders::_1)); + window->registerCallbackWindowDestroyed(this, std::bind(&DSRenderEngineDaliImpl::__onWindowDestroyed, this, std::placeholders::_1)); return renderView; } bool DSRenderEngineDaliImpl::renderFrame() { - if (__needToRender) + if (__needToRender) { Adaptor::Get().RenderOnce(); + DSLOG_DBG("DSRenderEngineDaliImpl", "RENDER RENDER RENDER~!!!!"); + } __needToRender = false; + return true; } @@ -83,4 +87,16 @@ void DSRenderEngineDaliImpl::__onWindowUpdated(std::shared_ptr buffer } } +void DSRenderEngineDaliImpl::__onWindowDestroyed(void *data) +{ + if (!__needToRender) { + DSLOG_DBG("DSRenderEngineDaliImpl", "Window destroyed!!"); + // TODO: update twice, at this time and at idle handler. + // do not update a frame only once.. + // NEED to check why dali does not update a frame at this time by execute one RenderOnce call. + Adaptor::Get().RenderOnce(); + __needToRender = true; + } +} + } // namespace display_server diff --git a/src/DSRender/DSRenderEngineDaliImpl.h b/src/DSRender/DSRenderEngineDaliImpl.h index d9244f7..2cbdc7b 100644 --- a/src/DSRender/DSRenderEngineDaliImpl.h +++ b/src/DSRender/DSRenderEngineDaliImpl.h @@ -48,6 +48,7 @@ public: private: void __onWindowUpdated(std::shared_ptr buffer); + void __onWindowDestroyed(void *data); std::shared_ptr __bufferQueue; Dali::OffscreenApplication __offscreenApplication;