From 22f2172e545ea47da3363786e5eed0fe4be1afd0 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 27 Jul 2020 20:44:28 +0900 Subject: [PATCH] Implemented initial phase to use dali render engine. Change-Id: I8456a0573aa17933f3666ccc40bde3cc8b45f968 Signed-off-by: Joonbum Ko --- src/DSRender/DSRenderEngineDaliImpl.cpp | 31 ++++++++++++++++++++++++++++--- src/DSRender/DSRenderEngineDaliImpl.h | 10 +++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/src/DSRender/DSRenderEngineDaliImpl.cpp b/src/DSRender/DSRenderEngineDaliImpl.cpp index 02245a6..42a00c5 100644 --- a/src/DSRender/DSRenderEngineDaliImpl.cpp +++ b/src/DSRender/DSRenderEngineDaliImpl.cpp @@ -2,15 +2,38 @@ #include "DSRenderViewDaliImpl.h" #include "DSDebugLog.h" +using namespace Dali; + namespace display_server { DSRenderEngineDaliImpl::DSRenderEngineDaliImpl(std::shared_ptr 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 DSRenderEngineDaliImpl::makeRenderView(std::shared_ptr window) { @@ -21,7 +44,9 @@ std::shared_ptr DSRenderEngineDaliImpl::makeRenderView(std::shared bool DSRenderEngineDaliImpl::renderFrame() { - return false; + Adaptor::Get().RenderOnce(); + + return true; } } // namespace display_server diff --git a/src/DSRender/DSRenderEngineDaliImpl.h b/src/DSRender/DSRenderEngineDaliImpl.h index 2b101e1..b3940d1 100644 --- a/src/DSRender/DSRenderEngineDaliImpl.h +++ b/src/DSRender/DSRenderEngineDaliImpl.h @@ -4,10 +4,15 @@ #include "IDSRenderEngine.h" #include "IDSBufferQueue.h" +#include +#include +#include +#include + namespace display_server { -class DSRenderEngineDaliImpl : public IDSRenderEngine +class DSRenderEngineDaliImpl : public IDSRenderEngine, public Dali::ConnectionTracker { public: DSRenderEngineDaliImpl(std::shared_ptr bufferQueue); @@ -16,8 +21,11 @@ public: std::shared_ptr makeRenderView(std::shared_ptr window) override; bool renderFrame() override; + void onInitialize(); + private: std::shared_ptr __bufferQueue; + Dali::OffscreenApplication __offscreenApplication; }; } -- 2.7.4