DSRenderViewDaliImpl: add __onWindowSizeChanged callback function 48/241748/1
authorSooChan Lim <sc1.lim@samsung.com>
Thu, 6 Aug 2020 05:37:21 +0000 (14:37 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:10:03 +0000 (19:10 +0900)
which is registered at registerCallbackSizeChanged function of DSWindow

Change-Id: Iafe0c701ab567b4f533d41cd2f1099b6609a72ec

src/DSRender/DSRenderViewDaliImpl.cpp
src/DSRender/DSRenderViewDaliImpl.h

index 23536c9..eaef822 100644 (file)
@@ -78,8 +78,10 @@ DSRenderViewDaliImpl::DSRenderViewDaliImpl(std::shared_ptr<DSWindow> window, Dal
        __textureViewActor.SetProperty(Actor::Property::POSITION, Vector3( 0.0f, 100.f, 0.0f ));
     __textureViewActor.SetProperty(Actor::Property::SIZE, Vector2(500, 500));
 
-
        offscreenWindow.Add(__textureViewActor);
+
+       // callbacks
+       window->registerCallbackSizeChanged(this, std::bind(&DSRenderViewDaliImpl::__onWindowSizeChanged, this, std::placeholders::_1));
 }
 
 DSRenderViewDaliImpl::~DSRenderViewDaliImpl()
@@ -102,4 +104,9 @@ bool DSRenderViewDaliImpl::setBuffer(std::shared_ptr<IDSBuffer> buffer)
        return true;
 }
 
+void DSRenderViewDaliImpl::__onWindowSizeChanged(std::shared_ptr<stSize> size)
+{
+       //TODO: set the View Size with size
+}
+
 } // namespace display_server
index 19ce433..f5de171 100644 (file)
@@ -2,6 +2,7 @@
 #define __DS_RENDER_VIEW_DALI_IMPL_H_
 
 #include "DSRenderView.h"
+#include "DSObject.h"
 
 #include <dali/dali.h>
 #include <dali/public-api/actors/actor.h>
@@ -10,7 +11,7 @@
 namespace display_server
 {
 
-class DSRenderViewDaliImpl : public DSRenderView
+class DSRenderViewDaliImpl : public DSRenderView, public DSObject
 {
 public:
        DSRenderViewDaliImpl(std::shared_ptr<DSWindow> window, Dali::OffscreenWindow offscreenWindow);
@@ -21,6 +22,8 @@ public:
        Dali::Geometry CreateTexturedQuad();
 
 private:
+       void __onWindowSizeChanged(std::shared_ptr<stSize> size);
+
        std::shared_ptr<DSWindow> __window;
        Dali::Renderer            __renderer;
        Dali::Actor               __textureViewActor;