1 #ifndef DALI_TOOLKIT_TEXTURE_MANAGER_IMPL_H
2 #define DALI_TOOLKIT_TEXTURE_MANAGER_IMPL_H
5 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
21 #include <dali/devel-api/adaptor-framework/animated-image-loading.h>
22 #include <dali/devel-api/adaptor-framework/pixel-buffer.h>
23 #include <dali/public-api/adaptor-framework/encoded-image-buffer.h>
24 #include <dali/public-api/common/dali-vector.h>
25 #include <dali/public-api/rendering/geometry.h>
28 #include <dali-toolkit/devel-api/image-loader/image-atlas.h>
29 #include <dali-toolkit/internal/helpers/round-robin-container-view.h>
30 #include <dali-toolkit/internal/texture-manager/texture-cache-manager.h>
31 #include <dali-toolkit/internal/texture-manager/texture-manager-type.h>
32 #include <dali-toolkit/internal/texture-manager/texture-upload-observer.h>
33 #include <dali-toolkit/internal/visuals/visual-url.h>
41 class ImageAtlasManager;
42 typedef IntrusivePtr<ImageAtlasManager> ImageAtlasManagerPtr;
43 class TextureAsyncLoadingHelper;
46 * The TextureManager provides a common Image loading API for Visuals.
48 * The TextureManager is responsible for providing sync, async, atlased and non-atlased
49 * CPU time alpha masking, animated image loads.
51 * Texture caching is provided and performed by TextureCacheManager.
52 * TextureUploadObserver.LoadComplete called when async load completed.
54 class TextureManager : public ConnectionTracker
57 // Copy enum and types and const values that TextureManager will use.
58 using TextureId = TextureManagerType::TextureId;
59 using TextureCacheIndex = TextureManagerType::TextureCacheIndex;
60 using TextureHash = TextureManagerType::TextureHash;
62 static constexpr TextureId INVALID_TEXTURE_ID = TextureManagerType::INVALID_TEXTURE_ID;
63 static constexpr TextureCacheIndex INVALID_CACHE_INDEX = TextureManagerType::INVALID_CACHE_INDEX;
65 using UseAtlas = TextureManagerType::UseAtlas;
66 using StorageType = TextureManagerType::StorageType;
67 using LoadType = TextureManagerType::LoadType;
68 using LoadState = TextureManagerType::LoadState;
69 using ReloadPolicy = TextureManagerType::ReloadPolicy;
70 using MultiplyOnLoad = TextureManagerType::MultiplyOnLoad;
71 using TextureInfo = TextureManagerType::TextureInfo;
77 ~MaskingData() = default;
79 VisualUrl mAlphaMaskUrl;
80 TextureManager::TextureId mAlphaMaskId;
81 float mContentScaleFactor;
83 bool mPreappliedMasking;
84 bool mMaskImageLoadingFailed;
86 using MaskingDataPointer = std::unique_ptr<MaskingData>;
89 * Class to provide lifecycle event on destruction of texture manager.
91 struct LifecycleObserver
94 * Called shortly before the texture manager is destroyed.
96 virtual void TextureManagerDestroyed() = 0;
107 ~TextureManager() override;
109 // TextureManager Main API:
112 * @brief Requests an frame of animated image load.
114 * The parameters are used to specify how the animated image is loaded.
115 * The observer has the LoadComplete method called when the load is ready.
117 * @param[in] url The URL of the image to load
118 * @param[in] animatedImageLoading The AnimatedImageLoading that contain the animated image information
119 * @param[in] frameIndex The frame index to load.
120 * @param[out] textureId The textureId of the frame
121 * @param[in, out] maskInfo Mask info structure
122 * @param[in] samplingMode The SamplingMode to use
123 * @param[in] wrapModeU Horizontal Wrap mode
124 * @param[in] wrapModeV Vertical Wrap mode
125 * @param[in] synchronousLoading true if the frame should be loaded synchronously
126 * @param[in] textureObserver The client object should inherit from this and provide the "LoadCompleted" virtual.
127 * This is called when an image load completes (or fails).
128 * @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the
129 * image has no alpha channel
131 * @return The texture set containing the frame of animated image, or empty if still loading.
133 TextureSet LoadAnimatedImageTexture(const VisualUrl& url,
134 Dali::AnimatedImageLoading animatedImageLoading,
135 const uint32_t& frameIndex,
136 TextureManager::TextureId& textureId,
137 MaskingDataPointer& maskInfo,
138 const Dali::SamplingMode::Type& samplingMode,
139 const Dali::WrapMode::Type& wrapModeU,
140 const Dali::WrapMode::Type& wrapModeV,
141 const bool& synchronousLoading,
142 TextureUploadObserver* textureObserver,
143 TextureManager::MultiplyOnLoad& preMultiplyOnLoad);
146 * @brief Requests an image load of the given URL to get PixelBuffer.
148 * The parameters are used to specify how the image is loaded.
149 * The observer has the LoadComplete method called when the load is ready.
151 * @param[in] url The URL of the image to load
152 * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
153 * @param[in] fittingMode The FittingMode to use
154 * @param[in] samplingMode The SamplingMode to use
155 * @param[in] synchronousLoading true if the URL should be loaded synchronously
156 * @param[in] textureObserver The client object should inherit from this and provide the "LoadCompleted" virtual.
157 * This is called when an image load completes (or fails).
158 * @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
159 * @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the
160 * image has no alpha channel
162 * @return The pixel buffer containing the image, or empty if still loading.
164 Devel::PixelBuffer LoadPixelBuffer(
165 const VisualUrl& url,
166 const Dali::ImageDimensions& desiredSize,
167 const Dali::FittingMode::Type& fittingMode,
168 const Dali::SamplingMode::Type& samplingMode,
169 const bool& synchronousLoading,
170 TextureUploadObserver* textureObserver,
171 const bool& orientationCorrection,
172 TextureManager::MultiplyOnLoad& preMultiplyOnLoad);
175 * @brief Requests an image load of the given URL.
177 * The parameters are used to specify how the image is loaded.
178 * The observer has the LoadComplete method called when the load is ready.
180 * When the client has finished with the Texture, Remove() should be called.
182 * @param[in] url The URL of the image to load
183 * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
184 * @param[in] fittingMode The FittingMode to use
185 * @param[in] samplingMode The SamplingMode to use
186 * @param[in, out] maskInfo Mask info structure
187 * @param[in] synchronousLoading true if the URL should be loaded synchronously
188 * @param[out] textureId, The textureId of the URL
189 * @param[out] textureRect The rectangle within the texture atlas that this URL occupies,
190 * this is the rectangle in normalized coordinates.
191 * @param[out] textureRectSize The rectangle within the texture atlas that this URL occupies,
192 * this is the same rectangle in pixels.
193 * @param[in,out] atlasingStatus Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still
194 * be loaded, and marked successful, but this will be set to false.
195 * If atlasing succeeds, this will be set to true.
196 * @param[out] loadingStatus The loading status of the texture
197 * @param[in] wrapModeU Horizontal Wrap mode
198 * @param[in] wrapModeV Vertical Wrap mode
199 * @param[in] textureObserver The client object should inherit from this and provide the "LoadCompleted" virtual.
200 * This is called when an image load completes (or fails).
201 * @param[in] atlasObserver This is used if the texture is atlased, and will be called instead of
202 * textureObserver.LoadCompleted
203 * @param[in] imageAtlasManager The atlas manager to use for atlasing textures
204 * @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
205 * @param[in] reloadPolicy Forces a reload of the texture even if already cached
206 * @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the
207 * image has no alpha channel
209 * @return The texture set containing the image, or empty if still loading.
211 TextureSet LoadTexture(
212 const VisualUrl& url,
213 const Dali::ImageDimensions& desiredSize,
214 const Dali::FittingMode::Type& fittingMode,
215 const Dali::SamplingMode::Type& samplingMode,
216 MaskingDataPointer& maskInfo,
217 const bool& synchronousLoading,
218 TextureManager::TextureId& textureId,
219 Dali::Vector4& textureRect,
220 Dali::ImageDimensions& textureRectSize,
221 bool& atlasingStatus,
223 const Dali::WrapMode::Type& wrapModeU,
224 const Dali::WrapMode::Type& wrapModeV,
225 TextureUploadObserver* textureObserver,
226 AtlasUploadObserver* atlasObserver,
227 ImageAtlasManagerPtr imageAtlasManager,
228 const bool& orientationCorrection,
229 const TextureManager::ReloadPolicy& reloadPolicy,
230 TextureManager::MultiplyOnLoad& preMultiplyOnLoad);
233 * @brief Remove a Texture from the TextureManager.
235 * Textures are cached and therefore only the removal of the last
236 * occurrence of a Texture will cause its removal internally.
238 * @param[in] textureId The ID of the Texture to remove.
239 * @param[in] textureObserver The texture observer.
241 void Remove(const TextureManager::TextureId& textureId, TextureUploadObserver* textureObserver);
244 * Add an observer to the object.
245 * @param[in] observer The observer to add.
247 void AddObserver(TextureManager::LifecycleObserver& observer);
250 * Remove an observer from the object
251 * @pre The observer has already been added.
252 * @param[in] observer The observer to remove.
254 void RemoveObserver(TextureManager::LifecycleObserver& observer);
257 * @brief Returns the geometry associated with texture.
258 * @param[in] textureId Id of the texture
259 * @param[out] frontElements number of front elements
260 * @param[out] backElements number of back elements
261 * @return Returns valid geometry object
263 Geometry GetRenderGeometry(const TextureManager::TextureId& textureId, std::uint32_t& frontElements, std::uint32_t& backElements);
266 // API list that need to access TextureCacheManager.
269 * @copydoc TextureCacheManager::GetVisualUrl
271 inline VisualUrl GetVisualUrl(const TextureManager::TextureId& textureId)
273 return mTextureCacheManager.GetVisualUrl(textureId);
277 * @copydoc TextureCacheManager::GetTextureSet
279 inline TextureSet GetTextureSet(const TextureManager::TextureId& textureId)
281 return mTextureCacheManager.GetTextureSet(textureId);
285 * @copydoc TextureCacheManager::RemoveExternalTexture
287 inline TextureSet RemoveExternalTexture(const std::string& url)
289 return mTextureCacheManager.RemoveExternalTexture(url);
293 * @copydoc TextureCacheManager::RemoveEncodedImageBuffer
295 inline EncodedImageBuffer RemoveEncodedImageBuffer(const std::string& url)
297 return mTextureCacheManager.RemoveEncodedImageBuffer(url);
301 * @copydoc TextureCacheManager::UseExternalResource
303 inline void UseExternalResource(const VisualUrl& url)
305 mTextureCacheManager.UseExternalResource(url);
309 * @copydoc TextureCacheManager::GetEncodedImageBuffer
311 inline EncodedImageBuffer GetEncodedImageBuffer(const std::string& url)
313 return mTextureCacheManager.GetEncodedImageBuffer(url);
317 * @copydoc TextureCacheManager::AddExternalTexture
319 inline std::string AddExternalTexture(const TextureSet& texture)
321 return mTextureCacheManager.AddExternalTexture(texture);
325 * @copydoc TextureCacheManager::AddEncodedImageBuffer
327 inline std::string AddEncodedImageBuffer(const EncodedImageBuffer& encodedImageBuffer)
329 return mTextureCacheManager.AddEncodedImageBuffer(encodedImageBuffer);
332 public: // Load Request API
334 * @brief Requests an image load of the given URL.
336 * The parameters are used to specify how the image is loaded.
337 * The observer has the LoadComplete method called when the load is ready.
339 * When the client has finished with the Texture, Remove() should be called.
341 * @param[in] url The URL of the image to load
342 * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
343 * @param[in] fittingMode The FittingMode to use
344 * @param[in] samplingMode The SamplingMode to use
345 * @param[in] useAtlasing Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still be loaded, and marked successful,
346 * but "useAtlasing" will be set to false in the "LoadCompleted" callback from the TextureManagerUploadObserver.
347 * @param[in] observer The client object should inherit from this and provide the "LoadCompleted" virtual.
348 * This is called when an image load completes (or fails).
349 * @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
350 * @param[in] reloadPolicy Forces a reload of the texture even if already cached
351 * @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the image has no alpha channel
352 * @param[in] synchronousLoading True if the frame should be loaded synchronously. If you skip this parameter,
354 * @return A TextureId to use as a handle to reference this Texture
356 TextureId RequestLoad(
357 const VisualUrl& url,
358 const ImageDimensions& desiredSize,
359 const Dali::FittingMode::Type& fittingMode,
360 const Dali::SamplingMode::Type& samplingMode,
361 const TextureManager::UseAtlas& useAtlasing,
362 TextureUploadObserver* observer,
363 const bool& orientationCorrection,
364 const TextureManager::ReloadPolicy& reloadPolicy,
365 TextureManager::MultiplyOnLoad& preMultiplyOnLoad,
366 const bool& synchronousLoading = false);
369 * @brief Requests an image load of the given URL, when the texture has
370 * have loaded, it will perform a blend with the image mask, and upload
371 * the blended texture.
373 * The parameters are used to specify how the image is loaded.
374 * The observer has the LoadComplete method called when the load is ready.
376 * When the client has finished with the Texture, Remove() should be called.
378 * @param[in] url The URL of the image to load
379 * @param[in] maskTextureId The texture id of an image to mask this with
380 * (can be INVALID if no masking required)
381 * @param[in] contentScale The scale factor to apply to the image before masking
382 * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
383 * @param[in] fittingMode The FittingMode to use
384 * @param[in] samplingMode The SamplingMode to use
385 * @param[in] useAtlasing Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still
386 * be loaded, and marked successful,
387 * but "useAtlasing" will be set to false in the "LoadCompleted" callback from
388 * the TextureManagerUploadObserver.
389 * @param[in] cropToMask Only used with masking, this will crop the scaled image to the mask size.
390 * If false, then the mask will be scaled to fit the image before being applied.
391 * @param[in] observer The client object should inherit from this and provide the "LoadCompleted"
393 * This is called when an image load completes (or fails).
394 * @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
395 * @param[in] reloadPolicy Forces a reload of the texture even if already cached
396 * @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if the
397 * image has no alpha channel
398 * @param[in] synchronousLoading True if the frame should be loaded synchronously. If you skip this parameter,
400 * @return A TextureId to use as a handle to reference this Texture
402 TextureId RequestLoad(
403 const VisualUrl& url,
404 const TextureManager::TextureId& maskTextureId,
405 const float& contentScale,
406 const ImageDimensions& desiredSize,
407 const Dali::FittingMode::Type& fittingMode,
408 const Dali::SamplingMode::Type& samplingMode,
409 const TextureManager::UseAtlas& useAtlasing,
410 const bool& cropToMask,
411 TextureUploadObserver* observer,
412 const bool& orientationCorrection,
413 const TextureManager::ReloadPolicy& reloadPolicy,
414 TextureManager::MultiplyOnLoad& preMultiplyOnLoad,
415 const bool& synchronousLoading = false);
418 * @brief Requests a masking image to be loaded. This mask is not uploaded to GL,
419 * instead, it is stored in CPU memory, and can be used for CPU blending.
420 * @param[in] maskUrl The URL of the mask image to load
421 * @param[in] storageType, Whether the pixel data is stored in the cache or uploaded to the GPU
422 * @param[in] synchronousLoading True if the frame should be loaded synchronously. If you skip this parameter,
424 * @return A TextureId to use as a handle to reference this mask Texture
426 TextureId RequestMaskLoad(
427 const VisualUrl& maskUrl,
428 StorageType storageType,
429 const bool& synchronousLoading = false);
433 * @brief Requests an image load of the given URL, when the texture has
434 * have loaded, if there is a valid maskTextureId, it will perform a
435 * CPU blend with the mask, and upload the blend texture.
437 * The parameters are used to specify how the image is loaded.
438 * The observer has the LoadComplete method called when the load is ready.
440 * When the client has finished with the Texture, Remove() should be called.
442 * @param[in] url The URL of the image to load
443 * @param[in] maskTextureId The texture id of an image to use as a mask. If no mask is required, then set
444 * to INVALID_TEXTURE_ID
445 * @param[in] contentScale The scaling factor to apply to the content when masking
446 * @param[in] desiredSize The size the image is likely to appear at. This can be set to 0,0 for automatic
447 * @param[in] fittingMode The FittingMode to use
448 * @param[in] samplingMode The SamplingMode to use
449 * @param[in] useAtlasing Set to USE_ATLAS to attempt atlasing. If atlasing fails, the image will still be
450 * loaded, and marked successful, but "useAtlasing" will be set to false in the
451 * "LoadCompleted" callback from the TextureManagerUploadObserver.
452 * @param[in] cropToMask Whether to crop the target after masking, or scale the mask to the image before
454 * @param[in] storageType, Whether the pixel data is stored in the cache or uploaded to the GPU
455 * @param[in] observer The client object should inherit from this and provide the "LoadCompleted"
457 * This is called when an image load completes (or fails).
458 * @param[in] orientationCorrection Whether to rotate image to match embedded orientation data
459 * @param[in] reloadPolicy Forces a reload of the texture even if already cached
460 * @param[in,out] preMultiplyOnLoad True if the image color should be multiplied by it's alpha. Set to false if
462 * @param[in] animatedImageLoading The AnimatedImageLoading to load animated image
463 * @param[in] frameIndex The frame index of a frame to be loaded frame
464 * @param[in] synchronousLoading True if the frame should be loaded synchronously. If you skip this parameter,
466 * @return A TextureId to use as a handle to reference this Texture
468 TextureId RequestLoadInternal(
469 const VisualUrl& url,
470 const TextureManager::TextureId& maskTextureId,
471 const float& contentScale,
472 const Dali::ImageDimensions& desiredSize,
473 const Dali::FittingMode::Type& fittingMode,
474 const Dali::SamplingMode::Type& samplingMode,
475 const TextureManager::UseAtlas& useAtlas,
476 const bool& cropToMask,
477 const TextureManager::StorageType& storageType,
478 TextureUploadObserver* observer,
479 const bool& orientationCorrection,
480 const TextureManager::ReloadPolicy& reloadPolicy,
481 TextureManager::MultiplyOnLoad& preMultiplyOnLoad,
482 Dali::AnimatedImageLoading animatedImageLoading,
483 const std::uint32_t& frameIndex,
484 const bool& synchronousLoading);
487 * @brief Load a new image synchronously.
488 * @param[in] url The URL of the image to load
489 * @param[in] desiredSize The size the image is likely to appear at.
490 * This can be set to 0,0 for automatic
491 * @param[in] fittingMode The FittingMode to use
492 * @param[in] samplingMode The SamplingMode to use
493 * @param[in] orientationCorrection Whether to use image metadata to rotate or flip the image,
494 * e.g., from portrait to landscape
495 * @return PixelBuffer of loaded image.
497 Devel::PixelBuffer LoadImageSynchronously(
498 const VisualUrl& url,
499 const Dali::ImageDimensions& desiredSize,
500 const Dali::FittingMode::Type& fittingMode,
501 const Dali::SamplingMode::Type& samplingMode,
502 const bool& orientationCorrection);
508 * Structure to hold info about a texture load queued during NotifyObservers
510 struct LoadQueueElement
512 LoadQueueElement(TextureManager::TextureId textureId, TextureUploadObserver* observer)
513 : mTextureId(textureId),
518 TextureManager::TextureId mTextureId; ///< The texture id of the requested load.
519 TextureUploadObserver* mObserver; ///< Observer of texture load.
523 * @brief Initiate a load or queue load if NotifyObservers is invoking callbacks
524 * @param[in] textureInfo The TextureInfo struct associated with the Texture
525 * @param[in] observer The observer wishing to observe the texture upload
527 void LoadOrQueueTexture(TextureManager::TextureInfo& textureInfo, TextureUploadObserver* observer);
530 * @brief Queue a texture load to be subsequently handled by ProcessQueuedTextures.
531 * @param[in] textureInfo The TextureInfo struct associated with the Texture
532 * @param[in] observer The observer wishing to observe the texture upload
534 void QueueLoadTexture(const TextureManager::TextureInfo& textureInfo, TextureUploadObserver* observer);
537 * @brief Used internally to initiate a load.
538 * @param[in] textureInfo The TextureInfo struct associated with the Texture
539 * @param[in] observer The observer wishing to observe the texture upload
541 void LoadTexture(TextureManager::TextureInfo& textureInfo, TextureUploadObserver* observer);
544 * @brief Initiate load of textures queued whilst NotifyObservers invoking callbacks.
546 void ProcessLoadQueue();
549 * @brief Initiate remove of texture queued whilst NotifyObservers invoking callbacks.
551 void ProcessRemoveQueue();
554 * Add the observer to the observer list
555 * @param[in] textureInfo The TextureInfo struct associated with the texture
556 * @param[in] observer The observer wishing to observe the texture upload
558 void ObserveTexture(TextureManager::TextureInfo& textureInfo, TextureUploadObserver* observer);
561 * @brief Performs Post-Load steps including atlasing.
562 * @param[in] textureInfo The struct associated with this Texture
563 * @param[in] pixelBuffer The image pixelBuffer
564 * @return True if successful
566 void PostLoad(TextureManager::TextureInfo& textureInfo, Devel::PixelBuffer& pixelBuffer);
569 * Check if there is a texture waiting to be masked. If there
570 * is then apply this mask and upload it.
571 * @param[in] maskTextureInfo The texture info of the mask that has just loaded.
573 void CheckForWaitingTexture(TextureManager::TextureInfo& maskTextureInfo);
576 * Apply the mask to the pixelBuffer.
577 * @param[in] textureInfo The information of texture to apply the mask to
578 * @param[in] maskTextureId The texture id of the mask.
580 void ApplyMask(TextureManager::TextureInfo& textureInfo, const TextureManager::TextureId& maskTextureId);
583 * Upload the texture specified in pixelBuffer to the appropriate location
584 * @param[in] pixelBuffer The image data to upload
585 * @param[in] textureInfo The texture info containing the location to
588 void UploadTexture(Devel::PixelBuffer& pixelBuffer, TextureManager::TextureInfo& textureInfo);
591 * Notify the current observers that the texture upload is complete,
592 * then remove the observers from the list.
593 * @param[in] textureInfo The struct associated with this Texture
594 * @param[in] success If the pixel data was retrieved successfully and uploaded to GPU
596 void NotifyObservers(TextureManager::TextureInfo& textureInfo, const bool& success);
599 * Call LoadComplete to the observer.
600 * @param[in] observer The client object should inherit from this and provide the "LoadCompleted"
601 * @param[in] textureInfo The struct associated with this Texture
602 * @param[in] success If the pixel data was retrieved successfully and uploaded to GPU
604 void EmitLoadComplete(TextureUploadObserver* observer, TextureManager::TextureInfo& textureInfo, const bool& success);
608 * @brief Common method to handle loading completion.
609 * TextureAsyncLoadingHelper will call this API After async loading finished.
610 * @param[in] textureId The ID of the texture load complete.
611 * @param[in] pixelBuffer The loaded image data
613 void AsyncLoadComplete(const TextureManager::TextureId& textureId, Devel::PixelBuffer pixelBuffer);
617 * Deleted copy constructor.
619 TextureManager(const TextureManager&) = delete;
622 * Deleted assignment operator.
624 TextureManager& operator=(const TextureManager& rhs) = delete;
627 * This is called by the TextureManagerUploadObserver when an observer is destroyed.
628 * We use the callback to know when to remove an observer from our notify list.
629 * @param[in] observer The observer that generated the callback
631 void ObserverDestroyed(TextureUploadObserver* observer);
633 private: // Member Variables:
634 TextureCacheManager mTextureCacheManager; ///< Manager the life-cycle and caching of Textures
636 RoundRobinContainerView<TextureAsyncLoadingHelper> mAsyncLocalLoaders; ///< The Asynchronous image loaders used to provide all local async loads
637 RoundRobinContainerView<TextureAsyncLoadingHelper> mAsyncRemoteLoaders; ///< The Asynchronous image loaders used to provide all remote async loads
639 Dali::Vector<LifecycleObserver*> mLifecycleObservers; ///< Lifecycle observers of texture manager
640 Dali::Vector<LoadQueueElement> mLoadQueue; ///< Queue of textures to load after NotifyObservers
641 Dali::Vector<TextureManager::TextureId> mRemoveQueue; ///< Queue of textures to remove after NotifyObservers
642 bool mQueueLoadFlag; ///< Flag that causes Load Textures to be queued.
645 } // namespace Internal
647 } // namespace Toolkit
651 #endif // DALI_TOOLKIT_TEXTURE_MANAGER_IMPL_H