X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fnpatch-data.h;h=7a052c4f47d3073898e7c7d0af72d940e62fac09;hp=60e6e6bd52eb57bc63e2221b05184f36fea91839;hb=ff4a3d03472a60aba7cd8ffe111e5fcd9527d967;hpb=bd126b5d480c08bf7a995b2c4532e80e76ec4ad2 diff --git a/dali-toolkit/internal/visuals/npatch-data.h b/dali-toolkit/internal/visuals/npatch-data.h index 60e6e6b..7a052c4 100644 --- a/dali-toolkit/internal/visuals/npatch-data.h +++ b/dali-toolkit/internal/visuals/npatch-data.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_NPATCH_DATA_H /* - * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 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. @@ -18,27 +18,25 @@ */ // EXTERNAL INCLUDES -#include -#include #include +#include +#include // INTERNAL INCLUDES -#include #include +#include +#include namespace Dali { - namespace Toolkit { - namespace Internal { - class NPatchData : public Dali::Toolkit::TextureUploadObserver { public: - typedef int32_t NPatchDataId; ///< The NPatchDataId type. This is used as a handle to refer to a particular Npatch Data. + typedef int32_t NPatchDataId; ///< The NPatchDataId type. This is used as a handle to refer to a particular Npatch Data. static const int INVALID_NPATCH_DATA_ID = -1; ///< Used to represent a null TextureId or error /** @@ -52,7 +50,6 @@ public: }; public: - /** * Constructor */ @@ -64,7 +61,6 @@ public: ~NPatchData(); public: - /** * @brief Set cache data id. * @@ -105,14 +101,14 @@ 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 @@ -240,7 +236,6 @@ public: */ LoadingState GetLoadingState() const; - /** * @brief Retrieve NPatch rendering data. * @@ -254,17 +249,18 @@ public: * @param [in] pixelBuffer loaded pixel buffer. * @param [in] preMultiplied whether the loaded image is premultiplied or not */ - void SetLoadedNPatchData( Devel::PixelBuffer& pixelBuffer, bool preMultiplied ); + void SetLoadedNPatchData(Devel::PixelBuffer& pixelBuffer, bool preMultiplied); private: - /** * @copydoc TextureUploadObserver::UploadCompleted * * 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 UploadComplete( bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied ) override {} + void UploadComplete(bool loadSuccess, int32_t textureId, TextureSet textureSet, bool useAtlasing, const Vector4& atlasRect, bool preMultiplied) override + { + } /** * @copydoc TextureUploadObserver::LoadComplete @@ -272,16 +268,14 @@ private: * 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, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override; private: - using ObserverListType = Dali::Vector; 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