DSRenderViewDaliImpl::DSRenderViewDaliImpl(std::shared_ptr<DSWindow> window, Dali::OffscreenWindow offscreenWindow)
: __window(window),
- __offscreenWindow(offscreenWindow),
- __windowDestroyed(false)
+ __offscreenWindow(offscreenWindow)
{
std::string fragmentShader = "#extension GL_OES_EGL_image_external:require\n";
fragmentShader += FRAGMENT_SHADER;
offscreenWindow.Add(__textureViewActor);
// callbacks
- window->registerCallbackWindowDestroyed(this, std::bind(&DSRenderViewDaliImpl::__onWindowDestroyed, this, std::placeholders::_1));
window->registerCallbackBufferChanged(this, std::bind(&DSRenderViewDaliImpl::__onWindowBufferChanged, this, std::placeholders::_1));
window->registerCallbackWindowRaiseToTop(this, std::bind(&DSRenderViewDaliImpl::__onWindowRaiseToTopChanged, this, std::placeholders::_1));
window->registerCallbackWindowLowerToBottom(this, std::bind(&DSRenderViewDaliImpl::__onWindowLowerToBottomChanged, this, std::placeholders::_1));
DSRenderViewDaliImpl::~DSRenderViewDaliImpl()
{
- if (!__windowDestroyed) {
- __textureViewActor.RemoveRenderer(__renderer);
- __offscreenWindow.Remove(__textureViewActor);
- }
+ __textureViewActor.RemoveRenderer(__renderer);
+ __offscreenWindow.Remove(__textureViewActor);
}
bool DSRenderViewDaliImpl::setBuffer(std::shared_ptr<IDSBuffer> buffer)
__updatedSignal.connect(slot, func);
}
-void DSRenderViewDaliImpl::__onWindowDestroyed(void *data)
-{
- DSLOG_INF("DSRenderViewDaliImpl", "__onWindowDestroyed.");
-
- __textureViewActor.RemoveRenderer(__renderer);
- __offscreenWindow.Remove(__textureViewActor);
-
- __windowDestroyed = true;
-
- __updatedSignal.emit(nullptr);
-}
-
void DSRenderViewDaliImpl::__onWindowBufferChanged(std::shared_ptr<IDSBuffer> buffer)
{
if (buffer) {
Dali::Geometry CreateTexturedQuad();
private:
- void __onWindowDestroyed(void *data);
void __onWindowBufferChanged(std::shared_ptr<IDSBuffer> buffer);
void __onWindowRaiseToTopChanged(void *data);
void __onWindowLowerToBottomChanged(void *data);
Dali::Renderer __renderer;
Dali::Actor __textureViewActor;
- bool __windowDestroyed;
-
DSSignal<void *> __updatedSignal;
};