utc-Dali-GraphicsNativeImage.cpp
utc-Dali-GraphicsProgram.cpp
utc-Dali-GraphicsSampler.cpp
+ utc-Dali-GraphicsShader.cpp
utc-Dali-GraphicsTexture.cpp
)
--- /dev/null
+/*
+* Copyright (c) 2024 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+#include <dali-test-suite-utils.h>
+#include <dali/dali.h>
+#include <dali/integration-api/testing.h>
+#include <dali/internal/graphics/gles-impl/gles-graphics-shader.h>
+#include <test-graphics-application.h>
+
+int UtcDaliGlesStripLegacyCodeIfNeededTest1(void)
+{
+ TestGraphicsApplication application;
+
+ {
+ Dali::Graphics::ShaderCreateInfo info;
+ info.SetPipelineStage(Dali::Graphics::PipelineStage::VERTEX_SHADER);
+ std::string vertexShader =
+ "//@version 100\n"
+ "some code\n";
+
+ info.SetShaderVersion(100);
+ info.SetSourceData(vertexShader.data());
+ info.SetSourceSize(vertexShader.size());
+ info.SetSourceMode(Dali::Graphics::ShaderSourceMode::TEXT);
+
+ size_t dataSize = 0;
+ size_t dataIndex = 0;
+ Graphics::GLES::ShaderImpl::StripLegacyCodeIfNeeded(info, dataIndex, dataSize);
+
+ DALI_TEST_EQUALS(dataIndex, 0, TEST_LOCATION);
+ DALI_TEST_EQUALS(dataSize, vertexShader.size(), TEST_LOCATION);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliGlesStripLegacyCodeTestDifferentPrefix(void)
+{
+ TestGraphicsApplication application;
+
+ std::string vertexShader =
+ "//@version 100\n"
+ "some code\n";
+
+ std::string somePrefix =
+ "This is some prefix\n";
+
+ auto newVertexPrefix = Dali::Integration::Test::GenerateTaggedShaderPrefix(somePrefix);
+ {
+ Dali::Graphics::ShaderCreateInfo info;
+ info.SetPipelineStage(Dali::Graphics::PipelineStage::VERTEX_SHADER);
+
+ std::string prefixedVertexShader = newVertexPrefix + vertexShader;
+
+ info.SetShaderVersion(100);
+ info.SetSourceData(prefixedVertexShader.data());
+ info.SetSourceSize(prefixedVertexShader.size());
+ info.SetSourceMode(Dali::Graphics::ShaderSourceMode::TEXT);
+
+ size_t dataSize = 0;
+ size_t dataIndex = 0;
+ Graphics::GLES::ShaderImpl::StripLegacyCodeIfNeeded(info, dataIndex, dataSize);
+
+ auto index = prefixedVertexShader.find("//@version");
+
+ DALI_TEST_EQUALS(dataIndex, index, TEST_LOCATION);
+
+ // should match original shader size
+ DALI_TEST_EQUALS(dataSize, vertexShader.size(), TEST_LOCATION);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliGlesStripLegacyCodeIfNeededTest2(void)
+{
+ TestGraphicsApplication application;
+
+ std::string vertexShader =
+ "//@version 100\n"
+ "some code\n";
+
+ auto vertexPrefix = Dali::Shader::GetVertexShaderPrefix();
+
+ {
+ Dali::Graphics::ShaderCreateInfo info;
+ info.SetPipelineStage(Dali::Graphics::PipelineStage::VERTEX_SHADER);
+
+ std::string prefixedVertexShader = Dali::Shader::GetVertexShaderPrefix() + vertexShader;
+
+ info.SetShaderVersion(100);
+ info.SetSourceData(prefixedVertexShader.data());
+ info.SetSourceSize(prefixedVertexShader.size());
+ info.SetSourceMode(Dali::Graphics::ShaderSourceMode::TEXT);
+
+ size_t dataSize = 0;
+ size_t dataIndex = 0;
+ Graphics::GLES::ShaderImpl::StripLegacyCodeIfNeeded(info, dataIndex, dataSize);
+
+ DALI_TEST_EQUALS(dataIndex, vertexPrefix.length(), TEST_LOCATION);
+
+ // should match original shader size
+ DALI_TEST_EQUALS(dataSize, vertexShader.size(), TEST_LOCATION);
+ }
+
+ END_TEST;
+}
\ No newline at end of file
CHECK_MODULE_AND_SET( XDAMAGE xdamage [] )
CHECK_MODULE_AND_SET( XFIXES xfixes [] )
CHECK_MODULE_AND_SET( XINPUT xi [] )
+CHECK_MODULE_AND_SET( XRENDER xrender [] )
CHECK_MODULE_AND_SET( CAPI_SYSTEM_INFO capi-system-info [] )
CHECK_MODULE_AND_SET( CAPI_SYSTEM_SENSOR capi-system-sensor capi_system_sensor_support )
${XDAMAGE_CFLAGS}
${XFIXES_CFLAGS}
${XINPUT_CFLAGS}
+ ${XRENDER_CFLAGS}
)
SET( DALI_LDFLAGS ${DALI_LDFLAGS}
${XDAMAGE_LDFLAGS}
${XFIXES_LDFLAGS}
${XINPUT_LDFLAGS}
+ ${XRENDER_LDFLAGS}
)
ELSE()
void BridgeBase::ForceDown()
{
Bridge::ForceDown();
+ tickTimer.Reset();
+ mCoalescableMessages.clear();
mRegistry = {};
mDbusServer = {};
mConnectionPtr = {};
SET_OFFSET, ///< Set offset
POST_RENDER, ///< Post render
STATE_CHANGED_BEGIN = 500, ///< State changed (begin of reserved range)
- STATE_CHANGED_END = 599, ///< State changed (end of reserved range)
- // <- any enum value declared here will have the value 600
+ STATE_CHANGED_END = STATE_CHANGED_BEGIN + 99, ///< State changed (end of reserved range)
+ PROPERTY_CHANGED_BEGIN, ///< Property changed (begin of reserved range)
+ PROPERTY_CHANGED_END = PROPERTY_CHANGED_BEGIN + 99, ///< Property changed (end of reserved range)
};
// Custom specialization of std::hash
if(eventName != eventMap.end())
{
- mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
- GetAccessiblePath(obj),
- Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
- "PropertyChange",
- std::string{eventName->second},
- 0,
- 0,
- {0},
- {"", "root"});
+ AddCoalescableMessage(static_cast<CoalescableMessages>(static_cast<int>(CoalescableMessages::PROPERTY_CHANGED_BEGIN) + static_cast<int>(event)), obj, 1.0f, [=]() {
+ mDbusServer.emit2<std::string, int, int, DBus::EldbusVariant<int>, Address>(
+ GetAccessiblePath(obj),
+ Accessible::GetInterfaceName(AtspiInterface::EVENT_OBJECT),
+ "PropertyChange",
+ std::string{eventName->second},
+ 0,
+ 0,
+ {0},
+ {"", "root"});
+ });
}
}
void BridgeObject::EmitPostRender(Accessible *obj)
{
+ if(!IsUp() || obj->IsHidden())
+ {
+ return;
+ }
+
AddCoalescableMessage(CoalescableMessages::POST_RENDER, obj, 0.5f, [=]() {
Emit(obj, WindowEvent::POST_RENDER);
});
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)
ProcessCoreEvents(); // Ensure any startup messages are processed.
// Initialize the image loader plugin
- auto enablePluginString = Dali::EnvironmentVariable::GetEnvironmentVariable(ENABLE_IMAGE_LOADER_PLUGIN_ENV);
+ auto enablePluginString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_ENABLE_IMAGE_LOADER_PLUGIN);
bool enablePlugin = enablePluginString ? std::atoi(enablePluginString) : false;
if(enablePlugin)
{
}
// Destroy the image loader plugin
- auto enablePluginString = Dali::EnvironmentVariable::GetEnvironmentVariable(ENABLE_IMAGE_LOADER_PLUGIN_ENV);
+ auto enablePluginString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_ENABLE_IMAGE_LOADER_PLUGIN);
bool enablePlugin = enablePluginString ? std::atoi(enablePluginString) : false;
if(enablePlugin)
{
}
}
}
+ else
+ {
+ DALI_LOG_RELEASE_INFO("DALI Rendering skip (upload only)\n");
+ }
TRACE_UPDATE_RENDER_BEGIN("DALI_POST_RENDER");
if(!uploadOnly)
namespace Adaptor
{
EglSyncObject::EglSyncObject(EglImplementation& eglImpl)
-: mPollCounter(3),
+: mEglSync(NULL),
+ mPollCounter(3),
mEglImplementation(eglImpl)
{
}
namespace Adaptor
{
EglSyncObject::EglSyncObject(EglImplementation& eglImpl)
-: mPollCounter(3),
+: mEglSync(NULL),
+ mPollCounter(3),
mEglImplementation(eglImpl)
{
EGLDisplay display = mEglImplementation.GetDisplay();
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
createInfo.pipelineStage = _createInfo.pipelineStage;
createInfo.shaderlanguage = _createInfo.shaderlanguage;
createInfo.sourceMode = _createInfo.sourceMode;
- createInfo.sourceSize = _createInfo.sourceSize;
+ createInfo.shaderVersion = _createInfo.shaderVersion;
- // Make a copy of source code
- source.resize(_createInfo.sourceSize);
- std::copy(reinterpret_cast<const uint8_t*>(_createInfo.sourceData),
- reinterpret_cast<const uint8_t*>(_createInfo.sourceData) + _createInfo.sourceSize,
+ // Make a copy of source code. if code is meant to be used
+ // by modern parser, skip the prefix part
+ size_t dataStartIndex = 0;
+ size_t dataSize;
+
+ ShaderImpl::StripLegacyCodeIfNeeded( _createInfo, dataStartIndex, dataSize );
+
+ source.resize(dataSize);
+ std::copy(reinterpret_cast<const uint8_t*>(_createInfo.sourceData) + dataStartIndex,
+ reinterpret_cast<const uint8_t*>(_createInfo.sourceData) + dataSize,
source.data());
// Substitute pointer
createInfo.sourceData = source.data();
+ createInfo.sourceSize = dataSize;
}
~Impl(){};
return mImpl->controller;
}
+void ShaderImpl::StripLegacyCodeIfNeeded(const ShaderCreateInfo& info, size_t& startIndex, size_t& finalDataSize)
+{
+ // Make a copy of source code. if code is meant to be used
+ // by modern parser, skip the prefix part
+ if(info.shaderVersion != 0)
+ {
+ auto text = reinterpret_cast<const char*>(info.sourceData);
+ auto result = std::string_view(text).find("//@legacy-prefix-end");
+ if(result != 0 && result != std::string::npos)
+ {
+ DALI_LOG_ERROR("Shader processing: @legacy-prefix-end must be a very first statement!\n");
+ }
+ else if(result == 0)
+ {
+ char* end;
+ startIndex = std::strtoul(reinterpret_cast<const char*>(info.sourceData) + 21, &end, 10);
+ }
+ }
+
+ finalDataSize = info.sourceSize - startIndex;
+}
+
Shader::~Shader()
{
if(!mShader->Release())
#define DALI_GRAPHICS_GLES_SHADER_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
[[nodiscard]] EglGraphicsController& GetController() const;
+ /**
+ * Strips legacy prefix fromt he GLSL source code if necessary
+ * @param info valid ShaderCreateInfo strucutre
+ * @param[out] startIndex Start index of the source code
+ * @param[out] finalDataSize Size of trimmed data
+ */
+ static void StripLegacyCodeIfNeeded(const ShaderCreateInfo& info, size_t& startIndex, size_t& finalDataSize);
+
private:
friend class Shader;
struct Impl;
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/devel-api/adaptor-framework/environment-variable.h>
#include <dali/internal/graphics/gles/egl-debug.h>
#include <dali/internal/graphics/gles/gl-implementation.h>
+#include <dali/internal/system/common/environment-variables.h>
#include <dali/internal/system/common/time-service.h>
#include <dali/public-api/dali-adaptor-common.h>
const char* EGL_KHR_PARTIAL_UPDATE = "EGL_KHR_partial_update";
const char* EGL_KHR_SWAP_BUFFERS_WITH_DAMAGE = "EGL_KHR_swap_buffers_with_damage";
-// Threshold time in miliseconds
-constexpr auto PERFORMANCE_LOG_THRESHOLD_TIME_ENV = "DALI_EGL_PERFORMANCE_LOG_THRESHOLD_TIME";
-
DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_EGL, true);
static uint32_t GetPerformanceLogThresholdTime()
{
- auto timeString = Dali::EnvironmentVariable::GetEnvironmentVariable(PERFORMANCE_LOG_THRESHOLD_TIME_ENV);
+ auto timeString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_EGL_PERFORMANCE_LOG_THRESHOLD_TIME);
uint32_t time = timeString ? static_cast<uint32_t>(std::atoi(timeString)) : std::numeric_limits<uint32_t>::max();
return time;
}
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// EXTERNAL INCLUDES
#include <limits>
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-variables.h>
+
namespace Dali
{
namespace Internal
static constexpr const char* OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3 = "#extension GL_OES_EGL_image_external_essl3:require\n";
-// Threshold time in miliseconds
-constexpr auto PERFORMANCE_LOG_THRESHOLD_TIME_ENV = "DALI_EGL_PERFORMANCE_LOG_THRESHOLD_TIME";
-
static uint32_t GetPerformanceLogThresholdTime()
{
- auto timeString = Dali::EnvironmentVariable::GetEnvironmentVariable(PERFORMANCE_LOG_THRESHOLD_TIME_ENV);
+ auto timeString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_EGL_PERFORMANCE_LOG_THRESHOLD_TIME);
uint32_t time = timeString ? static_cast<uint32_t>(std::atoi(timeString)) : std::numeric_limits<uint32_t>::max();
return time;
}
namespace Adaptor
{
EglSyncObject::EglSyncObject(EglImplementation& eglImpl)
-: mPollCounter(3),
+: mEglSync(NULL),
+ mPollCounter(3),
mEglImplementation(eglImpl)
{
}
#else
EglSyncObject::EglSyncObject(EglImplementation& eglImpl)
-: mPollCounter(3),
+: mEglSync(NULL),
+ mPollCounter(3),
mEglImplementation(eglImpl)
{
}
namespace Adaptor
{
EglSyncObject::EglSyncObject(EglImplementation& eglImpl)
-: mPollCounter(3),
+: mEglSync(NULL),
+ mPollCounter(3),
mEglImplementation(eglImpl)
{
}
#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/graphics/common/egl-image-extensions.h>
#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/system/common/environment-variables.h>
namespace Dali
{
constexpr int32_t NUM_FORMATS_BLENDING_REQUIRED = 18;
constexpr int32_t DEFAULT_TBM_SURFACE_QUEUE_SIZE = 3u;
-constexpr auto TBM_SURFACE_QUEUE_SIZE = "DALI_TBM_SURFACE_QUEUE_SIZE";
int32_t GetTbmSurfaceQueueSize()
{
- static auto queueSizeString = EnvironmentVariable::GetEnvironmentVariable(TBM_SURFACE_QUEUE_SIZE);
+ static auto queueSizeString = EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_TBM_SURFACE_QUEUE_SIZE);
static int32_t queueSize = queueSizeString ? std::atoi(queueSizeString) : DEFAULT_TBM_SURFACE_QUEUE_SIZE;
return queueSize;
}
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/internal/system/common/logging.h>
// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <log.h>
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-variables.h>
+
namespace Dali
{
namespace TizenPlatform
{
+namespace
+{
+static Dali::Integration::Log::DebugPriority gPrintLogLevel = Dali::Integration::Log::DebugPriority::INFO;
+
+Dali::Integration::Log::DebugPriority GetAllowedPrintLogLevel()
+{
+ static bool gEnvironmentApplied = false;
+
+ if(DALI_UNLIKELY(!gEnvironmentApplied))
+ {
+ gEnvironmentApplied = true;
+
+ const char* printLogLevel = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_PRINT_LOG_LEVEL);
+ if(printLogLevel)
+ {
+ auto logLevelInteger = std::strtoul(printLogLevel, nullptr, 10);
+ if(logLevelInteger >= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::DEBUG) && logLevelInteger <= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::ERROR))
+ {
+ gPrintLogLevel = static_cast<Dali::Integration::Log::DebugPriority>(logLevelInteger);
+ }
+ }
+ }
+
+ return gPrintLogLevel;
+}
+} // namespace
+
void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
{
const char* DALI_TAG = "DALI";
+ if(level < GetAllowedPrintLogLevel())
+ {
+ return;
+ }
switch(level)
{
#include <dali/integration-api/adaptor-framework/adaptor.h>
#include <dali/integration-api/debug.h>
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-variables.h>
+
#include <unordered_map>
namespace Dali
constexpr auto FORCE_TRIGGER_THRESHOLD = 128u; ///< Trigger TasksCompleted() forcely if the number of completed task contain too much.
constexpr auto DEFAULT_NUMBER_OF_ASYNC_THREADS = size_t{8u};
-constexpr auto NUMBER_OF_ASYNC_THREADS_ENV = "DALI_ASYNC_MANAGER_THREAD_POOL_SIZE";
// The number of threads for low priority task.
constexpr auto DEFAULT_NUMBER_OF_LOW_PRIORITY_THREADS = size_t{6u};
-constexpr auto NUMBER_OF_LOW_PRIORITY_THREADS_ENV = "DALI_ASYNC_MANAGER_LOW_PRIORITY_THREAD_POOL_SIZE";
-size_t GetNumberOfThreads(const char* environmentVariable, size_t defaultValue)
+size_t GetNumberOfThreads(size_t defaultValue)
{
- auto numberString = EnvironmentVariable::GetEnvironmentVariable(environmentVariable);
+ auto numberString = EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_ASYNC_MANAGER_THREAD_POOL_SIZE);
auto numberOfThreads = numberString ? std::strtoul(numberString, nullptr, 10) : 0;
constexpr auto MAX_NUMBER_OF_THREADS = 16u;
DALI_ASSERT_DEBUG(numberOfThreads <= MAX_NUMBER_OF_THREADS);
return (numberOfThreads > 0 && numberOfThreads <= MAX_NUMBER_OF_THREADS) ? numberOfThreads : defaultValue;
}
-size_t GetNumberOfLowPriorityThreads(const char* environmentVariable, size_t defaultValue, size_t maxValue)
+size_t GetNumberOfLowPriorityThreads(size_t defaultValue, size_t maxValue)
{
- auto numberString = EnvironmentVariable::GetEnvironmentVariable(environmentVariable);
+ auto numberString = EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_ASYNC_MANAGER_LOW_PRIORITY_THREAD_POOL_SIZE);
auto numberOfThreads = numberString ? std::strtoul(numberString, nullptr, 10) : 0;
DALI_ASSERT_DEBUG(numberOfThreads <= maxValue);
return (numberOfThreads > 0 && numberOfThreads <= maxValue) ? numberOfThreads : std::min(defaultValue, maxValue);
}
AsyncTaskManager::AsyncTaskManager()
-: mTasks(GetNumberOfThreads(NUMBER_OF_ASYNC_THREADS_ENV, DEFAULT_NUMBER_OF_ASYNC_THREADS), [&]() { return TaskHelper(*this); }),
- mAvaliableLowPriorityTaskCounts(GetNumberOfLowPriorityThreads(NUMBER_OF_LOW_PRIORITY_THREADS_ENV, DEFAULT_NUMBER_OF_LOW_PRIORITY_THREADS, mTasks.GetElementCount())),
+: mTasks(GetNumberOfThreads(DEFAULT_NUMBER_OF_ASYNC_THREADS), [&]() { return TaskHelper(*this); }),
+ mAvaliableLowPriorityTaskCounts(GetNumberOfLowPriorityThreads(DEFAULT_NUMBER_OF_LOW_PRIORITY_THREADS, mTasks.GetElementCount())),
mWaitingHighProirityTaskCounts(0u),
mTrigger(new EventThreadCallback(MakeCallback(this, &AsyncTaskManager::TasksCompleted))),
mTasksCompletedImpl(new TasksCompletedImpl(*this, mTrigger.get())),
{
Mutex::ScopedLock lock(mTasksMutex);
- size_t count = mTasks.GetElementCount();
- size_t index = 0;
+ size_t count = mTasks.GetElementCount();
+ size_t index = 0;
while(index++ < count)
{
auto processHelperIt = mTasks.GetNext();
#define DALI_ENV_DISABLE_VSYNC_RENDER "DALI_DISABLE_VSYNC_RENDER"
+#define DALI_ENV_ENABLE_IMAGE_LOADER_PLUGIN "DALI_ENABLE_IMAGE_LOADER_PLUGIN"
+
+// Threshold time in miliseconds when we want to print the egl performance as a warning.
+#define DALI_ENV_EGL_PERFORMANCE_LOG_THRESHOLD_TIME "DALI_EGL_PERFORMANCE_LOG_THRESHOLD_TIME"
+
+#define DALI_ENV_TBM_SURFACE_QUEUE_SIZE "DALI_TBM_SURFACE_QUEUE_SIZE"
+
+#define DALI_ENV_ASYNC_MANAGER_THREAD_POOL_SIZE "DALI_ASYNC_MANAGER_THREAD_POOL_SIZE"
+
+#define DALI_ENV_ASYNC_MANAGER_LOW_PRIORITY_THREAD_POOL_SIZE "DALI_ASYNC_MANAGER_LOW_PRIORITY_THREAD_POOL_SIZE"
+
+// Glyph Cache
+#define DALI_ENV_MAX_NUMBER_OF_GLYPH_CACHE "DALI_GLYPH_CACHE_MAX"
+
+#define DALI_ENV_ENABLE_CACHE_RENDERED_GLYPH "DALI_ENABLE_CACHE_RENDERED_GLYPH"
+
+#define DALI_ENV_RENDERED_GLYPH_COMPRESS_POLICY "DALI_RENDERED_GLYPH_COMPRESS_POLICY"
+
// Debug relative environments
#define DALI_ENV_CURLOPT_VERBOSE_MODE "DALI_CURLOPT_VERBOSE_MODE"
+#define DALI_ENV_PRINT_LOG_LEVEL "DALI_PRINT_LOG_LEVEL"
+
+#define DALI_ENV_TRACE_ENABLE_PRINT_LOG "DALI_TRACE_ENABLE_PRINT_LOG"
+
} // namespace Adaptor
} // namespace Internal
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// Dlog uses C style casts internally
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wold-style-cast"
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <dlog.h>
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-variables.h>
+
namespace Dali
{
namespace TizenPlatform
{
+namespace
+{
+static Dali::Integration::Log::DebugPriority gPrintLogLevel = Dali::Integration::Log::DebugPriority::DEBUG;
+
+Dali::Integration::Log::DebugPriority GetAllowedPrintLogLevel()
+{
+ static bool gEnvironmentApplied = false;
+
+ if(DALI_UNLIKELY(!gEnvironmentApplied))
+ {
+ gEnvironmentApplied = true;
+
+ const char* printLogLevel = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_PRINT_LOG_LEVEL);
+ if(printLogLevel)
+ {
+ auto logLevelInteger = std::strtoul(printLogLevel, nullptr, 10);
+ if(logLevelInteger >= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::DEBUG) && logLevelInteger <= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::ERROR))
+ {
+ gPrintLogLevel = static_cast<Dali::Integration::Log::DebugPriority>(logLevelInteger);
+ }
+ }
+ }
+
+ return gPrintLogLevel;
+}
+} // namespace
void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
{
const char* DALI_TAG = "DALI";
+ if(level < GetAllowedPrintLogLevel())
+ {
+ return;
+ }
switch(level)
{
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/internal/system/common/logging.h>
// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <cstdio>
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-variables.h>
+
namespace Dali
{
namespace TizenPlatform
{
+namespace
+{
+static Dali::Integration::Log::DebugPriority gPrintLogLevel = Dali::Integration::Log::DebugPriority::INFO;
+
+Dali::Integration::Log::DebugPriority GetAllowedPrintLogLevel()
+{
+ static bool gEnvironmentApplied = false;
+
+ if(DALI_UNLIKELY(!gEnvironmentApplied))
+ {
+ gEnvironmentApplied = true;
+
+ const char* printLogLevel = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_PRINT_LOG_LEVEL);
+ if(printLogLevel)
+ {
+ auto logLevelInteger = std::strtoul(printLogLevel, nullptr, 10);
+ if(logLevelInteger >= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::DEBUG) && logLevelInteger <= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::ERROR))
+ {
+ gPrintLogLevel = static_cast<Dali::Integration::Log::DebugPriority>(logLevelInteger);
+ }
+ }
+ }
+
+ return gPrintLogLevel;
+}
+} // namespace
void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
{
const char* DALI_TAG = "DALI";
const char* format = NULL;
+ if(level < GetAllowedPrintLogLevel())
+ {
+ return;
+ }
+
switch(level)
{
case Dali::Integration::Log::DEBUG: ///< Gray color
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/internal/system/common/logging.h>
// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
#include <cstdio>
+// INTERNAL INCLUDES
+#include <dali/internal/system/common/environment-variables.h>
+
namespace Dali
{
namespace TizenPlatform
{
+namespace
+{
+static Dali::Integration::Log::DebugPriority gPrintLogLevel = Dali::Integration::Log::DebugPriority::INFO;
+
+Dali::Integration::Log::DebugPriority GetAllowedPrintLogLevel()
+{
+ static bool gEnvironmentApplied = false;
+
+ if(DALI_UNLIKELY(!gEnvironmentApplied))
+ {
+ gEnvironmentApplied = true;
+
+ const char* printLogLevel = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_PRINT_LOG_LEVEL);
+ if(printLogLevel)
+ {
+ auto logLevelInteger = std::strtoul(printLogLevel, nullptr, 10);
+ if(logLevelInteger >= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::DEBUG) && logLevelInteger <= static_cast<unsigned long>(Dali::Integration::Log::DebugPriority::ERROR))
+ {
+ gPrintLogLevel = static_cast<Dali::Integration::Log::DebugPriority>(logLevelInteger);
+ }
+ }
+ }
+
+ return gPrintLogLevel;
+}
+} // namespace
+
void LogMessage(Dali::Integration::Log::DebugPriority level, std::string& message)
{
const char* DALI_TAG = "DALI";
const char* format = NULL;
+ if(level < GetAllowedPrintLogLevel())
+ {
+ return;
+ }
+
switch(level)
{
case Dali::Integration::Log::DEBUG: ///< Gray color
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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/devel-api/adaptor-framework/environment-variable.h>
#include <dali/devel-api/adaptor-framework/file-loader.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/internal/system/common/environment-variables.h>
#include <dali/internal/system/common/logging.h>
#include <dali/internal/text/text-abstraction/font-client-impl.h>
#include <dali/internal/text/text-abstraction/plugin/font-client-plugin-impl.h>
namespace
{
-
DALI_INIT_TRACE_FILTER(gTraceFilter, DALI_TRACE_FONT_PERFORMANCE_MARKER, false);
/**
*/
inline size_t GetMaxNumberOfGlyphCache()
{
- using Dali::EnvironmentVariable::GetEnvironmentVariable;
- static auto numberString = GetEnvironmentVariable(MAX_NUMBER_OF_GLYPH_CACHE_ENV);
+ static auto numberString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_MAX_NUMBER_OF_GLYPH_CACHE);
static auto number = numberString ? std::strtoul(numberString, nullptr, 10) : DEFAULT_GLYPH_CACHE_MAX;
return (number < MINIMUM_SIZE_OF_GLYPH_CACHE_MAX) ? MINIMUM_SIZE_OF_GLYPH_CACHE_MAX : number;
}
if(matched && (nullptr != characterSet))
{
- #if defined(TRACE_ENABLED)
+#if defined(TRACE_ENABLED)
if(gTraceFilter && gTraceFilter->IsTraceEnabled())
{
DALI_LOG_DEBUG_INFO("DALI_TEXT_VALIDATE_FONT : FcFontMatch : %s, style : %s, %s, %s\n", fontDescription.family.c_str(), FontWidth::Name[fontDescription.width], FontWeight::Name[fontDescription.weight], FontSlant::Name[fontDescription.slant]);
}
- #endif
+#endif
// Add the path to the cache.
description.type = FontDescription::FACE_FONT;
DALI_TRACE_SCOPE(gTraceFilter, "DALI_TEXT_FALLBACK_FONTLIST");
- #if defined(TRACE_ENABLED)
+#if defined(TRACE_ENABLED)
if(gTraceFilter && gTraceFilter->IsTraceEnabled())
{
DALI_LOG_DEBUG_INFO("DALI_TEXT_FALLBACK_FONTLIST : FcFontSort : %s\n", fontDescription.family.c_str());
}
- #endif
+#endif
fontList = new FontList;
characterSetList = new CharacterSetList;
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// INTERNAL HEADERS
#include <dali/devel-api/adaptor-framework/environment-variable.h>
+#include <dali/internal/system/common/environment-variables.h>
#include <dali/internal/text/text-abstraction/plugin/font-client-utils.h>
#include <dali/internal/text/text-abstraction/plugin/font-face-cache-item.h>
* @brief Behavior about cache the rendered glyph cache.
*/
constexpr bool DEFAULT_ENABLE_CACHE_RENDERED_GLYPH = true;
-constexpr auto ENABLE_CACHE_RENDERED_GLYPH_ENV = "DALI_ENABLE_CACHE_RENDERED_GLYPH";
/**
* @brief Get whether we allow to cache rendered glyph from environment.
*/
inline bool EnableCacheRenderedGlyph()
{
- using Dali::EnvironmentVariable::GetEnvironmentVariable;
- static auto numberString = GetEnvironmentVariable(ENABLE_CACHE_RENDERED_GLYPH_ENV);
+ static auto numberString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_ENABLE_CACHE_RENDERED_GLYPH);
static auto number = numberString ? (std::strtoul(numberString, nullptr, 10) ? true : false) : DEFAULT_ENABLE_CACHE_RENDERED_GLYPH;
return number;
}
#else
GlyphCacheManager::CompressionPolicyType::SPEED; // If not tizen target
#endif
-constexpr auto RENDERED_GLYPH_COMPRESS_POLICY_ENV = "DALI_RENDERED_GLYPH_COMPRESS_POLICY";
/**
* @brief Get whether we allow to cache rendered glyph from environment.
*/
inline GlyphCacheManager::CompressionPolicyType GetRenderedGlyphCompressPolicy()
{
- using Dali::EnvironmentVariable::GetEnvironmentVariable;
- static auto policyString = GetEnvironmentVariable(RENDERED_GLYPH_COMPRESS_POLICY_ENV);
+ static auto policyString = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_RENDERED_GLYPH_COMPRESS_POLICY);
static auto policy = policyString ? policyString[0] == 's' || policyString[0] == 'S' ? GlyphCacheManager::CompressionPolicyType::SPEED
: policyString[0] == 'm' || policyString[0] == 'M' ? GlyphCacheManager::CompressionPolicyType::MEMORY
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
+#include <dali/internal/system/common/environment-variables.h>
namespace Dali
{
{
namespace
{
-const char* DALI_TRACE_ENABLE_PRINT_LOG_ENV = "DALI_TRACE_ENABLE_PRINT_LOG";
-const char* EMPTY_TAG = "(null)";
-static bool gTraceManagerEnablePrintLog = false;
+const char* EMPTY_TAG = "(null)";
+static bool gTraceManagerEnablePrintLog = false;
} // namespace
TraceManagerAndroid* TraceManagerAndroid::traceManagerAndroid = nullptr;
TraceManagerAndroid::TraceManagerAndroid(PerformanceInterface* performanceInterface)
: TraceManager(performanceInterface)
{
- const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_TRACE_ENABLE_PRINT_LOG_ENV);
+ const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_TRACE_ENABLE_PRINT_LOG);
if(enablePrintLog && std::atoi(enablePrintLog) != 0)
{
gTraceManagerEnablePrintLog = true;
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
+#include <dali/internal/system/common/environment-variables.h>
namespace Dali
{
{
namespace
{
-const char* DALI_TRACE_ENABLE_PRINT_LOG_ENV = "DALI_TRACE_ENABLE_PRINT_LOG";
-const char* EMPTY_TAG = "(null)";
-static bool gTraceManagerEnablePrintLog = false;
+const char* EMPTY_TAG = "(null)";
+static bool gTraceManagerEnablePrintLog = false;
} // namespace
TraceManagerGeneric* TraceManagerGeneric::traceManagerGeneric = nullptr;
TraceManagerGeneric::TraceManagerGeneric(PerformanceInterface* performanceInterface)
: TraceManager(performanceInterface)
{
- const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_TRACE_ENABLE_PRINT_LOG_ENV);
+ const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_TRACE_ENABLE_PRINT_LOG);
if(enablePrintLog && std::atoi(enablePrintLog) != 0)
{
gTraceManagerEnablePrintLog = true;
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
+#include <dali/internal/system/common/environment-variables.h>
#include <dali/internal/trace/streamline/streamline_annotate.h>
ANNOTATE_DEFINE;
{
namespace
{
-const char* DALI_TRACE_ENABLE_PRINT_LOG_ENV = "DALI_TRACE_ENABLE_PRINT_LOG";
-const char* EMPTY_TAG = "(null)";
-bool gTraceManagerEnablePrintLog = false;
+const char* EMPTY_TAG = "(null)";
+bool gTraceManagerEnablePrintLog = false;
} // namespace
TraceManagerStreamline* TraceManagerStreamline::traceManagerStreamline = nullptr;
: TraceManager(performanceInterface)
{
ANNOTATE_SETUP;
- const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_TRACE_ENABLE_PRINT_LOG_ENV);
+ const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_TRACE_ENABLE_PRINT_LOG);
if(enablePrintLog && std::atoi(enablePrintLog) != 0)
{
gTraceManagerEnablePrintLog = true;
// INTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/environment-variable.h>
+#include <dali/internal/system/common/environment-variables.h>
namespace Dali
{
{
namespace
{
-const char* DALI_TRACE_ENABLE_PRINT_LOG_ENV = "DALI_TRACE_ENABLE_PRINT_LOG";
-const char* EMPTY_TAG = "(null)";
-static bool gTraceManagerEnablePrintLog = false;
+const char* EMPTY_TAG = "(null)";
+static bool gTraceManagerEnablePrintLog = false;
} // namespace
TraceManagerTizen::TraceManagerTizen(PerformanceInterface* performanceInterface)
: TraceManager(performanceInterface)
{
- const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_TRACE_ENABLE_PRINT_LOG_ENV);
+ const char* enablePrintLog = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_TRACE_ENABLE_PRINT_LOG);
if(enablePrintLog && std::atoi(enablePrintLog) != 0)
{
gTraceManagerEnablePrintLog = true;
void SetGeometryHittestEnabled(bool enable)
{
DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
- gGeometryHittest = enable;
- if(gGeometryHittest && Dali::Adaptor::IsAvailable())
+ if(gGeometryHittest != enable && Dali::Adaptor::IsAvailable())
{
Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
}
}
}
+ gGeometryHittest = enable;
}
bool IsGeometryHittestEnabled()
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
void SetGeometryHittestEnabled(bool enable)
{
DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
- gGeometryHittest = enable;
- if(gGeometryHittest)
+ if(gGeometryHittest != enable)
{
Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
}
}
}
+ gGeometryHittest = enable;
}
bool IsGeometryHittestEnabled()
void SetGeometryHittestEnabled(bool enable)
{
DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
- gGeometryHittest = enable;
- if(gGeometryHittest && Dali::Adaptor::IsAvailable())
+ if(gGeometryHittest != enable && Dali::Adaptor::IsAvailable())
{
Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
}
}
}
+ gGeometryHittest = enable;
}
bool IsGeometryHittestEnabled()
deviceSubclass = Device::Subclass::VIRTUAL_KEYBOARD;
break;
}
- case ECORE_DEVICE_SUBCLASS_VIRTUAL_REMOCON:
- {
- deviceSubclass = Device::Subclass::VIRTUAL_REMOCON;
- break;
- }
- case ECORE_DEVICE_SUBCLASS_VIRTUAL_MOUSE:
- {
- deviceSubclass = Device::Subclass::VIRTUAL_MOUSE;
- break;
- }
default:
{
deviceSubclass = Device::Subclass::NONE;
void SetGeometryHittestEnabled(bool enable)
{
DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
- gGeometryHittest = enable;
- if(gGeometryHittest && Dali::Adaptor::IsAvailable())
+ if(gGeometryHittest != enable && Dali::Adaptor::IsAvailable())
{
Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
}
}
}
+ gGeometryHittest = enable;
}
bool IsGeometryHittestEnabled()
void SetGeometryHittestEnabled(bool enable)
{
DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
- gGeometryHittest = enable;
- if(gGeometryHittest && Dali::Adaptor::IsAvailable())
+ if(gGeometryHittest != enable && Dali::Adaptor::IsAvailable())
{
Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
}
}
}
+ gGeometryHittest = enable;
}
bool IsGeometryHittestEnabled()
void SetGeometryHittestEnabled(bool enable)
{
DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
- gGeometryHittest = enable;
- if(gGeometryHittest && Dali::Adaptor::IsAvailable())
+ if(gGeometryHittest != enable && Dali::Adaptor::IsAvailable())
{
Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
}
}
}
+ gGeometryHittest = enable;
}
bool IsGeometryHittestEnabled()
void SetGeometryHittestEnabled(bool enable)
{
DALI_LOG_RELEASE_INFO("GeometryHittest : %d \n", enable);
- gGeometryHittest = enable;
- if(gGeometryHittest && Dali::Adaptor::IsAvailable())
+ if(gGeometryHittest != enable && Dali::Adaptor::IsAvailable())
{
Dali::SceneHolderList sceneHolders = Dali::Adaptor::Get().GetSceneHolders();
for(auto iter = sceneHolders.begin(); iter != sceneHolders.end(); ++iter)
}
}
}
+ gGeometryHittest = enable;
}
bool IsGeometryHittestEnabled()
{
const unsigned int ADAPTOR_MAJOR_VERSION = 2;
const unsigned int ADAPTOR_MINOR_VERSION = 3;
-const unsigned int ADAPTOR_MICRO_VERSION = 21;
+const unsigned int ADAPTOR_MICRO_VERSION = 24;
const char* const ADAPTOR_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
Name: dali2-adaptor
Summary: The DALi Tizen Adaptor
-Version: 2.3.21
+Version: 2.3.24
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT