/*
- * 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.
#include <dali/integration-api/input-options.h>
#include <dali/integration-api/processor-interface.h>
#include <dali/integration-api/profiling.h>
+#include <dali/integration-api/trace.h>
#include <dali/public-api/actors/layer.h>
#include <dali/public-api/events/wheel-event.h>
#include <dali/public-api/object/any.h>
#include <dali/internal/window-system/common/window-impl.h>
#include <dali/internal/window-system/common/window-render-surface.h>
-#include <dali/devel-api/adaptor-framework/accessibility-impl.h>
+#include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
#include <dali/internal/system/common/logging.h>
#include <dali/internal/imaging/common/image-loader-plugin-proxy.h>
{
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)
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());
{
Integration::SetLongPressMinimumHoldingTime(mEnvironmentOptions->GetLongPressMinimumHoldingTime());
}
+ if(mEnvironmentOptions->GetTapMaximumAllowedTime() > 0)
+ {
+ Integration::SetTapMaximumAllowedTime(mEnvironmentOptions->GetTapMaximumAllowedTime());
+ }
std::string systemCachePath = GetSystemCachePath();
if(!systemCachePath.empty())
if(0 != dir_err && errno != EEXIST)
{
DALI_LOG_ERROR("Error creating system cache directory: %s!\n", systemCachePath.c_str());
- exit(1);
}
}
mConfigurationManager = Utils::MakeUnique<ConfigurationManager>(systemCachePath, mGraphics.get(), mThreadController);
-
- auto appName = GetApplicationPackageName();
- auto bridge = Accessibility::Bridge::GetCurrentBridge();
- bridge->SetApplicationName(appName);
- bridge->Initialize();
- Dali::Stage::GetCurrent().KeyEventSignal().Connect(&mAccessibilityObserver, &AccessibilityObserver::OnAccessibleKeyEvent);
}
void Adaptor::AccessibilityObserver::OnAccessibleKeyEvent(const Dali::KeyEvent& event)
// 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;
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();
{
if(*iter == &windowImpl)
{
+ Dali::Mutex::ScopedLock lock(mMutex);
mWindows.erase(iter);
return true;
}
{
if((*iter)->GetName() == childWindowName)
{
+ Dali::Mutex::ScopedLock lock(mMutex);
mWindows.erase(iter);
return true;
}
{
if((*iter)->GetId() == childWindow->GetId())
{
+ Dali::Mutex::ScopedLock lock(mMutex);
mWindows.erase(iter);
return true;
}
void Adaptor::GetWindowContainerInterface(WindowContainer& windows)
{
+ Dali::Mutex::ScopedLock lock(mMutex);
windows = mWindows;
}
{
if(mCore)
{
+ DALI_TRACE_SCOPE(gTraceFilter, "DALI_PROCESS_CORE_EVENTS");
+
if(mPerformanceInterface)
{
mPerformanceInterface->AddMarker(PerformanceInterface::PROCESS_EVENTS_START);
void Adaptor::OnWindowShown()
{
- Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationShown();
-
if(PAUSED_WHILE_HIDDEN == mState)
{
// Adaptor can now be resumed
void Adaptor::OnWindowHidden()
{
- Dali::Accessibility::Bridge::GetCurrentBridge()->ApplicationHidden();
-
if(RUNNING == mState || READY == mState)
{
bool allWindowsHidden = true;
mKernelTracer(),
mSystemTracer(),
mObjectProfiler(nullptr),
+ mMemoryPoolTimerSlotDelegate(this),
mSocketFactory(),
+ mMutex(),
mThreadMode(threadMode),
mEnvironmentOptionsOwned(environmentOptions ? false : true /* If not provided then we own the object */),
mUseRemoteSurface(false),
mCallbackManager->RemoveIdleEntererCallback(callback);
}
+bool Adaptor::MemoryPoolTimeout()
+{
+ mCore->LogMemoryPools();
+ return true; // Keep logging forever
+}
+
} // namespace Adaptor
} // namespace Internal