X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fimage%2Fimage-visual.h;h=307ab197c600e5ca595cc2bb0aded5d6f208a05a;hp=c0a3f750ae71baa5d0f194eac952675533f443a0;hb=11e1ee5bb1a33525dd3016a0fd145a6a3ee2c133;hpb=8d0ccc12714da58e6e2c971188b221ed2158d658 diff --git a/dali-toolkit/internal/visuals/image/image-visual.h b/dali-toolkit/internal/visuals/image/image-visual.h index c0a3f75..307ab19 100644 --- a/dali-toolkit/internal/visuals/image/image-visual.h +++ b/dali-toolkit/internal/visuals/image/image-visual.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_IMAGE_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. @@ -28,7 +28,7 @@ // INTERNAL INCLUDES #include #include -#include +#include #include #include #include @@ -171,7 +171,7 @@ public: // from Visual /** * @copydoc Visual::Base::OnDoAction */ - void OnDoAction(const Dali::Property::Index actionName, const Dali::Property::Value& attributes) override; + void OnDoAction(const Dali::Property::Index actionId, const Dali::Property::Value& attributes) override; protected: /** @@ -224,11 +224,6 @@ protected: void OnSetTransform() override; /** - * @copydoc Visual::Base::IsResourceReady - */ - bool IsResourceReady() const override; - - /** * @copydoc Visual::Base::UpdateShader */ void UpdateShader() override; @@ -248,25 +243,15 @@ public: void UploadCompleted() override; /** - * @copydoc TextureUploadObserver::UploadCompleted + * @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 UploadComplete(bool success, int32_t textureId, TextureSet textureSet, bool usingAtlas, const Vector4& atlasRectangle, bool preMultiplied) override; + void LoadComplete(bool success, TextureInformation textureInformation) override; 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 PixelBuffer loading is finished. - */ - void LoadComplete(bool loadSuccess, Devel::PixelBuffer pixelBuffer, const VisualUrl& url, bool preMultiplied) override - { - } - - /** * Allocate the mask data when a masking property is defined in the property map */ void AllocateMaskData(); @@ -314,12 +299,29 @@ private: void RemoveTexture(); /** + * @brief Compute texture size + */ + void ComputeTextureSize(); + + /** + * @brief Compute mask texture ratio + * @return The Mask Texture Ratio + */ + Vector2 ComputeMaskTextureRatio(); + + /** * Helper method to set individual values by index key. * @param[in] index The index key of the value * @param[in] value The value */ void DoSetProperty(Property::Index index, const Property::Value& value); + /** + * @brief Check whether the mask texture is loaded or not. + * If MaskingType is MASKING_ON_LOADING and mask texture is failed to load, update shader. + */ + void CheckMaskTexture(); + private: Vector4 mPixelArea; WeakHandle mPlacementActor; @@ -329,6 +331,7 @@ private: Dali::ImageDimensions mDesiredSize; TextureManager::TextureId mTextureId; TextureSet mTextures; + Vector2 mTextureSize; ImageVisualShaderFactory& mImageVisualShaderFactory; @@ -343,6 +346,7 @@ private: TextureManager::LoadState mLoadState; ///< The texture loading state bool mAttemptAtlasing; ///< If true will attempt atlasing, otherwise create unique texture bool mOrientationCorrection; ///< true if the image will have it's orientation corrected. + bool mNeedYuvToRgb{false}; ///< true if we need to convert yuv to rgb. }; } // namespace Internal