#define DALI_TOOLKIT_NPATCH_DATA_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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-toolkit/devel-api/utility/npatch-utilities.h>
-#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
+#include <dali-toolkit/internal/texture-manager/texture-manager-impl.h>
+#include <dali-toolkit/internal/visuals/visual-url.h>
namespace Dali
{
*/
enum class LoadingState
{
- LOADING = 0, ///< NPatch is on loading.
- LOAD_COMPLETE, ///< NPatch loading is completed successfully.
- LOAD_FAILED ///< NPatch loading is failed.
+ NOT_STARTED = 0, ///< NPatch loading is not started yet.
+ LOADING, ///< NPatch is on loading.
+ LOAD_COMPLETE, ///< NPatch loading is completed successfully.
+ LOAD_FAILED ///< NPatch loading is failed.
};
public:
*
* @param [in] url NPatch image url
*/
- void SetUrl(const std::string url);
+ void SetUrl(const VisualUrl& url);
/**
* @brief Retrieve the image url.
*
* @return Return the image url.
*/
- std::string GetUrl() const;
+ VisualUrl GetUrl() const;
/**
* @brief Set texture set on the cache data
*/
void SetLoadedNPatchData(Devel::PixelBuffer& pixelBuffer, bool preMultiplied);
-private:
/**
- * @copydoc TextureUploadObserver::UploadCompleted
+ * @brief Send LoadComplete notify with current setuped NPatchData
*
- * To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
- * This callback is the place to add the renderer as it would be called once the loading is finished.
+ * @param [in] observer observer who will be got LoadComplete notify
+ * @param [in] loadSuccess whether the image load success or not.
*/
- void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) override
- {
- }
+ void NotifyObserver(TextureUploadObserver* observer, const bool& loadSuccess);
+private:
/**
* @copydoc TextureUploadObserver::LoadComplete
*
* To avoid rendering garbage pixels, renderer should be added to actor after the resources are ready.
* This callback is the place to add the renderer as it would be called once the loading is finished.
*/
- void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override;
+ void LoadComplete(bool loadSuccess, TextureInformation textureInformation) override;
private:
using ObserverListType = Dali::Vector<TextureUploadObserver*>;
NPatchDataId mId;
ObserverListType mObserverList; ///< Container used to store all observer clients of this Texture
- std::string mUrl; ///< Url of the N-Patch
+ VisualUrl mUrl; ///< Url of the N-Patch
TextureSet mTextureSet; ///< Texture containing the cropped image
NPatchUtility::StretchRanges mStretchPixelsX; ///< X stretch pixels
NPatchUtility::StretchRanges mStretchPixelsY; ///< Y stretch pixels