Implemented initial phase to use dali render engine. 36/241736/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Mon, 27 Jul 2020 11:44:28 +0000 (20:44 +0900)
committerSung-Jin Park <sj76.park@samsung.com>
Thu, 20 Aug 2020 10:09:53 +0000 (19:09 +0900)
Change-Id: I8456a0573aa17933f3666ccc40bde3cc8b45f968
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/DSRender/DSRenderEngineDaliImpl.cpp
src/DSRender/DSRenderEngineDaliImpl.h

index 02245a6..42a00c5 100644 (file)
@@ -2,15 +2,38 @@
 #include "DSRenderViewDaliImpl.h"
 #include "DSDebugLog.h"
 
+using namespace Dali;
+
 namespace display_server
 {
 
 DSRenderEngineDaliImpl::DSRenderEngineDaliImpl(std::shared_ptr<IDSBufferQueue> bufferQueue)
        : __bufferQueue{bufferQueue}
-{}
+{
+       void *nativeBufferQueue = __bufferQueue->getNativeBufferQueue();
+       __offscreenApplication  = OffscreenApplication::New(nativeBufferQueue, true);
+
+       __offscreenApplication.InitSignal().Connect(this, &DSRenderEngineDaliImpl::onInitialize);
+
+       __offscreenApplication.Run();
+}
 
 DSRenderEngineDaliImpl::~DSRenderEngineDaliImpl()
-{}
+{
+}
+
+void DSRenderEngineDaliImpl::onInitialize()
+{
+       /* for testing -- begin -- */
+       OffscreenWindow window = __offscreenApplication.GetWindow();
+
+       window.SetBackgroundColor(Color::YELLOW);
+
+       Toolkit::TextLabel textlabel = Toolkit::TextLabel::New("Hello libDS");
+       textlabel.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER);
+       window.Add(textlabel);
+       /* for testing -- end -- */
+}
 
 std::shared_ptr<DSRenderView> DSRenderEngineDaliImpl::makeRenderView(std::shared_ptr<DSWindow> window)
 {
@@ -21,7 +44,9 @@ std::shared_ptr<DSRenderView> DSRenderEngineDaliImpl::makeRenderView(std::shared
 
 bool DSRenderEngineDaliImpl::renderFrame()
 {
-       return false;
+       Adaptor::Get().RenderOnce();
+
+       return true;
 }
 
 } // namespace display_server
index 2b101e1..b3940d1 100644 (file)
@@ -4,10 +4,15 @@
 #include "IDSRenderEngine.h"
 #include "IDSBufferQueue.h"
 
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali/devel-api/adaptor-framework/offscreen-application.h>
+#include <dali/devel-api/adaptor-framework/offscreen-window.h>
+#include <dali/integration-api/adaptor-framework/adaptor.h>
+
 namespace display_server
 {
 
-class DSRenderEngineDaliImpl : public IDSRenderEngine
+class DSRenderEngineDaliImpl : public IDSRenderEngine, public Dali::ConnectionTracker
 {
 public:
        DSRenderEngineDaliImpl(std::shared_ptr<IDSBufferQueue> bufferQueue);
@@ -16,8 +21,11 @@ public:
        std::shared_ptr<DSRenderView>    makeRenderView(std::shared_ptr<DSWindow> window) override;
        bool                             renderFrame() override;
 
+       void                             onInitialize();
+
 private:
        std::shared_ptr<IDSBufferQueue> __bufferQueue;
+       Dali::OffscreenApplication __offscreenApplication;
 };
 
 }