From 168c4824d5ba72a2dea038f31f1a835e10b5790b Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Tue, 11 Apr 2023 17:00:30 +0900 Subject: [PATCH] Load image loader plugin if requested It takes long time on lowend chipset even though there is no plugin. Change-Id: I3a1208b43316025704452a3ecbb2e6a8bd332c7a --- dali/internal/adaptor/common/adaptor-impl.cpp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 8522cf9..d023730 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) @@ -427,7 +430,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) { @@ -546,7 +554,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; -- 2.7.4