#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)
{
bool DSRenderEngineDaliImpl::renderFrame()
{
- return false;
+ Adaptor::Get().RenderOnce();
+
+ return true;
}
} // namespace display_server
#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);
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;
};
}