X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fnpatch%2Fnpatch-visual.h;h=c94e5b4a5336a0af0294a012843422a0940fa5bd;hp=e89d9e00a08d74868638ace87edd7f72df7edcd4;hb=b861f4c549049d55142a0f913bd1fab701511544;hpb=2ca1c3856ce848a94f54444f1014a820e91ee207 diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.h b/dali-toolkit/internal/visuals/npatch/npatch-visual.h index e89d9e0..c94e5b4 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.h +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_N_PATCH_VISUAL_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. @@ -21,28 +21,26 @@ // EXTERNAL INCLUDES #include #include +#include #include #include #include -#include // INTERNAL INCLUDES -#include -#include +#include #include #include +#include namespace Dali { - namespace Toolkit { - namespace Internal { class ImageVisualShaderFactory; class NPatchVisual; -typedef IntrusivePtr< NPatchVisual > NPatchVisualPtr; +typedef IntrusivePtr NPatchVisualPtr; /** * The visual which renders an 9 patch image to the control's quad @@ -57,7 +55,7 @@ typedef IntrusivePtr< NPatchVisual > NPatchVisualPtr; * | auxiliaryImage | STRING | * | auxiliaryImageAlpha | FLOAT | */ -class NPatchVisual: public Visual::Base, public TextureUploadObserver +class NPatchVisual : public Visual::Base, public TextureUploadObserver { public: /** @@ -85,25 +83,23 @@ public: */ static NPatchVisualPtr New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl); -public: // from Visual - +public: // from Visual /** * @copydoc Visual::Base::GetNaturalSize */ - void GetNaturalSize( Vector2& naturalSize ) override; + void GetNaturalSize(Vector2& naturalSize) override; /** * @copydoc Visual::Base::CreatePropertyMap */ - void DoCreatePropertyMap( Property::Map& map ) const override; + void DoCreatePropertyMap(Property::Map& map) const override; /** * @copydoc Visual::Base::CreateInstancePropertyMap */ - void DoCreateInstancePropertyMap( Property::Map& map ) const override; + void DoCreateInstancePropertyMap(Property::Map& map) const override; protected: - /** * @brief Constructor. * @@ -124,17 +120,17 @@ protected: /** * @copydoc Visual::Base::DoSetProperties */ - void DoSetProperties( const Property::Map& propertyMap ) override; + void DoSetProperties(const Property::Map& propertyMap) override; /** * @copydoc Visual::Base::DoSetOnScene */ - void DoSetOnScene( Actor& actor ) override; + void DoSetOnScene(Actor& actor) override; /** * @copydoc Visual::Base::DoSetOffScene */ - void DoSetOffScene( Actor& actor ) override; + void DoSetOffScene(Actor& actor) override; /** * @copydoc Visual::Base::OnSetTransform @@ -142,7 +138,6 @@ protected: void OnSetTransform() override; private: - /** * Loads the NPatch image and the Auxiliary image if needed */ @@ -172,7 +167,7 @@ private: * @param subType to use * @return the geometry */ - Geometry GetNinePatchGeometry( VisualFactoryCache::GeometryType subType ); + Geometry GetNinePatchGeometry(VisualFactoryCache::GeometryType subType); /** * @brief Creates a geometry for the grid size to be used by this visuals' shaders @@ -180,7 +175,7 @@ private: * @param[in] gridSize The grid size of the solid geometry to create * @return Returns the created geometry for the grid size */ - Geometry CreateGridGeometry( Uint16Pair gridSize ); + Geometry CreateGridGeometry(Uint16Pair gridSize); /** * @brief Creates a geometry with the border only for the grid size to be used by this visuals' shaders @@ -203,7 +198,7 @@ private: * @param[in] gridSize The grid size of the solid geometry to create * @return Returns the created geometry for the grid size */ - Geometry CreateBorderGeometry( Uint16Pair gridSize ); + Geometry CreateBorderGeometry(Uint16Pair gridSize); /** * @brief Creates a renderer by using loaded resource. @@ -211,35 +206,28 @@ private: void SetResource(); 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; - /** - * @copydoc TextureUploadObserver::LoadComplete + * @copydoc TextureUploadObserver::LoadCompleted * * 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: WeakHandle mPlacementActor; ///< Weakhandle to contain Actor during texture loading NPatchLoader& mLoader; ///< reference to N patch loader for fast access ImageVisualShaderFactory& mImageVisualShaderFactory; - VisualUrl mImageUrl; ///< The url to the N patch to load - VisualUrl mAuxiliaryUrl; ///< An auxiliary image that can be displayed on top of the N-Patch - NPatchData::NPatchDataId mId; ///< id of the N patch (from loader/cache) - Devel::PixelBuffer mAuxiliaryPixelBuffer; ///< pixel buffer of the auxiliary mask image - bool mBorderOnly; ///< if only border is desired - Rect mBorder; ///< The size of the border - float mAuxiliaryImageAlpha; ///< The alpha value for the auxiliary image only - Toolkit::ImageVisual::ReleasePolicy::Type mReleasePolicy; ///< The release policy to determine when an image should no longer be cached. + VisualUrl mImageUrl; ///< The url to the N patch to load + VisualUrl mAuxiliaryUrl; ///< An auxiliary image that can be displayed on top of the N-Patch + NPatchData::NPatchDataId mId; ///< id of the N patch (from loader/cache) + TextureSet mAuxiliaryTextureSet; ///< TextureSet of the auxiliary mask image + TextureManager::TextureId mAuxiliaryTextureId; ///< id of the auxiliary mask image (from TextureManager) + Toolkit::Visual::ResourceStatus mAuxiliaryResourceStatus; ///< resource status for auxiliary mask image + bool mBorderOnly; ///< if only border is desired + Rect mBorder; ///< The size of the border + float mAuxiliaryImageAlpha; ///< The alpha value for the auxiliary image only + Toolkit::ImageVisual::ReleasePolicy::Type mReleasePolicy; ///< The release policy to determine when an image should no longer be cached. }; } // namespace Internal