#include <dali/public-api/signals/connection-tracker.h>
#include <functional> ///< for std::function
-#include <memory> ///< for std::shared_ptr
+#include <memory> ///< for std::shared_ptr
#include <mutex>
#include <string>
#include <utility> ///< for std::pair
};
static std::shared_ptr<CacheImpl> gCacheImpl{nullptr};
+static Dali::Texture gEmptyTextureWhiteRGB{};
std::shared_ptr<CacheImpl> GetCacheImpl()
{
void DestroyCacheImpl()
{
gCacheImpl.reset();
+
+ // Remove texture object when application stopped.
+ gEmptyTextureWhiteRGB.Reset();
}
} // namespace
Dali::Texture GetEmptyTextureWhiteRGB()
{
- static Dali::PixelData emptyPixelData = GetEmptyPixelDataWhiteRGB();
- static Dali::Texture emptyTexture = Dali::Texture();
- if(!emptyTexture)
+ if(!gEmptyTextureWhiteRGB)
{
- emptyTexture = Texture::New(TextureType::TEXTURE_2D, emptyPixelData.GetPixelFormat(), emptyPixelData.GetWidth(), emptyPixelData.GetHeight());
- emptyTexture.Upload(emptyPixelData, 0, 0, 0, 0, emptyPixelData.GetWidth(), emptyPixelData.GetHeight());
+ Dali::PixelData emptyPixelData = GetEmptyPixelDataWhiteRGB();
+ gEmptyTextureWhiteRGB = Texture::New(TextureType::TEXTURE_2D, emptyPixelData.GetPixelFormat(), emptyPixelData.GetWidth(), emptyPixelData.GetHeight());
+ gEmptyTextureWhiteRGB.Upload(emptyPixelData, 0, 0, 0, 0, emptyPixelData.GetWidth(), emptyPixelData.GetHeight());
}
- return emptyTexture;
+ return gEmptyTextureWhiteRGB;
}
Dali::Texture GetCachedTexture(Dali::PixelData pixelData, bool mipmapRequired)