Refactoring TextureManager cache as Dali::FreeList
Apply additional container as Dali::FreeList as TextureIdConverter;
From TextureId to TextureCacheIndex.
and add mTextureHashContainer, key is TextureHash and value is list of TextureId.
These things will make us access mTextureInfoContainer more faster.
Previous code iterate whole std::vector list to find cached texture.
This patch make we can get cacheIndex from textureId as O(1) by Dali::FreeList
and get textureId from textureHash as O(1 * collision)
by std::unordered_map<TextureHash, vector<TextureId>>.
This patch make TextureCacheIndex as a kind of structure. named TextureCacheIndexData.
This data use 4 bit as "TextueCacheIndexType" and 28 bit as "Index".
By this structure, we can use only one TextureIdConverter.
We can know what this TextureId come from ;
NormalImage or ExternalTextures or EncodedImageBuffer.
So now, we can do all API things as near O(1). Without useless iteratating.
It will reduce ImageView's SceneOn and SceneOff time.
And also, reduce AsyncLoadComplete API runtime, that animated image used
every image frame.
Note : After this patch, TextureId will not be unique anymore.
TODO : Masking feature still works on O(N). We need to make new container for it in future.
Change-Id: I37777ccc05fc0541e1f0e65f1d6306d9436c1245
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>