From: Heeyong Song Date: Tue, 11 Apr 2023 08:00:30 +0000 (+0900) Subject: [Tizen] Load image loader plugin if requested X-Git-Tag: accepted/tizen/7.0/unified/20230418.141938~2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=c940d649508909d7484a8775d2a13813318ab38c [Tizen] Load image loader plugin if requested It takes long time on lowend chipset even though there is no plugin. Change-Id: I3a1208b43316025704452a3ecbb2e6a8bd332c7a --- diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 81c9aff..cc68bcb 100644 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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. @@ -76,6 +76,7 @@ #include #include +#include #include #include @@ -94,6 +95,8 @@ namespace thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer to allow Adaptor::Get DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_PERFORMANCE_MARKER, false); + +const char* ENABLE_IMAGE_LOADER_PLUGIN_ENV = "DALI_ENABLE_IMAGE_LOADER_PLUGIN"; } // unnamed namespace Dali::Adaptor* Adaptor::New(Dali::Integration::SceneHolder window, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions, ThreadMode threadMode) @@ -419,7 +422,12 @@ void Adaptor::Start() ProcessCoreEvents(); // Ensure any startup messages are processed. // Initialize the image loader plugin - Internal::Adaptor::ImageLoaderPluginProxy::Initialize(); + auto enablePluginString = Dali::EnvironmentVariable::GetEnvironmentVariable(ENABLE_IMAGE_LOADER_PLUGIN_ENV); + bool enablePlugin = enablePluginString ? std::atoi(enablePluginString) : false; + if(enablePlugin) + { + Internal::Adaptor::ImageLoaderPluginProxy::Initialize(); + } for(ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter) { @@ -538,7 +546,12 @@ void Adaptor::Stop() } // Destroy the image loader plugin - Internal::Adaptor::ImageLoaderPluginProxy::Destroy(); + auto enablePluginString = Dali::EnvironmentVariable::GetEnvironmentVariable(ENABLE_IMAGE_LOADER_PLUGIN_ENV); + bool enablePlugin = enablePluginString ? std::atoi(enablePluginString) : false; + if(enablePlugin) + { + Internal::Adaptor::ImageLoaderPluginProxy::Destroy(); + } delete mNotificationTrigger; mNotificationTrigger = NULL;