From 43a834cc4d6e52313f6a9d600b30c20a48868675 Mon Sep 17 00:00:00 2001 From: Dae Young Ryu Date: Thu, 25 Jul 2013 16:02:02 +0900 Subject: [PATCH] change GlDisplayManager -> DisplayManager Change-Id: Idcf59c5f0cdbda8220e96d3a23ebadeb80b7ffd5 Signed-off-by: Dae Young Ryu --- src/app/FApp_UiAppImpl.cpp | 4 +- src/ui/CMakeLists.txt | 3 +- src/ui/FUi_ControlManager.cpp | 12 +- src/ui/FUi_Window.cpp | 4 +- src/ui/FUi_XUiEventManager.cpp | 8 +- src/ui/animations/FUiAnim_AnimationManager.cpp | 4 +- src/ui/animations/FUiAnim_AnimationManager.h | 2 +- src/ui/animations/FUiAnim_Debug.cpp | 26 +- src/ui/animations/FUiAnim_DisplayManager.cpp | 371 ++++++++++-------- ...GlDisplayManager.h => FUiAnim_DisplayManager.h} | 35 +- src/ui/animations/FUiAnim_EflDisplayManager.cpp | 339 +++++++++++++++++ src/ui/animations/FUiAnim_GlContext.cpp | 2 +- src/ui/animations/FUiAnim_GlDisplayManager.cpp | 419 --------------------- src/ui/animations/FUiAnim_GlLayer.cpp | 2 +- src/ui/animations/FUiAnim_GlRenderManager.cpp | 4 +- src/ui/animations/FUiAnim_GlRenderManager.h | 6 +- src/ui/animations/FUiAnim_INativeNode.cpp | 2 +- src/ui/animations/FUiAnim_Looper.cpp | 8 +- src/ui/animations/FUiAnim_NativeLayer.cpp | 12 +- src/ui/animations/FUiAnim_RootVisualElement.cpp | 3 +- src/ui/animations/FUiAnim_VisualElementCanvas.cpp | 15 +- src/ui/animations/FUiAnim_VisualElementImpl.cpp | 8 +- src/ui/animations/FUiAnim_XAtom.cpp | 2 +- src/ui/animations/platform/FUiAnim_X11Window.cpp | 6 +- ...isplayManager.h => FUiAnim_EflDisplayManager.h} | 0 src/ui/inc/FUiAnim_Looper.h | 2 +- src/ui/inc/FUiAnim_VisualElementImpl.h | 2 +- src/ui/isf/FUi_IsfContextImpl.cpp | 8 +- src/visual-element/src/osp-uifw/CMakeLists.txt | 2 +- src/visual-element/src/ve/SimpleGlFW.cpp | 12 +- src/visual-element/src/ve/SimpleGlFW.h | 2 +- 31 files changed, 650 insertions(+), 675 deletions(-) rename src/ui/animations/{FUiAnim_GlDisplayManager.h => FUiAnim_DisplayManager.h} (78%) create mode 100644 src/ui/animations/FUiAnim_EflDisplayManager.cpp delete mode 100644 src/ui/animations/FUiAnim_GlDisplayManager.cpp rename src/ui/inc/{FUiAnim_DisplayManager.h => FUiAnim_EflDisplayManager.h} (100%) diff --git a/src/app/FApp_UiAppImpl.cpp b/src/app/FApp_UiAppImpl.cpp index 38e4728..af58d95 100755 --- a/src/app/FApp_UiAppImpl.cpp +++ b/src/app/FApp_UiAppImpl.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include @@ -417,7 +417,7 @@ _UiAppImpl::OnMainLoop(void) // r = _AnimationManager::CreateInstance(); // SysAssertf(r == E_SUCCESS, "Failed to create animation manager!"); -// r = _GlDisplayManager::CreateInstance(); +// r = _DisplayManager::CreateInstance(); // SysAssertf(r == E_SUCCESS, "Failed to create display manager!"); diff --git a/src/ui/CMakeLists.txt b/src/ui/CMakeLists.txt index 182621f..2b19f88 100644 --- a/src/ui/CMakeLists.txt +++ b/src/ui/CMakeLists.txt @@ -40,7 +40,7 @@ SET (${this_target}_SOURCE_FILES ########################################################### animations/FUiAnim_XAtom.cpp animations/FUiAnim_GlContext.cpp - animations/FUiAnim_GlDisplayManager.cpp + animations/FUiAnim_DisplayManager.cpp animations/FUiAnim_GlLayer.cpp animations/FUiAnim_GlLoader.cpp animations/FUiAnim_GlNode.cpp @@ -62,7 +62,6 @@ SET (${this_target}_SOURCE_FILES animations/FUiAnim_TransformMatrix3Df.cpp animations/FUiAnim_ControlVisualElement.cpp animations/FUiAnim_Debug.cpp -# animations/FUiAnim_DisplayManager.cpp animations/FUiAnim_DisplayContextImpl.cpp animations/FUiAnimDisplayContext.cpp animations/FUiAnim_INativeNode.cpp diff --git a/src/ui/FUi_ControlManager.cpp b/src/ui/FUi_ControlManager.cpp index 6e217cc..678952b 100644 --- a/src/ui/FUi_ControlManager.cpp +++ b/src/ui/FUi_ControlManager.cpp @@ -52,7 +52,7 @@ #include "FUi_EcoreEvasMgr.h" #include "FUi_EflWindow.h" #include "FUiAnim_EflLayer.h" -#include "FUiAnim_DisplayManager.h" + #endif #include "FUi_ResourceManager.h" #include "FUi_Clipboard.h" @@ -66,7 +66,7 @@ #include "FUi_CoordinateSystemUtils.h" #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_AnimationManager.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUi_AccessibilityManager.h" #include "FUiAnim_VisualElement.h" @@ -342,7 +342,7 @@ _ControlManager::_ControlManager(void) // [ToDo] exception check. r = _AnimationManager::CreateInstance(); SysAssertf(r == E_SUCCESS, "Failed to create animation manager!"); - r = _GlDisplayManager::CreateInstance(); + r = _DisplayManager::CreateInstance(); SysAssertf(r == E_SUCCESS, "Failed to create display manager!"); #ifdef BUILD_BREAK @@ -420,7 +420,7 @@ _ControlManager::~_ControlManager(void) _DisplayManager::ReleaseInstance(); _AnimationManager::ReleaseInstance(); #else - _GlDisplayManager::ReleaseInstance(); + _DisplayManager::ReleaseInstance(); _AnimationManager::ReleaseInstance(); #endif } @@ -805,8 +805,8 @@ _ControlManager::AttachWindow(_Window& window) if (pRootVE) { _NativeLayer* pLayer = pRootVE->GetNativeLayer(); - _GlDisplayManager::GetInstance()->UnregisterLayer(*pLayer); - _GlDisplayManager::GetInstance()->RegisterLayer(*pLayer); + _DisplayManager::GetInstance()->UnregisterLayer(*pLayer); + _DisplayManager::GetInstance()->RegisterLayer(*pLayer); } } diff --git a/src/ui/FUi_Window.cpp b/src/ui/FUi_Window.cpp index 2b76c73..bda657a 100644 --- a/src/ui/FUi_Window.cpp +++ b/src/ui/FUi_Window.cpp @@ -42,7 +42,7 @@ #endif #include "FUiAnim_ControlVisualElement.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_GlLayer.h" #include "FUiCtrl_Form.h" @@ -388,7 +388,7 @@ _Window::CreateLayer(void) ecore_x_window_size_get(ecore_x_window_root_get((Ecore_X_Window)ecore_evas_window_get(pLayer->GetEcoreEvas())), &rootWindowW, &rootWindowH); #endif - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); SysAssert(pDisplayManager); __pLayer = _NativeLayer::CreateInstanceN(); diff --git a/src/ui/FUi_XUiEventManager.cpp b/src/ui/FUi_XUiEventManager.cpp index 1f16c61..8cfeea3 100644 --- a/src/ui/FUi_XUiEventManager.cpp +++ b/src/ui/FUi_XUiEventManager.cpp @@ -42,7 +42,7 @@ #include "FUiAnim_Looper.h" #include "FUiAnim_GlRenderManager.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_GlNode.h" #include "FUiAnim_ControlVisualElement.h" @@ -717,7 +717,7 @@ public: case _RawEvent::RAWEVENT_DRAW: { PRINT("RAWEVENT_DRAW() \n"); - _GlDisplayManager::GetInstance()->RenderAll(true); + _DisplayManager::GetInstance()->RenderAll(true); PRINT("RAWEVENT_DRAW() finished \n"); break; } @@ -728,7 +728,7 @@ public: PRINT("RAWEVENT_FLUSH() \n"); if(rawEvent.rawWindow) { - pLayer = _GlDisplayManager::GetInstance()->GetLayerWithNativeWindow(rawEvent.rawWindow); + pLayer = _DisplayManager::GetInstance()->GetLayerWithNativeWindow(rawEvent.rawWindow); } _GlRenderManager::GetInstance()->Composite(pLayer); break; @@ -741,7 +741,7 @@ public: // if (_AnimationManager::GetInstance()->GetTimeout(true) <= 0) // { _AnimationManager::GetInstance()->ProcessAnimationTick(true); - _GlDisplayManager::GetInstance()->SetNeedsComposite(true); + _DisplayManager::GetInstance()->SetNeedsComposite(true); // } //_AnimationManager::GetInstance()->ProcessAnimationTick(true); diff --git a/src/ui/animations/FUiAnim_AnimationManager.cpp b/src/ui/animations/FUiAnim_AnimationManager.cpp index 222b6aa..27d87ae 100644 --- a/src/ui/animations/FUiAnim_AnimationManager.cpp +++ b/src/ui/animations/FUiAnim_AnimationManager.cpp @@ -50,7 +50,7 @@ #ifdef VE_EFL #include "FUiAnim_DisplayManager.h" #else -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_GlRenderManager.h" #endif @@ -356,7 +356,7 @@ _AnimationManager::SetAnimatorEnabled(bool animating) #ifdef VE_EFL _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #else - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #endif if (pDisplayManager) { diff --git a/src/ui/animations/FUiAnim_AnimationManager.h b/src/ui/animations/FUiAnim_AnimationManager.h index 43621a2..fb072bf 100644 --- a/src/ui/animations/FUiAnim_AnimationManager.h +++ b/src/ui/animations/FUiAnim_AnimationManager.h @@ -175,7 +175,7 @@ private: #ifdef VE_EFL friend class _DisplayManager; #else - friend class _GlDisplayManager; + friend class _DisplayManager; #endif }; // _AnimationManager diff --git a/src/ui/animations/FUiAnim_Debug.cpp b/src/ui/animations/FUiAnim_Debug.cpp index b9e831a..97f695e 100644 --- a/src/ui/animations/FUiAnim_Debug.cpp +++ b/src/ui/animations/FUiAnim_Debug.cpp @@ -57,7 +57,7 @@ #include "FUi_EcoreEvasMgr.h" #else #include "FMediaImage.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_GlNode.h" #include "FUiAnim_GlLayer.h" #include "FUiAnim_GlVisualElementSurfaceImpl.h" @@ -723,11 +723,9 @@ _VeDebug::DumpVeLayout(_VisualElementImpl* pElement, int indent, FILE* pFile) { if (!pElement) { -#ifdef VE_EFL + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); -#else - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); -#endif + if (pDisplayManager != null && pDisplayManager->GetLayer(0)) { pElement = _VisualElementImpl::GetInstance(*pDisplayManager->GetLayer(0)->GetRootVisualElement()); @@ -1020,7 +1018,7 @@ _VeDebug::DumpVeTree(_VisualElementImpl* pElement, int indent) #ifdef VE_EFL _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #else - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #endif if (pDisplayManager != null && pDisplayManager->GetLayer(0)) { @@ -1707,7 +1705,7 @@ _VeDebug::PrintVeTree(_VisualElementImpl* pElement, int depth, unsigned int rema #ifdef VE_EFL _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #else - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #endif if (pDisplayManager != null && pDisplayManager->GetLayer(0)) { @@ -1825,7 +1823,7 @@ _VeDebug::DumpVeImage(_VisualElementImpl* pElement, const char* pathPrefix) #ifdef VE_EFL _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #else - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #endif if (pDisplayManager != null && pDisplayManager->GetLayer(0)) { @@ -1962,7 +1960,7 @@ _VeDebug::DumpAllVeImages(_VisualElementImpl* pElement, const char* pathPrefix) #ifdef VE_EFL _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #else - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); #endif if (pDisplayManager != null && pDisplayManager->GetLayer(0) && pDisplayManager->GetLayer(0)->GetRootVisualElement()) { @@ -2020,7 +2018,7 @@ DumpVeLayout(void) #ifdef VE_EFL Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #else - Tizen::Ui::Animations::_GlDisplayManager* pDisplayManager = Tizen::Ui::Animations::_GlDisplayManager::GetInstance(); + Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #endif int ret = system("rm -rf /tmp/layout"); @@ -2122,7 +2120,7 @@ DumpVeTree(void) #ifdef VE_EFL Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #else - Tizen::Ui::Animations::_GlDisplayManager* pDisplayManager = Tizen::Ui::Animations::_GlDisplayManager::GetInstance(); + Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #endif for (int i = 0; i < pDisplayManager->GetLayerCount(); i++) @@ -2141,7 +2139,7 @@ DumpEvasTree(void) #ifdef VE_EFL Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #else - Tizen::Ui::Animations::_GlDisplayManager* pDisplayManager = Tizen::Ui::Animations::_GlDisplayManager::GetInstance(); + Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #endif for (int i = 0; i < pDisplayManager->GetLayerCount(); i++) @@ -2160,7 +2158,7 @@ DumpAllVeImages(void) #ifdef VE_EFL Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #else - Tizen::Ui::Animations::_GlDisplayManager* pDisplayManager = Tizen::Ui::Animations::_GlDisplayManager::GetInstance(); + Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #endif for (int i = 0; i < pDisplayManager->GetLayerCount(); i++) @@ -2235,7 +2233,7 @@ DumpEvasTreeGraph(void) #ifdef VE_EFL Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #else - Tizen::Ui::Animations::_GlDisplayManager* pDisplayManager = Tizen::Ui::Animations::_GlDisplayManager::GetInstance(); + Tizen::Ui::Animations::_DisplayManager* pDisplayManager = Tizen::Ui::Animations::_DisplayManager::GetInstance(); #endif for (int i = 0; i < pDisplayManager->GetLayerCount(); i++) diff --git a/src/ui/animations/FUiAnim_DisplayManager.cpp b/src/ui/animations/FUiAnim_DisplayManager.cpp index 0a440c7..15e4f46 100644 --- a/src/ui/animations/FUiAnim_DisplayManager.cpp +++ b/src/ui/animations/FUiAnim_DisplayManager.cpp @@ -21,24 +21,44 @@ * * This file contains implementation _DisplayManager class. */ -#include +#include +#include +#include #include #include -#include "FUiAnim_NativeLayer.h" +#include +#include "FUiAnim_NativeWindow.h" +#include "FUiAnim_DisplayManager.h" +#include "FUiAnim_GlLayer.h" +#include "FUiAnim_VisualElementEnvironment.h" #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_VisualElementImpl.h" -#include "FUiAnim_VisualElementEnvironment.h" #include "FUiAnim_AnimationManager.h" -#include "FUiAnim_DisplayManager.h" + +#include "FUiAnim_GlRenderManager.h" +#include "FUiAnim_VisualElementSurfaceManager.h" +#include "FUiAnim_Looper.h" +#include "FUiAnim_XAtom.h" using namespace Tizen; using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Ui::Animations; +#define PRINT printf +namespace Tizen { namespace Ui { namespace Animations { -namespace +double +__GetTime(void) { + struct timeval timev; + + gettimeofday(&timev, NULL); + return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); +} + +static const double fpsLimitInterval = 1.0 / 55.0; + Eina_Bool WakeupEventCallback(void* pData, int type, void* pEvent) { @@ -47,51 +67,72 @@ WakeupEventCallback(void* pData, int type, void* pEvent) return ECORE_CALLBACK_PASS_ON; } -} -namespace Tizen { namespace Ui { namespace Animations -{ +_DisplayManager* _DisplayManager::__pInstance = null; +_DisplayManager::RestoreContextCallback _DisplayManager::__pRestoreContextCallback = null; int _DisplayManager::__eventType = 0; void* _DisplayManager::__pWakeUpEventHandler = null; bool _DisplayManager::__wakeUpEventAdded = false; -_DisplayManager* _DisplayManager::__pInstance = null; -_DisplayManager::RestoreContextCallback _DisplayManager::__pRestoreContextCallback = null; + _DisplayManager::_DisplayManager(void) - : __roots() + : __layers() + , __needUpdates(false) + , __needsComposite() { - __roots.Construct(); + + _VisualElementEnvironment::Initialize(); + _VisualElementSurfaceManager::Initialize(); + + __layers.Construct(); + + __needsComposite = 0; + +// __fdWakeup = open("./wakeup", O_WRONLY | O_CREATE, S_IUSER | S_IWUSER); +// if(__fdWakeup == -1) +// { +// PRINT("error create __fdWakeup\n"); +// } } _DisplayManager::~_DisplayManager(void) { -// while (__roots.GetCount() > 0) + + +// don't have to clean up layer list. (it should be removed on the user side) + +// while (__layers.GetCount() > 0) // { -// _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(0)); +// _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__layers.GetAt(0)); // pRoot->Destroy(); -// __roots.RemoveAt(0); +// __layers.RemoveAt(0); // } - __pInstance = null; + + } result _DisplayManager::CreateInstance(void) { - SysTryReturnResult(NID_UI_ANIM, !__pInstance, E_OBJ_ALREADY_EXIST, "The display manager is already created."); + SysTryReturnResult(NID_UI_ANIM, !__pInstance, E_OBJ_ALREADY_EXIST, "The display manager already created."); __pInstance = new (std::nothrow) _DisplayManager(); if (!__pInstance) { return E_OUT_OF_MEMORY; } - - _VisualElementEnvironment::Initialize(); - - // for wake up event + //for wakeup event __eventType = ecore_event_type_new(); __pWakeUpEventHandler = (void*)ecore_event_handler_add(__eventType, WakeupEventCallback, null); + _Looper::CreateInstance(); + + _NativeWindow::WindowSystemInit(); + + + _GlRenderManager::CreateInstance(); +// _GlRenderManager::GetInstance()->SyncRenderManager(); return E_SUCCESS; } @@ -100,222 +141,216 @@ _DisplayManager::ReleaseInstance(void) { SysTryReturnResult(NID_UI_ANIM, __pInstance, E_INVALID_STATE, "The display manager is not created."); - if (__pWakeUpEventHandler) - { - ecore_event_handler_del((Ecore_Event_Handler*)__pWakeUpEventHandler); - } - delete __pInstance; __pInstance = null; + _Looper::ReleaseInstance(); + return E_SUCCESS; } -_RootVisualElement* -_DisplayManager::CreateRoot(void) -{ - _RootVisualElement* pRoot = new (std::nothrow) _RootVisualElement(); - if (!pRoot) - { - return null; - } - - pRoot->Construct(); - pRoot->SetImplicitAnimationEnabled(false); - pRoot->SetShowState(true); - - RegisterRoot(*pRoot); - - return pRoot; -} result -_DisplayManager::DestroyRoot(_RootVisualElement& root) +_DisplayManager::RegisterLayer(_NativeLayer& layer) { - result r = UnregisterRoot(root); - - if (r != E_SUCCESS) - { - SysLogException(NID_UI_ANIM, E_INVALID_ARG, "[E_INVALID_ARG] root is not managed in the DisplayManager" ); - } - - root.Destroy(); - - return E_SUCCESS; + return __layers.Add(&layer); } result -_DisplayManager::RegisterRoot(_RootVisualElement& root) +_DisplayManager::UnregisterLayer(_NativeLayer& layer) { - return __roots.Add(root); + return __layers.Remove(layer); } -result -_DisplayManager::UnregisterRoot(_RootVisualElement& root) + +int +_DisplayManager::GetLayerCount(void) const { - return __roots.Remove(root); + return __layers.GetCount(); } -int -_DisplayManager::GetRootCount(void) const +_NativeLayer* +_DisplayManager::GetLayer(int index) const { - return __roots.GetCount(); + const _NativeLayer* pLayer = static_cast< const _NativeLayer* >(__layers.GetAt(index)); + return const_cast< _NativeLayer* >(pLayer); } -_RootVisualElement* -_DisplayManager::GetRoot(int index) const +_GlLayer* +_DisplayManager::GetLayerWithNativeWindow(Handle window) const { - const _RootVisualElement* pRoot = static_cast< const _RootVisualElement* >(__roots.GetAt(index)); - return const_cast< _RootVisualElement* >(pRoot); + int count = __layers.GetCount(); + for (int i = 0; i < count; i++) + { + const _GlLayer* pLayer = dynamic_cast< const _GlLayer* >(__layers.GetAt(i)); + if (likely(pLayer)) + { + if (pLayer->GetNativeWindow() == window) + { + return const_cast<_GlLayer*>(pLayer); + } + } + } + + return null; } void _DisplayManager::AddWakeUpEvent(void) { +// _AnimationManager::GetInstance()->SetAnimatorEnabled(true); if (!__wakeUpEventAdded) { ecore_event_add(__eventType, NULL, NULL, NULL); __wakeUpEventAdded = true; } + __needUpdates = true; } bool -_DisplayManager::RenderAll(void) +_DisplayManager::NeedAllUpdates() { - bool needUpdate = false; - int count = __roots.GetCount(); - if (count > 0) + int count = __layers.GetCount(); + if (count <= 0) + return false; + + for (int i = 0; i < count; i++) { - for (int i = 0; i < count; i++) - { - _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(i)); - if (likely(pRoot)) - { - bool updated = Render(*pRoot); + _NativeLayer* pLayer = null; - needUpdate |= updated; + pLayer = static_cast< _NativeLayer* >(__layers.GetAt(i)); - if (updated) + if (likely(pLayer)) + { +// if(isMainThread) +// { + if(pLayer->IsRenderNeeded()) { - _NativeLayer* pLayer = pRoot->GetNativeLayer(); - if (likely(pLayer)) - { - pLayer->SetFlushNeeded(); - } + return true; } - PostRender(*pRoot); - } +// } +// else +// { +// bool updated = pLayer->UpdateNativeNodes(); +// needUpdate |= updated; +// } + } } - - return needUpdate; + return false; } bool -_DisplayManager::Render(_RootVisualElement& root) +_DisplayManager::RenderAll(bool isMainThread) { - // VisualElement Rendering - // Fill contents - - // Prevent recursion for rendering ! - - // WARNING: - // EFL BUG !!!!! - // if the contents of evas object image is changed with geometry change, - // damage area is not calculated correctly !!! when event freeze/thaw enabled. - // --> artifact occurs - - //evas_event_freeze(__pEvas); + bool needUpdate = false; + int count = __layers.GetCount(); + if (count <= 0) + return false; - bool updated = false; - _RootVisualElement* pPresentationRoot = static_cast< _RootVisualElement* >(const_cast(root.AcquirePresentationInstance())); - if (pPresentationRoot) + for (int i = 0; i < count; i++) { - _VisualElementImpl* pRootModelImpl = _VisualElementImpl::GetInstance(root); - _VisualElementImpl* pRootPresentationImpl = _VisualElementImpl::GetInstance(*pPresentationRoot); + _NativeLayer* pLayer = null; - if (likely(pRootModelImpl) && likely(pRootPresentationImpl)) + pLayer = static_cast< _NativeLayer* >(__layers.GetAt(i)); + + if (likely(pLayer)) { - //-------------------; - // - if (//likely((pRootModelImpl->__childrenNeedsUpdateProps) != 0) || - likely(pRootPresentationImpl->__childrenNeedsUpdateProps != 0) || - likely(pRootPresentationImpl->__pSharedData->NeedNativeReconfigure()) || - unlikely(root.GetNeedsContentUpdate()) || - unlikely(pPresentationRoot->GetNeedsContentUpdate())) + if(isMainThread) { - root.SetNeedsContentUpdate(false); - pRootModelImpl->Draw(); + bool updated = pLayer->Render(); + pLayer->UpdateRenderObjects(); - pPresentationRoot->SetNeedsContentUpdate(false); - pRootPresentationImpl->Draw(); + needUpdate |= updated; + PostRender(*pLayer, isMainThread); + } + else + { + bool updated = pLayer->UpdateNativeNodes(); + needUpdate |= updated; + } - updated = true; + if (0)//(updated) + { + pLayer->Flush(); } } } - root.ReleasePresentationInstance(); - - //evas_event_thaw(__pEvas); - //evas_event_thaw_eval(__pEvas); // CHECKME: needed ??? - - return updated; + return needUpdate; } + result -_DisplayManager::PostRender(_RootVisualElement& root) +_DisplayManager::PostRender(_NativeLayer& layer, bool isMainThread) { // _ElapsedTime foo("PostRender"); +#ifdef VE_DEBUG + PRINT("POST-RENDER(%ld)\n", __RenderCount); +#endif - _RootVisualElement* pPresentationRoot = static_cast< _RootVisualElement* >(const_cast(root.AcquirePresentationInstance())); - if (likely(pPresentationRoot)) + if(!isMainThread) { - _VisualElementImpl* pRootPresentationImpl = _VisualElementImpl::GetInstance(*pPresentationRoot); + return E_SUCCESS; + } - //karzia R01: HIERARCHY_PROPERTY_CONTENT - if (likely((pRootPresentationImpl->__childrenNeedsUpdateProps & ~_VisualElementImpl::UPDATED_PROP_CONTENT) != 0) || - likely(pRootPresentationImpl->__pSharedData->NeedNativeReconfigure()) || - unlikely(root.GetNeedsContentUpdate()) || - unlikely(pPresentationRoot->GetNeedsContentUpdate())) - { - // CHECKME: - // We need wake-up main-loop for VE to be validated(draw) on next loop iteration. - // Is there another good method for this??? + //TODO: remove it + bool isAnimating = _AnimationManager::GetInstance()->__mainRoot.__isAnimating; - AddWakeUpEvent(); - } + _RootVisualElement * pRoot = layer.GetRootVisualElement(); + + if(unlikely(!pRoot)) + { + return E_SUCCESS; + } + + _VisualElementImpl* pRootImpl = _VisualElementImpl::GetInstance(*pRoot); + + //karzia R01: HIERARCHY_PROPERTY_CONTENT + if (unlikely(isAnimating) || + likely((pRootImpl->__childrenNeedsUpdateProps & ~_VisualElementImpl::UPDATED_PROP_CONTENT) != 0) || + unlikely(pRoot->GetNeedsContentUpdate())) + { + // CHECKME: + // We need wake-up main-loop for VE to be validated(draw) on next loop iteration. + // Is there another good method for this??? + + AddWakeUpEvent(); } - root.ReleasePresentationInstance(); + + //pRenderRoot->RemoveAllUpdatedItems(); return E_SUCCESS; } + result _DisplayManager::Flush(void) { - int count = __roots.GetCount(); + _GlRenderManager::GetInstance()->Composite(); + // FIXME: VisualElement::Flush should wait for complete + +#if 0 + int count = __layers.GetCount(); if (count > 0) { for (int i = 0; i < count; i++) { - _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(i)); + _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__layers.GetAt(i)); if (likely(pRoot)) { - _NativeLayer* pLayer = pRoot->GetNativeLayer(); - -//CHECK ME : when evas marked update flag. -// if (pLayer && pLayer->IsFlushNeeded()) + _INativeLayer* pLayer = pRoot->GetNativeLayer(); + if (pLayer) { pLayer->Flush(); - pLayer->ResetFlushNeeded(); } } } } +#endif return E_SUCCESS; } @@ -335,5 +370,47 @@ _DisplayManager::RestoreContext(void) } } +#if 0 +bool +_DisplayManager::UpdateScene(bool force) +{ + double currentTime = __GetTime(); + bool updated = false; + + static double prevRender = 0; + static int skipped = 0; + + force = true; + if (force || currentTime - prevRender >= fpsLimitInterval * 0.99) + { + Tizen::Ui::Animations::_AnimationManager::GetInstance()->ProcessAnimationTick(); + if (RenderAll(false)) + { + VSYNC_DEBUG(PRINT("##### end update: %d->%d\n", (int)(currentTime * 1000.0), (int)(__GetTime() * 1000.0))); + prevRender = currentTime; + updated = true; + } + else + { + VSYNC_DEBUG(PRINT("##### no update: %d\n", (int)(__GetTime() * 1000.0))); + } + } + else + { + VSYNC_DEBUG(PRINT("##### skipped, %d:%d\n", (int)(currentTime*1000.0), (int)(prevRender * 1000.0))); + skipped++; + } + + + if (updated) + { + _GlRenderManager::GetInstance()->Composite(); + } + + return updated; +} +#endif + }}} // Tizen::Ui::Animations + diff --git a/src/ui/animations/FUiAnim_GlDisplayManager.h b/src/ui/animations/FUiAnim_DisplayManager.h similarity index 78% rename from src/ui/animations/FUiAnim_GlDisplayManager.h rename to src/ui/animations/FUiAnim_DisplayManager.h index 7754b58..af37a91 100644 --- a/src/ui/animations/FUiAnim_GlDisplayManager.h +++ b/src/ui/animations/FUiAnim_DisplayManager.h @@ -16,18 +16,18 @@ // /** - * @file FUiAnim_GlDisplayManager.h - * @brief This is the header file for the _GlDisplayManager class. + * @file FUiAnim_DisplayManager.h + * @brief This is the header file for the _DisplayManager class. * - * This header file contains the declarations of the _GlDisplayManager class. + * This header file contains the declarations of the _DisplayManager class. */ -#ifndef _FUI_ANIM_INTERNAL_GL_DISPLAY_MANAGER_H_ -#define _FUI_ANIM_INTERNAL_GL_DISPLAY_MANAGER_H_ +#ifndef _FUI_ANIM_INTERNAL_DISPLAY_MANAGER_H_ +#define _FUI_ANIM_INTERNAL_DISPLAY_MANAGER_H_ #include #include "FUiAnim_AtomicInteger.h" -#include "FUiAnim_Looper.h" + // Backend feature //#define VE_EFL @@ -38,22 +38,22 @@ namespace Tizen { namespace Ui { namespace Animations { +class _RawEvent; class _NativeLayer; class _GlLayer; class _RootVisualElement; -class _OSP_EXPORT_ _GlDisplayManager +class _OSP_EXPORT_ _DisplayManager { public: - static _GlDisplayManager* GetInstance(void) + static _DisplayManager* GetInstance(void) { - return _GlDisplayManager::__pInstance; + return _DisplayManager::__pInstance; } static result CreateInstance(void); static result ReleaseInstance(void); - static bool __wakeUpEventAdded; // For restoring gl context typedef void (*RestoreContextCallback)(void); @@ -83,13 +83,11 @@ public: bool IsCompositeNeeded(void) const { return __needsComposite != 0; } void SetNeedsComposite(bool needsComposite) { __needsComposite = (needsComposite ? 1 : 0); } - bool GetXEventToRawEvent(_RawEvent& rawEvent); - bool UpdateScene(bool force); private: - _GlDisplayManager(void); - virtual ~_GlDisplayManager(void); + _DisplayManager(void); + virtual ~_DisplayManager(void); private: Tizen::Base::Collection::ArrayList __layers; @@ -97,14 +95,15 @@ private: _AtomicInteger __needsComposite; - static _GlDisplayManager* __pInstance; + static _DisplayManager* __pInstance; static RestoreContextCallback __pRestoreContextCallback; static int __eventType; static void* __pWakeUpEventHandler; -}; // _GlDisplayManager +public: + static bool __wakeUpEventAdded; +}; // _DisplayManager }}} //namespace Tizen { namespace Ui { namespace Animations -#endif //_FUI_ANIM_INTERNAL_GL_DISPLAY_MANAGER_H_ - +#endif //_FUI_ANIM_INTERNAL_DISPLAY_MANAGER_H_ diff --git a/src/ui/animations/FUiAnim_EflDisplayManager.cpp b/src/ui/animations/FUiAnim_EflDisplayManager.cpp new file mode 100644 index 0000000..0a440c7 --- /dev/null +++ b/src/ui/animations/FUiAnim_EflDisplayManager.cpp @@ -0,0 +1,339 @@ +// +// Open Service Platform +// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file FUiAnim_DisplayManager.cpp + * @brief This file contains implementation of _DisplayManager class + * + * This file contains implementation _DisplayManager class. + */ +#include +#include +#include +#include "FUiAnim_NativeLayer.h" +#include "FUiAnim_RootVisualElement.h" +#include "FUiAnim_VisualElementImpl.h" +#include "FUiAnim_VisualElementEnvironment.h" +#include "FUiAnim_AnimationManager.h" +#include "FUiAnim_DisplayManager.h" + +using namespace Tizen; +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Ui::Animations; + + +namespace +{ +Eina_Bool +WakeupEventCallback(void* pData, int type, void* pEvent) +{ + _DisplayManager::__wakeUpEventAdded = false; + + return ECORE_CALLBACK_PASS_ON; +} + +} + +namespace Tizen { namespace Ui { namespace Animations +{ +int _DisplayManager::__eventType = 0; +void* _DisplayManager::__pWakeUpEventHandler = null; +bool _DisplayManager::__wakeUpEventAdded = false; +_DisplayManager* _DisplayManager::__pInstance = null; +_DisplayManager::RestoreContextCallback _DisplayManager::__pRestoreContextCallback = null; + +_DisplayManager::_DisplayManager(void) + : __roots() +{ + __roots.Construct(); +} + +_DisplayManager::~_DisplayManager(void) +{ +// while (__roots.GetCount() > 0) +// { +// _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(0)); + +// pRoot->Destroy(); +// __roots.RemoveAt(0); +// } + __pInstance = null; +} + +result +_DisplayManager::CreateInstance(void) +{ + SysTryReturnResult(NID_UI_ANIM, !__pInstance, E_OBJ_ALREADY_EXIST, "The display manager is already created."); + + __pInstance = new (std::nothrow) _DisplayManager(); + if (!__pInstance) + { + return E_OUT_OF_MEMORY; + } + + _VisualElementEnvironment::Initialize(); + + // for wake up event + __eventType = ecore_event_type_new(); + __pWakeUpEventHandler = (void*)ecore_event_handler_add(__eventType, WakeupEventCallback, null); + + return E_SUCCESS; +} + +result +_DisplayManager::ReleaseInstance(void) +{ + SysTryReturnResult(NID_UI_ANIM, __pInstance, E_INVALID_STATE, "The display manager is not created."); + + if (__pWakeUpEventHandler) + { + ecore_event_handler_del((Ecore_Event_Handler*)__pWakeUpEventHandler); + } + + delete __pInstance; + __pInstance = null; + + return E_SUCCESS; +} + +_RootVisualElement* +_DisplayManager::CreateRoot(void) +{ + _RootVisualElement* pRoot = new (std::nothrow) _RootVisualElement(); + if (!pRoot) + { + return null; + } + + pRoot->Construct(); + pRoot->SetImplicitAnimationEnabled(false); + pRoot->SetShowState(true); + + RegisterRoot(*pRoot); + + return pRoot; +} + +result +_DisplayManager::DestroyRoot(_RootVisualElement& root) +{ + result r = UnregisterRoot(root); + + if (r != E_SUCCESS) + { + SysLogException(NID_UI_ANIM, E_INVALID_ARG, "[E_INVALID_ARG] root is not managed in the DisplayManager" ); + } + + root.Destroy(); + + return E_SUCCESS; +} + +result +_DisplayManager::RegisterRoot(_RootVisualElement& root) +{ + return __roots.Add(root); +} + +result +_DisplayManager::UnregisterRoot(_RootVisualElement& root) +{ + return __roots.Remove(root); +} + +int +_DisplayManager::GetRootCount(void) const +{ + return __roots.GetCount(); +} + +_RootVisualElement* +_DisplayManager::GetRoot(int index) const +{ + const _RootVisualElement* pRoot = static_cast< const _RootVisualElement* >(__roots.GetAt(index)); + return const_cast< _RootVisualElement* >(pRoot); +} + +void +_DisplayManager::AddWakeUpEvent(void) +{ + if (!__wakeUpEventAdded) + { + ecore_event_add(__eventType, NULL, NULL, NULL); + __wakeUpEventAdded = true; + } +} + +bool +_DisplayManager::RenderAll(void) +{ + bool needUpdate = false; + int count = __roots.GetCount(); + if (count > 0) + { + for (int i = 0; i < count; i++) + { + _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(i)); + if (likely(pRoot)) + { + bool updated = Render(*pRoot); + + needUpdate |= updated; + + if (updated) + { + _NativeLayer* pLayer = pRoot->GetNativeLayer(); + if (likely(pLayer)) + { + pLayer->SetFlushNeeded(); + } + } + + PostRender(*pRoot); + } + } + } + + return needUpdate; +} + +bool +_DisplayManager::Render(_RootVisualElement& root) +{ + // VisualElement Rendering + // Fill contents + + // Prevent recursion for rendering ! + + // WARNING: + // EFL BUG !!!!! + // if the contents of evas object image is changed with geometry change, + // damage area is not calculated correctly !!! when event freeze/thaw enabled. + // --> artifact occurs + + //evas_event_freeze(__pEvas); + + bool updated = false; + + _RootVisualElement* pPresentationRoot = static_cast< _RootVisualElement* >(const_cast(root.AcquirePresentationInstance())); + if (pPresentationRoot) + { + _VisualElementImpl* pRootModelImpl = _VisualElementImpl::GetInstance(root); + _VisualElementImpl* pRootPresentationImpl = _VisualElementImpl::GetInstance(*pPresentationRoot); + + if (likely(pRootModelImpl) && likely(pRootPresentationImpl)) + { + //-------------------; + // + if (//likely((pRootModelImpl->__childrenNeedsUpdateProps) != 0) || + likely(pRootPresentationImpl->__childrenNeedsUpdateProps != 0) || + likely(pRootPresentationImpl->__pSharedData->NeedNativeReconfigure()) || + unlikely(root.GetNeedsContentUpdate()) || + unlikely(pPresentationRoot->GetNeedsContentUpdate())) + { + root.SetNeedsContentUpdate(false); + pRootModelImpl->Draw(); + + pPresentationRoot->SetNeedsContentUpdate(false); + pRootPresentationImpl->Draw(); + + updated = true; + } + } + } + root.ReleasePresentationInstance(); + + + //evas_event_thaw(__pEvas); + //evas_event_thaw_eval(__pEvas); // CHECKME: needed ??? + + return updated; +} + +result +_DisplayManager::PostRender(_RootVisualElement& root) +{ +// _ElapsedTime foo("PostRender"); + + + _RootVisualElement* pPresentationRoot = static_cast< _RootVisualElement* >(const_cast(root.AcquirePresentationInstance())); + if (likely(pPresentationRoot)) + { + _VisualElementImpl* pRootPresentationImpl = _VisualElementImpl::GetInstance(*pPresentationRoot); + + //karzia R01: HIERARCHY_PROPERTY_CONTENT + if (likely((pRootPresentationImpl->__childrenNeedsUpdateProps & ~_VisualElementImpl::UPDATED_PROP_CONTENT) != 0) || + likely(pRootPresentationImpl->__pSharedData->NeedNativeReconfigure()) || + unlikely(root.GetNeedsContentUpdate()) || + unlikely(pPresentationRoot->GetNeedsContentUpdate())) + { + // CHECKME: + // We need wake-up main-loop for VE to be validated(draw) on next loop iteration. + // Is there another good method for this??? + + AddWakeUpEvent(); + } + } + root.ReleasePresentationInstance(); + + return E_SUCCESS; +} + +result +_DisplayManager::Flush(void) +{ + int count = __roots.GetCount(); + if (count > 0) + { + for (int i = 0; i < count; i++) + { + _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__roots.GetAt(i)); + if (likely(pRoot)) + { + _NativeLayer* pLayer = pRoot->GetNativeLayer(); + +//CHECK ME : when evas marked update flag. +// if (pLayer && pLayer->IsFlushNeeded()) + { + pLayer->Flush(); + pLayer->ResetFlushNeeded(); + } + } + } + } + + return E_SUCCESS; +} + +void +_DisplayManager::SetRestoreContextCallback(RestoreContextCallback pRestoreContextCallback) +{ + __pRestoreContextCallback = pRestoreContextCallback; +} + +void +_DisplayManager::RestoreContext(void) +{ + if (__pRestoreContextCallback) + { + (*__pRestoreContextCallback)(); + } +} + +}}} // Tizen::Ui::Animations + diff --git a/src/ui/animations/FUiAnim_GlContext.cpp b/src/ui/animations/FUiAnim_GlContext.cpp index b3246e3..b94a054 100644 --- a/src/ui/animations/FUiAnim_GlContext.cpp +++ b/src/ui/animations/FUiAnim_GlContext.cpp @@ -29,7 +29,7 @@ #include "FGrp_BufferInfoImpl.h" #include "FUiAnim_GlContext.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_VisualElementSurfaceManager.h" #ifndef VE_SIMULATOR diff --git a/src/ui/animations/FUiAnim_GlDisplayManager.cpp b/src/ui/animations/FUiAnim_GlDisplayManager.cpp deleted file mode 100644 index b38fdc3..0000000 --- a/src/ui/animations/FUiAnim_GlDisplayManager.cpp +++ /dev/null @@ -1,419 +0,0 @@ -// -// Open Service Platform -// Copyright (c) 2012-2013 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -/** - * @file FUiAnim_GlDisplayManager.cpp - * @brief This file contains implementation of _GlDisplayManager class - * - * This file contains implementation _GlDisplayManager class. - */ -#include -#include -#include -#include -#include -#include -#include "FUiAnim_NativeLayer.h" -#include "FUiAnim_GlLayer.h" -#include "FUiAnim_VisualElementEnvironment.h" -#include "FUiAnim_RootVisualElement.h" -#include "FUiAnim_VisualElementImpl.h" -#include "FUiAnim_AnimationManager.h" -#include "FUiAnim_GlDisplayManager.h" -#include "FUiAnim_GlRenderManager.h" -#include "FUiAnim_VisualElementSurfaceManager.h" -#include "FUiAnim_Looper.h" -#include "FUiAnim_XAtom.h" - -using namespace Tizen; -using namespace Tizen::Base; -using namespace Tizen::Base::Collection; -using namespace Tizen::Ui::Animations; - -#define PRINT printf -namespace -{ - -double -__GetTime(void) -{ - struct timeval timev; - - gettimeofday(&timev, NULL); - return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); -} - -static const double fpsLimitInterval = 1.0 / 55.0; - -Eina_Bool -WakeupEventCallback(void* pData, int type, void* pEvent) -{ - _GlDisplayManager::__wakeUpEventAdded = false; - - return ECORE_CALLBACK_PASS_ON; -} - -} - -namespace Tizen { namespace Ui { namespace Animations { - -_GlDisplayManager* _GlDisplayManager::__pInstance = null; -_GlDisplayManager::RestoreContextCallback _GlDisplayManager::__pRestoreContextCallback = null; -int _GlDisplayManager::__eventType = 0; -void* _GlDisplayManager::__pWakeUpEventHandler = null; -bool _GlDisplayManager::__wakeUpEventAdded = false; - - -_GlDisplayManager::_GlDisplayManager(void) - : __layers() - , __needUpdates(false) - , __needsComposite() -{ - - _VisualElementEnvironment::Initialize(); - _VisualElementSurfaceManager::Initialize(); - - __layers.Construct(); - - __needsComposite = 0; - -// __fdWakeup = open("./wakeup", O_WRONLY | O_CREATE, S_IUSER | S_IWUSER); -// if(__fdWakeup == -1) -// { -// PRINT("error create __fdWakeup\n"); -// } -} - -_GlDisplayManager::~_GlDisplayManager(void) -{ - - -// don't have to clean up layer list. (it should be removed on the user side) - -// while (__layers.GetCount() > 0) -// { -// _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__layers.GetAt(0)); - -// pRoot->Destroy(); -// __layers.RemoveAt(0); -// } - - -} - -result -_GlDisplayManager::CreateInstance(void) -{ - SysTryReturnResult(NID_UI_ANIM, !__pInstance, E_OBJ_ALREADY_EXIST, "The display manager already created."); - - __pInstance = new (std::nothrow) _GlDisplayManager(); - if (!__pInstance) - { - return E_OUT_OF_MEMORY; - } - //for wakeup event - __eventType = ecore_event_type_new(); - __pWakeUpEventHandler = (void*)ecore_event_handler_add(__eventType, WakeupEventCallback, null); - - _Looper::CreateInstance(); - - _NativeWindow::WindowSystemInit(); - - - _GlRenderManager::CreateInstance(); -// _GlRenderManager::GetInstance()->SyncRenderManager(); - return E_SUCCESS; -} - -result -_GlDisplayManager::ReleaseInstance(void) -{ - SysTryReturnResult(NID_UI_ANIM, __pInstance, E_INVALID_STATE, "The display manager is not created."); - - delete __pInstance; - __pInstance = null; - - _Looper::ReleaseInstance(); - - return E_SUCCESS; -} - - -result -_GlDisplayManager::RegisterLayer(_NativeLayer& layer) -{ - return __layers.Add(&layer); -} - -result -_GlDisplayManager::UnregisterLayer(_NativeLayer& layer) -{ - return __layers.Remove(layer); -} - - -int -_GlDisplayManager::GetLayerCount(void) const -{ - return __layers.GetCount(); -} - -_NativeLayer* -_GlDisplayManager::GetLayer(int index) const -{ - const _NativeLayer* pLayer = static_cast< const _NativeLayer* >(__layers.GetAt(index)); - return const_cast< _NativeLayer* >(pLayer); -} - -_GlLayer* -_GlDisplayManager::GetLayerWithNativeWindow(Handle window) const -{ - int count = __layers.GetCount(); - for (int i = 0; i < count; i++) - { - const _GlLayer* pLayer = dynamic_cast< const _GlLayer* >(__layers.GetAt(i)); - if (likely(pLayer)) - { - if (pLayer->GetNativeWindow() == window) - { - return const_cast<_GlLayer*>(pLayer); - } - } - } - - return null; -} - -void -_GlDisplayManager::AddWakeUpEvent(void) -{ -// _AnimationManager::GetInstance()->SetAnimatorEnabled(true); - if (!__wakeUpEventAdded) - { - ecore_event_add(__eventType, NULL, NULL, NULL); - __wakeUpEventAdded = true; - } - __needUpdates = true; -} - -bool -_GlDisplayManager::NeedAllUpdates() -{ - int count = __layers.GetCount(); - if (count <= 0) - return false; - - for (int i = 0; i < count; i++) - { - _NativeLayer* pLayer = null; - - pLayer = static_cast< _NativeLayer* >(__layers.GetAt(i)); - - if (likely(pLayer)) - { -// if(isMainThread) -// { - if(pLayer->IsRenderNeeded()) - { - return true; - } - -// } -// else -// { -// bool updated = pLayer->UpdateNativeNodes(); -// needUpdate |= updated; -// } - - } - } - return false; -} - -bool -_GlDisplayManager::RenderAll(bool isMainThread) -{ - bool needUpdate = false; - int count = __layers.GetCount(); - if (count <= 0) - return false; - - - for (int i = 0; i < count; i++) - { - _NativeLayer* pLayer = null; - - pLayer = static_cast< _NativeLayer* >(__layers.GetAt(i)); - - if (likely(pLayer)) - { - if(isMainThread) - { - bool updated = pLayer->Render(); - pLayer->UpdateRenderObjects(); - - needUpdate |= updated; - PostRender(*pLayer, isMainThread); - } - else - { - bool updated = pLayer->UpdateNativeNodes(); - needUpdate |= updated; - } - - if (0)//(updated) - { - pLayer->Flush(); - } - } - } - - return needUpdate; -} - - -result -_GlDisplayManager::PostRender(_NativeLayer& layer, bool isMainThread) -{ -// _ElapsedTime foo("PostRender"); - -#ifdef VE_DEBUG - PRINT("POST-RENDER(%ld)\n", __RenderCount); -#endif - - if(!isMainThread) - { - return E_SUCCESS; - } - - //TODO: remove it - bool isAnimating = _AnimationManager::GetInstance()->__mainRoot.__isAnimating; - - _RootVisualElement * pRoot = layer.GetRootVisualElement(); - - if(unlikely(!pRoot)) - { - return E_SUCCESS; - } - - _VisualElementImpl* pRootImpl = _VisualElementImpl::GetInstance(*pRoot); - - //karzia R01: HIERARCHY_PROPERTY_CONTENT - if (unlikely(isAnimating) || - likely((pRootImpl->__childrenNeedsUpdateProps & ~_VisualElementImpl::UPDATED_PROP_CONTENT) != 0) || - unlikely(pRoot->GetNeedsContentUpdate())) - { - // CHECKME: - // We need wake-up main-loop for VE to be validated(draw) on next loop iteration. - // Is there another good method for this??? - - AddWakeUpEvent(); - } - - //pRenderRoot->RemoveAllUpdatedItems(); - - return E_SUCCESS; -} - - -result -_GlDisplayManager::Flush(void) -{ - _GlRenderManager::GetInstance()->Composite(); - // FIXME: VisualElement::Flush should wait for complete - -#if 0 - int count = __layers.GetCount(); - if (count > 0) - { - for (int i = 0; i < count; i++) - { - _RootVisualElement* pRoot = static_cast< _RootVisualElement* >(__layers.GetAt(i)); - if (likely(pRoot)) - { - _INativeLayer* pLayer = pRoot->GetNativeLayer(); - if (pLayer) - { - pLayer->Flush(); - } - } - } - } -#endif - - return E_SUCCESS; -} - -void -_GlDisplayManager::SetRestoreContextCallback(RestoreContextCallback pRestoreContextCallback) -{ - __pRestoreContextCallback = pRestoreContextCallback; -} - -void -_GlDisplayManager::RestoreContext(void) -{ - if (__pRestoreContextCallback) - { - (*__pRestoreContextCallback)(); - } -} - -#if 0 -bool -_GlDisplayManager::UpdateScene(bool force) -{ - double currentTime = __GetTime(); - bool updated = false; - - static double prevRender = 0; - static int skipped = 0; - - force = true; - if (force || currentTime - prevRender >= fpsLimitInterval * 0.99) - { - Tizen::Ui::Animations::_AnimationManager::GetInstance()->ProcessAnimationTick(); - if (RenderAll(false)) - { - VSYNC_DEBUG(PRINT("##### end update: %d->%d\n", (int)(currentTime * 1000.0), (int)(__GetTime() * 1000.0))); - prevRender = currentTime; - updated = true; - } - else - { - VSYNC_DEBUG(PRINT("##### no update: %d\n", (int)(__GetTime() * 1000.0))); - } - } - else - { - VSYNC_DEBUG(PRINT("##### skipped, %d:%d\n", (int)(currentTime*1000.0), (int)(prevRender * 1000.0))); - skipped++; - } - - - if (updated) - { - _GlRenderManager::GetInstance()->Composite(); - } - - return updated; -} -#endif - -}}} // Tizen::Ui::Animations - - diff --git a/src/ui/animations/FUiAnim_GlLayer.cpp b/src/ui/animations/FUiAnim_GlLayer.cpp index 3969572..aa31f77 100644 --- a/src/ui/animations/FUiAnim_GlLayer.cpp +++ b/src/ui/animations/FUiAnim_GlLayer.cpp @@ -32,7 +32,7 @@ #include "FUiAnim_VisualElementImpl.h" #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_AnimationManager.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_GlRenderManager.h" #include "FUi_Math.h" diff --git a/src/ui/animations/FUiAnim_GlRenderManager.cpp b/src/ui/animations/FUiAnim_GlRenderManager.cpp index fb34862..e718fb6 100644 --- a/src/ui/animations/FUiAnim_GlRenderManager.cpp +++ b/src/ui/animations/FUiAnim_GlRenderManager.cpp @@ -40,7 +40,7 @@ #include "FUiAnim_VisualElementEnvironment.h" #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_GlRenderManager.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_GlVisualElementSurfaceImpl.h" #include "FUiAnim_GlLayer.h" #include "FUiAnim_GlNode.h" @@ -576,7 +576,7 @@ _GlRenderManager::CommandHandlerComposite(_GlLayer* pGlLayer) CHECK_GL_CONTEXT(); #endif - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); _AutoMutex treeLock(*_VisualElementEnvironment::GetTreeLock()); diff --git a/src/ui/animations/FUiAnim_GlRenderManager.h b/src/ui/animations/FUiAnim_GlRenderManager.h index 1ef9cbd..44856b5 100644 --- a/src/ui/animations/FUiAnim_GlRenderManager.h +++ b/src/ui/animations/FUiAnim_GlRenderManager.h @@ -16,10 +16,10 @@ // /** - * @file FUiAnim_GlDisplayManager.h - * @brief This is the header file for the _GlDisplayManager class. + * @file FUiAnim__GlRenderManager.h + * @brief This is the header file for the _GlRenderManager class. * - * This header file contains the declarations of the _GlDisplayManager class. + * This header file contains the declarations of the _GlRenderManager class. */ #ifndef _FUI_ANIM_INTERNAL_GL_RENDER_MANAGER_H_ diff --git a/src/ui/animations/FUiAnim_INativeNode.cpp b/src/ui/animations/FUiAnim_INativeNode.cpp index 1e64181..a61066e 100644 --- a/src/ui/animations/FUiAnim_INativeNode.cpp +++ b/src/ui/animations/FUiAnim_INativeNode.cpp @@ -29,7 +29,7 @@ #include "FUiAnim_DisplayManager.h" #include "FUiAnim_EflNode.h" #else -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_GlNode.h" #endif diff --git a/src/ui/animations/FUiAnim_Looper.cpp b/src/ui/animations/FUiAnim_Looper.cpp index 51d7d08..b085eb6 100644 --- a/src/ui/animations/FUiAnim_Looper.cpp +++ b/src/ui/animations/FUiAnim_Looper.cpp @@ -31,7 +31,7 @@ #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_VisualElementImpl.h" #include "FUiAnim_AnimationManager.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_Looper.h" using namespace Tizen; @@ -356,7 +356,7 @@ _Looper::PeekRawEvent(_RawEvent& rawEvent, bool consume) if (__eventQueue.GetCount() <= 0) { - __needUpdateDraw = _GlDisplayManager::GetInstance()->NeedAllUpdates(); //true + __needUpdateDraw = _DisplayManager::GetInstance()->NeedAllUpdates(); //true #if 1 // todo works if (unlikely(__needUpdateDraw)) { @@ -380,7 +380,7 @@ _Looper::PeekRawEvent(_RawEvent& rawEvent, bool consume) return true; } - if (unlikely(_GlDisplayManager::GetInstance()->IsCompositeNeeded())) + if (unlikely(_DisplayManager::GetInstance()->IsCompositeNeeded())) { PRINT("PeekRawEvent:RAWEVENT_FLUSH: \n"); rawEvent.type = _RawEvent::RAWEVENT_FLUSH; @@ -388,7 +388,7 @@ _Looper::PeekRawEvent(_RawEvent& rawEvent, bool consume) rawEvent.rawWindow = 0; if (consume) - _GlDisplayManager::GetInstance()->SetNeedsComposite(false); + _DisplayManager::GetInstance()->SetNeedsComposite(false); return true; } diff --git a/src/ui/animations/FUiAnim_NativeLayer.cpp b/src/ui/animations/FUiAnim_NativeLayer.cpp index 3f790c7..2350a6e 100644 --- a/src/ui/animations/FUiAnim_NativeLayer.cpp +++ b/src/ui/animations/FUiAnim_NativeLayer.cpp @@ -29,12 +29,11 @@ #include "FUiAnim_NativeLayer.h" #include "FUiAnim_VisualElementImpl.h" #if defined(VE_EFL) -#include "FUiAnim_DisplayManager.h" #include "FUiAnim_EflLayer.h" #elif defined(VE_X_GL) -#include "FUiAnim_GlDisplayManager.h" #include "FUiAnim_GlLayer.h" #endif +#include "FUiAnim_DisplayManager.h" //#define PRINT fprintf(stderr, __VA_ARGS__) #define PRINT(...) @@ -57,11 +56,7 @@ _NativeLayer::~_NativeLayer(void) PRINT("_NativeLayer:~_NativeLayer() \n"); if(_pRootVisualElement) { -#if defined(VE_EFL) _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); -#elif defined(VE_X_GL) - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); -#endif if(pDisplayManager) { pDisplayManager->UnregisterLayer(*this); @@ -113,12 +108,7 @@ _NativeLayer::Construct(void) _pRootVisualElement->SetShowState(true); } -#if defined(VE_EFL) _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); -#elif defined(VE_X_GL) - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); -#endif - r = OnConstructed(); SysTryReturnResult(NID_UI_ANIM, r == E_SUCCESS, r, "Constructing failed."); diff --git a/src/ui/animations/FUiAnim_RootVisualElement.cpp b/src/ui/animations/FUiAnim_RootVisualElement.cpp index 24a77d6..47def9d 100644 --- a/src/ui/animations/FUiAnim_RootVisualElement.cpp +++ b/src/ui/animations/FUiAnim_RootVisualElement.cpp @@ -27,8 +27,9 @@ #ifdef VE_EFL #include "FUiAnim_DisplayManager.h" #else -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #endif +#include "FUiAnim_Mutex.h" #include "FUiAnim_VisualElementEnvironment.h" #include "FUiAnim_RootVisualElement.h" #include "FUiAnim_NativeLayer.h" diff --git a/src/ui/animations/FUiAnim_VisualElementCanvas.cpp b/src/ui/animations/FUiAnim_VisualElementCanvas.cpp index cbf8b61..ab4023b 100644 --- a/src/ui/animations/FUiAnim_VisualElementCanvas.cpp +++ b/src/ui/animations/FUiAnim_VisualElementCanvas.cpp @@ -34,11 +34,8 @@ #include "FUiAnim_VisualElementCoordinateSystem.h" #include "FUiAnim_VisualElementCanvas.h" #include "FUiAnim_VisualElementSurfaceImpl.h" -#ifdef VE_EFL #include "FUiAnim_DisplayManager.h" -#else -#include "FUiAnim_GlDisplayManager.h" -#endif + namespace Tizen { namespace Ui { namespace Animations { @@ -95,11 +92,8 @@ _VisualElementCanvas::Construct(const VisualElementSurface& surface, const Tizen pCanvasImpl->_pCoordHolder->Init(revisedBounds); } -#ifdef VE_EFL _DisplayManager::RestoreContext(); -#else - _GlDisplayManager::RestoreContext(); -#endif + return r; } @@ -114,11 +108,8 @@ _VisualElementCanvas::Construct(const VisualElementSurface& surface, const Tizen Handle window = _VisualElementSurfaceImpl::GetInstance(surface)->GetNativeHandle(); result r = pCanvasImpl->Construct(window, rectangle); -#ifdef VE_EFL _DisplayManager::RestoreContext(); -#else - _GlDisplayManager::RestoreContext(); -#endif + return r; } diff --git a/src/ui/animations/FUiAnim_VisualElementImpl.cpp b/src/ui/animations/FUiAnim_VisualElementImpl.cpp index 63b4e71..2b770e7 100644 --- a/src/ui/animations/FUiAnim_VisualElementImpl.cpp +++ b/src/ui/animations/FUiAnim_VisualElementImpl.cpp @@ -70,7 +70,7 @@ #include "FUiAnim_EflVisualElementSurfaceImpl.h" #else #include "FUiAnim_GlNode.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_Mutex.h" #include "FUiAnim_VisualElementEnvironment.h" #endif @@ -1527,7 +1527,7 @@ _VisualElementImpl::FlushI(void) pDisplayManager->RenderAll(); } #else - _GlDisplayManager* pDisplayManager = _GlDisplayManager::GetInstance(); + _DisplayManager* pDisplayManager = _DisplayManager::GetInstance(); if (pDisplayManager) { pDisplayManager->RenderAll(true); @@ -6628,9 +6628,9 @@ _VisualElementImpl::SetFlushNeeded(void) } } - if(_GlDisplayManager::GetInstance()) + if(_DisplayManager::GetInstance()) { - _GlDisplayManager::GetInstance()->SetNeedsComposite(true); + _DisplayManager::GetInstance()->SetNeedsComposite(true); return E_SUCCESS; } return E_INVALID_STATE; diff --git a/src/ui/animations/FUiAnim_XAtom.cpp b/src/ui/animations/FUiAnim_XAtom.cpp index 2fc277c..1e6a09e 100644 --- a/src/ui/animations/FUiAnim_XAtom.cpp +++ b/src/ui/animations/FUiAnim_XAtom.cpp @@ -2,7 +2,7 @@ #include #include #include "FUiAnim_XAtom.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_NativeWindow.h" //#define PRINT fprintf(stderr, __VA_ARGS__) diff --git a/src/ui/animations/platform/FUiAnim_X11Window.cpp b/src/ui/animations/platform/FUiAnim_X11Window.cpp index e52f05c..171b5bf 100644 --- a/src/ui/animations/platform/FUiAnim_X11Window.cpp +++ b/src/ui/animations/platform/FUiAnim_X11Window.cpp @@ -7,7 +7,7 @@ #include "FUiAnim_Looper.h" #include "FUiAnim_XAtom.h" #include "FUiAnim_GlLayer.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUiAnim_X11Window.h" using namespace Tizen::Base; @@ -719,7 +719,7 @@ public: if(targetWindow != 0) { _GlLayer* pLayer = null; - pLayer = _GlDisplayManager::GetInstance()->GetLayerWithNativeWindow(targetWindow); + pLayer = _DisplayManager::GetInstance()->GetLayerWithNativeWindow(targetWindow); if(pLayer) { _X11Window * pWindow = static_cast<_X11Window *>(pLayer->GetWindow()); @@ -976,7 +976,7 @@ _X11Window::XCreateWindow(Handle hParent, int x, int y, unsigned int width, unsi } winAttributes.colormap = DefaultColormap(pDisplay, DefaultScreen(pDisplay)); - // winAttributes.colormap = _GlDisplayManager::GetInstance()->GetXColormap(); + // winAttributes.colormap = _DisplayManager::GetInstance()->GetXColormap(); winAttributes.backing_store = NotUseful; winAttributes.override_redirect = False; winAttributes.border_pixel = 0; diff --git a/src/ui/inc/FUiAnim_DisplayManager.h b/src/ui/inc/FUiAnim_EflDisplayManager.h similarity index 100% rename from src/ui/inc/FUiAnim_DisplayManager.h rename to src/ui/inc/FUiAnim_EflDisplayManager.h diff --git a/src/ui/inc/FUiAnim_Looper.h b/src/ui/inc/FUiAnim_Looper.h index d46686e..44a5f48 100644 --- a/src/ui/inc/FUiAnim_Looper.h +++ b/src/ui/inc/FUiAnim_Looper.h @@ -218,7 +218,7 @@ private: _Mutex __eventLock; - friend class _GlDisplayManager; + friend class _DisplayManager; GCond* __pGlibCondition; diff --git a/src/ui/inc/FUiAnim_VisualElementImpl.h b/src/ui/inc/FUiAnim_VisualElementImpl.h index 89ca399..b9f0886 100644 --- a/src/ui/inc/FUiAnim_VisualElementImpl.h +++ b/src/ui/inc/FUiAnim_VisualElementImpl.h @@ -1509,7 +1509,7 @@ private: friend class _ControlVisualElement; friend class _RootVisualElement; friend class _AnimationManager; - friend class _GlDisplayManager; + friend class _DisplayManager; friend class _GlRenderManager; friend class _NativeLayer; friend class _TransactionNode; diff --git a/src/ui/isf/FUi_IsfContextImpl.cpp b/src/ui/isf/FUi_IsfContextImpl.cpp index d488cfc..aaa1fb8 100644 --- a/src/ui/isf/FUi_IsfContextImpl.cpp +++ b/src/ui/isf/FUi_IsfContextImpl.cpp @@ -43,7 +43,7 @@ Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA #include "FBaseString.h" #include "FBaseSysLog.h" -#include "FUiAnim_GlDisplayManager.h" +#include "FUiAnim_DisplayManager.h" #include "FUi_IsfContext.h" @@ -2865,7 +2865,7 @@ _keyname_to_keycode (const char *keyname) { int keycode = 0; int keysym; - Display *display = (Display *)_GlDisplayManager::GetInstance()->GetXDisplay(); + Display *display = (Display *)_DisplayManager::GetInstance()->GetXDisplay(); keysym = XStringToKeysym (keyname); @@ -3011,7 +3011,7 @@ static XKeyEvent createKeyEvent (bool press, int keycode, int modifiers, bool fa XKeyEvent event; Window focus_win; - Display *display = (Display *)_GlDisplayManager::GetInstance()->GetXDisplay(); + Display *display = (Display *)_DisplayManager::GetInstance()->GetXDisplay(); int revert = RevertToParent; XGetInputFocus (display, &focus_win, &revert); @@ -3053,7 +3053,7 @@ static void send_x_key_event (const KeyEvent &key, bool fake) char keysym_str[256] = {0}; // Obtain the X11 display. - Display *display = (Display *)_GlDisplayManager::GetInstance()->GetXDisplay(); + Display *display = (Display *)_DisplayManager::GetInstance()->GetXDisplay(); if (display == NULL) { std::cerr << "ecore_x_display_get () failed\n"; diff --git a/src/visual-element/src/osp-uifw/CMakeLists.txt b/src/visual-element/src/osp-uifw/CMakeLists.txt index 0f1dad5..a0193fe 100755 --- a/src/visual-element/src/osp-uifw/CMakeLists.txt +++ b/src/visual-element/src/osp-uifw/CMakeLists.txt @@ -10,7 +10,7 @@ SET(${this_target}_SOURCE_FILES # ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_GlLoader.cpp # ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_GlVisualElementSurfaceImpl.cpp # ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_GlContext.cpp -# ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_GlDisplayManager.cpp +# ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_DisplayManager.cpp # ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_GlRenderManager.cpp # ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_GlShaderProgram.cpp # ${UIFW_SOURCE_DIRECTORY}/ui/animations/FUiAnim_Looper.cpp diff --git a/src/visual-element/src/ve/SimpleGlFW.cpp b/src/visual-element/src/ve/SimpleGlFW.cpp index 13ee63a..621a802 100644 --- a/src/visual-element/src/ve/SimpleGlFW.cpp +++ b/src/visual-element/src/ve/SimpleGlFW.cpp @@ -1,7 +1,7 @@ #include #include #include -#include +#include #include using namespace Tizen::Ui; @@ -78,7 +78,7 @@ SimpleGlWindow::OnStartUp(void) // create managers and root _AnimationManager::CreateInstance(); - _GlDisplayManager::CreateInstance(); + _DisplayManager::CreateInstance(); __pLayer = _NativeLayer::CreateInstanceN(); SysTryReturn(NID_UI, __pLayer, E_SYSTEM, E_SYSTEM, "[E_SYSTEM] A system error occurred."); @@ -101,10 +101,10 @@ SimpleGlWindow::GetRootVE(void) const void SimpleGlWindow::OnDestroy(void) { - _GlDisplayManager::GetInstance()->UnregisterRoot(*__pRootVisualElement); + _DisplayManager::GetInstance()->UnregisterRoot(*__pRootVisualElement); GetAnimationMgr()->ReleaseInstance(); - _GlDisplayManager::GetInstance()->ReleaseInstance(); + _DisplayManager::GetInstance()->ReleaseInstance(); Tizen::Base::Runtime::_ThreadManager::Finalize(); } @@ -139,7 +139,7 @@ SimpleGlWindow::ProcessRawEvent(const Tizen::Ui::Animations::_RawEvent& rawEvent case _RawEvent::RAWEVENT_DRAW: PRINT("DRAW MESSAGE\n"); - _GlDisplayManager::GetInstance()->RenderAll(false, true); + _DisplayManager::GetInstance()->RenderAll(false, true); break; case _RawEvent::RAWEVENT_FLUSH: @@ -151,7 +151,7 @@ SimpleGlWindow::ProcessRawEvent(const Tizen::Ui::Animations::_RawEvent& rawEvent PRINT("ANIMATE MESSAGE\n"); fflush(stdout); _AnimationManager::GetInstance()->ProcessAnimationTick(); //_GlRenderManager::GetInstance()->Composite(); - _GlDisplayManager::GetInstance()->SetNeedsComposite(true); + _DisplayManager::GetInstance()->SetNeedsComposite(true); break; case _RawEvent::RAWEVENT_TRANSACTION_FINISHED: diff --git a/src/visual-element/src/ve/SimpleGlFW.h b/src/visual-element/src/ve/SimpleGlFW.h index efa0878..0752d62 100644 --- a/src/visual-element/src/ve/SimpleGlFW.h +++ b/src/visual-element/src/ve/SimpleGlFW.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include -- 2.7.4