X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fadaptor%2Fcommon%2Fadaptor-impl.cpp;h=42b930988a36cf4e4a80b2e81efd24766a72ea8e;hb=0611c992765b21bfc0be36074ac3452b3859b28c;hp=ddc912a60c4c6a03efbff719815bb58aeff2dab6;hpb=eab2c5a592922a7cc004b05d86dabefc1e5b4e90;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 ddc912a..42b9309 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 @@ -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()); @@ -302,7 +312,6 @@ 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); } } @@ -908,6 +917,8 @@ void Adaptor::ProcessCoreEvents() { if(mCore) { + DALI_TRACE_SCOPE(gTraceFilter, "DALI_PROCESS_CORE_EVENTS"); + if(mPerformanceInterface) { mPerformanceInterface->AddMarker(PerformanceInterface::PROCESS_EVENTS_START); @@ -1129,6 +1140,15 @@ bool Adaptor::IsMultipleWindowSupported() const return mConfigurationManager->IsMultipleWindowSupported(); } +int32_t Adaptor::GetRenderThreadId() const +{ + if(mThreadController) + { + return mThreadController->GetThreadId(); + } + return 0; +} + void Adaptor::RequestUpdateOnce() { if(mThreadController) @@ -1226,6 +1246,7 @@ Adaptor::Adaptor(Dali::Integration::SceneHolder window, Dali::Adaptor& adaptor, mKernelTracer(), mSystemTracer(), mObjectProfiler(nullptr), + mMemoryPoolTimerSlotDelegate(this), mSocketFactory(), mMutex(), mThreadMode(threadMode), @@ -1273,6 +1294,12 @@ void Adaptor::RemoveIdleEnterer(CallbackBase* callback) mCallbackManager->RemoveIdleEntererCallback(callback); } +bool Adaptor::MemoryPoolTimeout() +{ + mCore->LogMemoryPools(); + return true; // Keep logging forever +} + } // namespace Adaptor } // namespace Internal