/*
- * Copyright (c) 2021 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.
{
namespace Internal
{
-const ImageAttributes ImageAttributes::DEFAULT_ATTRIBUTES;
-
struct ImageAttributes::ImageAttributesImpl
{
ImageAttributesImpl()
#define DALI_INTERNAL_IMAGE_ATTRIBUTES_H
/*
- * Copyright (c) 2021 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.
*/
using FilterMode = Dali::SamplingMode::Type;
- static const ImageAttributes DEFAULT_ATTRIBUTES; ///< Default attributes have no size
-
/**
* @brief Default constructor, initializes to default values.
*/
#define DALI_INTERNAL_SHADER_DATA_H
/*
- * Copyright (c) 2021 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.
namespace
{
-static const std::vector<char> emptyShader;
-
inline std::vector<char> StringToVector(const std::string& str)
{
auto retval = std::vector<char>{};
else
{
// DALI_LOG_ERROR("Unsupported shader stage\n");
+ static const std::vector<char> emptyShader;
return emptyShader;
}
}
{
namespace
{
-MemoryPoolObjectAllocator<Renderer> gRenderRendererMemoryPool;
+MemoryPoolObjectAllocator<Renderer>& GetRenderRendererMemoryPool()
+{
+ static MemoryPoolObjectAllocator<Renderer> gRenderRendererMemoryPool;
+ return gRenderRendererMemoryPool;
+}
}
void Renderer::PrepareCommandBuffer()
DepthFunction::Type depthFunction,
StencilParameters& stencilParameters)
{
- void* ptr = gRenderRendererMemoryPool.AllocateRawThreadSafe();
- auto key = gRenderRendererMemoryPool.GetKeyFromPtr(static_cast<Renderer*>(ptr));
+ void* ptr = GetRenderRendererMemoryPool().AllocateRawThreadSafe();
+ auto key = GetRenderRendererMemoryPool().GetKeyFromPtr(static_cast<Renderer*>(ptr));
// Use placement new to construct renderer.
new(ptr) Renderer(dataProvider, geometry, blendingBitmask, blendColor, faceCullingMode, preMultipliedAlphaEnabled, depthWriteMode, depthTestMode, depthFunction, stencilParameters);
void Renderer::operator delete(void* ptr)
{
- gRenderRendererMemoryPool.FreeThreadSafe(static_cast<Renderer*>(ptr));
+ GetRenderRendererMemoryPool().FreeThreadSafe(static_cast<Renderer*>(ptr));
}
Renderer* Renderer::Get(RendererKey::KeyType rendererKey)
{
- return gRenderRendererMemoryPool.GetPtrFromKey(rendererKey);
+ return GetRenderRendererMemoryPool().GetPtrFromKey(rendererKey);
}
void Renderer::SetGeometry(Render::Geometry* geometry)
#endif
// Memory pool used to allocate new textures. Memory used by this pool will be released when shutting down DALi
-MemoryPoolObjectAllocator<Texture> gTextureMemoryPool;
+MemoryPoolObjectAllocator<Texture>& GetTextureMemoryPool()
+{
+ static MemoryPoolObjectAllocator<Texture> gTextureMemoryPool;
+ return gTextureMemoryPool;
+}
/**
* Converts DALi pixel format to Graphics::Format
TextureKey Texture::NewKey(Type type, Pixel::Format format, ImageDimensions size)
{
- void* ptr = gTextureMemoryPool.AllocateRawThreadSafe();
- auto key = gTextureMemoryPool.GetKeyFromPtr(static_cast<Texture*>(ptr));
+ void* ptr = GetTextureMemoryPool().AllocateRawThreadSafe();
+ auto key = GetTextureMemoryPool().GetKeyFromPtr(static_cast<Texture*>(ptr));
new(ptr) Texture(type, format, size);
return TextureKey(key);
TextureKey Texture::NewKey(NativeImageInterfacePtr nativeImageInterface)
{
- void* ptr = gTextureMemoryPool.AllocateRawThreadSafe();
- auto key = gTextureMemoryPool.GetKeyFromPtr(static_cast<Texture*>(ptr));
+ void* ptr = GetTextureMemoryPool().AllocateRawThreadSafe();
+ auto key = GetTextureMemoryPool().GetKeyFromPtr(static_cast<Texture*>(ptr));
new(ptr) Texture(nativeImageInterface);
return TextureKey(key);
void Texture::operator delete(void* ptr)
{
- gTextureMemoryPool.FreeThreadSafe(static_cast<Texture*>(ptr));
+ GetTextureMemoryPool().FreeThreadSafe(static_cast<Texture*>(ptr));
}
Render::Texture* Texture::Get(TextureKey::KeyType key)
{
- return gTextureMemoryPool.GetPtrFromKey(key);
+ return GetTextureMemoryPool().GetPtrFromKey(key);
}
void Texture::Initialize(Graphics::Controller& graphicsController)