X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fadaptor-impl.cpp;h=1ab6e709a4627aebfb7e20df34aab8dd04408745;hb=b901daa6ea05561c291aab6ab2e8a5fe6cfd2f8d;hp=2767044689daf615913297476a33c0b7d7f6838e;hpb=c6494f2372eae0712e51442534fd0a00f9699cd5;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 2767044..1ab6e70 100644 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -67,7 +68,7 @@ #include #include -#include +#include #include #include @@ -91,6 +92,7 @@ namespace { thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get +DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false); } // unnamed namespace Dali::Adaptor* Adaptor::New(Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions, ThreadMode threadMode) @@ -187,6 +189,14 @@ void Adaptor::Initialize(GraphicsFactory& graphicsFactory) mObjectProfiler = new ObjectProfiler(mCore->GetObjectRegistry(), timeInterval); } + const uint32_t poolTimeInterval = mEnvironmentOptions->GetMemoryPoolInterval(); + if(0u < poolTimeInterval) + { + mMemoryPoolTimer = Dali::Timer::New(poolTimeInterval * 1000); + mMemoryPoolTimer.TickSignal().Connect(mMemoryPoolTimerSlotDelegate, &Adaptor::MemoryPoolTimeout); + mMemoryPoolTimer.Start(); + } + mNotificationTrigger = TriggerEventFactory::CreateTriggerEvent(MakeCallback(this, &Adaptor::ProcessCoreEvents), TriggerEventInterface::KEEP_ALIVE_AFTER_TRIGGER); mDisplayConnection = Dali::DisplayConnection::New(*mGraphics, defaultWindow->GetSurface()->GetSurfaceType()); @@ -290,6 +300,10 @@ void Adaptor::Initialize(GraphicsFactory& graphicsFactory) { Integration::SetLongPressMinimumHoldingTime(mEnvironmentOptions->GetLongPressMinimumHoldingTime()); } + if(mEnvironmentOptions->GetTapMaximumAllowedTime() > 0) + { + Integration::SetTapMaximumAllowedTime(mEnvironmentOptions->GetTapMaximumAllowedTime()); + } std::string systemCachePath = GetSystemCachePath(); if(!systemCachePath.empty()) @@ -298,17 +312,10 @@ void Adaptor::Initialize(GraphicsFactory& graphicsFactory) if(0 != dir_err && errno != EEXIST) { DALI_LOG_ERROR("Error creating system cache directory: %s!\n", systemCachePath.c_str()); - exit(1); } } mConfigurationManager = Utils::MakeUnique(systemCachePath, mGraphics.get(), mThreadController); - - auto appName = GetApplicationPackageName(); - auto bridge = Accessibility::Bridge::GetCurrentBridge(); - bridge->SetApplicationName(appName); - bridge->Initialize(); - Dali::Stage::GetCurrent().KeyEventSignal().Connect(&accessibilityObserver, &AccessibilityObserver::OnAccessibleKeyEvent); } void Adaptor::AccessibilityObserver::OnAccessibleKeyEvent(const Dali::KeyEvent& event) @@ -384,6 +391,13 @@ void Adaptor::Start() // Start the callback manager mCallbackManager->Start(); + // Initialize accessibility bridge after callback manager is started to use Idler callback + auto appName = GetApplicationPackageName(); + auto bridge = Accessibility::Bridge::GetCurrentBridge(); + bridge->SetApplicationName(appName); + bridge->Initialize(); + Dali::Stage::GetCurrent().KeyEventSignal().Connect(&mAccessibilityObserver, &AccessibilityObserver::OnAccessibleKeyEvent); + Dali::Internal::Adaptor::SceneHolder* defaultWindow = mWindows.front(); unsigned int dpiHor, dpiVer; @@ -669,7 +683,10 @@ bool Adaptor::AddWindow(Dali::Integration::SceneHolder childWindow) windowImpl.GetRootLayer().SetProperty(Dali::Actor::Property::LAYOUT_DIRECTION, mRootLayoutDirection); // Add the new Window to the container - the order is not important - mWindows.push_back(&windowImpl); + { + Dali::Mutex::ScopedLock lock(mMutex); + mWindows.push_back(&windowImpl); + } Dali::RenderSurfaceInterface* surface = windowImpl.GetSurface(); @@ -687,6 +704,7 @@ bool Adaptor::RemoveWindow(Dali::Integration::SceneHolder* childWindow) { if(*iter == &windowImpl) { + Dali::Mutex::ScopedLock lock(mMutex); mWindows.erase(iter); return true; } @@ -701,6 +719,7 @@ bool Adaptor::RemoveWindow(std::string childWindowName) { if((*iter)->GetName() == childWindowName) { + Dali::Mutex::ScopedLock lock(mMutex); mWindows.erase(iter); return true; } @@ -715,6 +734,7 @@ bool Adaptor::RemoveWindow(Internal::Adaptor::SceneHolder* childWindow) { if((*iter)->GetId() == childWindow->GetId()) { + Dali::Mutex::ScopedLock lock(mMutex); mWindows.erase(iter); return true; } @@ -809,6 +829,7 @@ Integration::PlatformAbstraction& Adaptor::GetPlatformAbstraction() const void Adaptor::GetWindowContainerInterface(WindowContainer& windows) { + Dali::Mutex::ScopedLock lock(mMutex); windows = mWindows; } @@ -896,6 +917,8 @@ void Adaptor::ProcessCoreEvents() { if(mCore) { + DALI_TRACE_SCOPE(gTraceFilter, "DALI_PROCESS_CORE_EVENTS"); + if(mPerformanceInterface) { mPerformanceInterface->AddMarker(PerformanceInterface::PROCESS_EVENTS_START); @@ -949,8 +972,6 @@ void Adaptor::RequestProcessEventsOnIdle(bool forceProcess) void Adaptor::OnWindowShown() { - Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationShown(); - if(PAUSED_WHILE_HIDDEN == mState) { // Adaptor can now be resumed @@ -981,8 +1002,6 @@ void Adaptor::OnWindowShown() void Adaptor::OnWindowHidden() { - Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationHidden(); - if(RUNNING == mState || READY == mState) { bool allWindowsHidden = true; @@ -1106,14 +1125,14 @@ const LogFactoryInterface& Adaptor::GetLogFactory() return *mEnvironmentOptions; } -void Adaptor::RegisterProcessor(Integration::Processor& processor) +void Adaptor::RegisterProcessor(Integration::Processor& processor, bool postProcessor) { - GetCore().RegisterProcessor(processor); + GetCore().RegisterProcessor(processor, postProcessor); } -void Adaptor::UnregisterProcessor(Integration::Processor& processor) +void Adaptor::UnregisterProcessor(Integration::Processor& processor, bool postProcessor) { - GetCore().UnregisterProcessor(processor); + GetCore().UnregisterProcessor(processor, postProcessor); } bool Adaptor::IsMultipleWindowSupported() const @@ -1218,7 +1237,9 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, mKernelTracer(), mSystemTracer(), mObjectProfiler(nullptr), + mMemoryPoolTimerSlotDelegate(this), mSocketFactory(), + mMutex(), mThreadMode(threadMode), mEnvironmentOptionsOwned(environmentOptions ? false : true /* If not provided then we own the object */), mUseRemoteSurface(false), @@ -1264,6 +1285,12 @@ void Adaptor::RemoveIdleEnterer(CallbackBase* callback) mCallbackManager->RemoveIdleEntererCallback(callback); } +bool Adaptor::MemoryPoolTimeout() +{ + mCore->LogMemoryPools(); + return true; // Keep logging forever +} + } // namespace Adaptor } // namespace Internal