X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-factory-impl.h;h=4a4ab4c978ae32edbdc536daa05604b86c1ae968;hp=a5ecda81bcc1431c43d8bf0840fe79e366e2c5e6;hb=HEAD;hpb=4f6a1937f912ecec09d2ba09e2cbeedae881061e diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.h b/dali-toolkit/internal/visuals/visual-factory-impl.h index a5ecda8..76bacf9 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.h +++ b/dali-toolkit/internal/visuals/visual-factory-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_VISUAL_FACTORY_IMPL_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2023 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,10 +18,11 @@ */ // EXTERNAL INCLUDES +#include #include +#include // INTERNAL INCLUDES -#include #include #include #include @@ -35,6 +36,7 @@ namespace Internal { class VisualFactoryCache; class ImageVisualShaderFactory; +class TextVisualShaderFactory; /** * @copydoc Toolkit::VisualFactory @@ -85,6 +87,16 @@ public: bool GetPreMultiplyOnLoad() const; /** + * @copydoc Toolkit::VisualFactory::DiscardVisual() + */ + void DiscardVisual(Toolkit::Visual::Base visual); + + /** + * @copydoc Toolkit::VisualFactory::UsePreCompiledShader() + */ + void UsePreCompiledShader(); + + /** * @return the reference to texture manager */ Internal::TextureManager& GetTextureManager(); @@ -103,6 +115,12 @@ private: void SetBrokenImageUrl(Toolkit::StyleManager& styleManager); /** + * @brief Get the default shader source. + * @param[in] shaders shaderList for precompile + */ + void GetPreCompiledShader(RawShaderData& shaders); + + /** * Get the factory cache, creating it if necessary. */ Internal::VisualFactoryCache& GetFactoryCache(); @@ -112,6 +130,21 @@ private: */ ImageVisualShaderFactory& GetImageVisualShaderFactory(); + /** + * Get the text visual shader factory, creating it if necessary. + */ + TextVisualShaderFactory& GetTextVisualShaderFactory(); + + /** + * @brief Callbacks called for clear discarded visuals. + */ + void OnDiscardCallback(); + + /** + * @brief Register idle callback for discard visuals if need. + */ + void RegisterDiscardCallback(); + VisualFactory(const VisualFactory&) = delete; VisualFactory& operator=(const VisualFactory& rhs) = delete; @@ -119,9 +152,14 @@ private: private: std::unique_ptr mFactoryCache; std::unique_ptr mImageVisualShaderFactory; + std::unique_ptr mTextVisualShaderFactory; SlotDelegate mSlotDelegate; + CallbackBase* mIdleCallback; + using DiscardedVisualContainer = std::vector; + DiscardedVisualContainer mDiscardedVisuals{}; bool mDebugEnabled : 1; bool mPreMultiplyOnLoad : 1; ///< Local store for this flag + bool mPrecompiledShaderRequested : 1; }; /**