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-cache.h;h=193799cef5fd30ea3436b53c530635862b8ff665;hp=deae0b0d840ac2b2bdba2d6d49d382629fe37b0d;hb=5a936aac073676657d48db5c42e5d2ad3f5cac9f;hpb=c039ebb7a115f5516aa792c1aa3bd6370e61acfd diff --git a/dali-toolkit/internal/visuals/visual-factory-cache.h b/dali-toolkit/internal/visuals/visual-factory-cache.h index deae0b0..193799c 100644 --- a/dali-toolkit/internal/visuals/visual-factory-cache.h +++ b/dali-toolkit/internal/visuals/visual-factory-cache.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_VISUAL_FACTORY_CACHE_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. @@ -25,9 +25,9 @@ #include // INTERNAL INCLUDES +#include #include #include -#include #include namespace Dali @@ -84,12 +84,20 @@ public: IMAGE_SHADER_ROUNDED_CORNER, IMAGE_SHADER_BORDERLINE, IMAGE_SHADER_ROUNDED_BORDERLINE, + IMAGE_SHADER_MASKING, + IMAGE_SHADER_ROUNDED_CORNER_MASKING, + IMAGE_SHADER_BORDERLINE_MASKING, + IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING, IMAGE_SHADER_ATLAS_DEFAULT_WRAP, IMAGE_SHADER_ATLAS_CUSTOM_WRAP, NATIVE_IMAGE_SHADER, NATIVE_IMAGE_SHADER_ROUNDED_CORNER, NATIVE_IMAGE_SHADER_BORDERLINE, NATIVE_IMAGE_SHADER_ROUNDED_BORDERLINE, + NATIVE_IMAGE_SHADER_MASKING, + NATIVE_IMAGE_SHADER_ROUNDED_CORNER_MASKING, + NATIVE_IMAGE_SHADER_BORDERLINE_MASKING, + NATIVE_IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING, NINE_PATCH_SHADER, NINE_PATCH_MASK_SHADER, TEXT_SHADER_MULTI_COLOR_TEXT, @@ -195,14 +203,17 @@ public: * @brief Set an image to be used when a visual has failed to correctly render * @param[in] brokenImageUrlList The broken image url list */ - void SetBrokenImageUrl(const std::vector& brokenImageUrlList); + void SetBrokenImageUrl(std::string& defaultBrokenUrl, const std::vector& brokenImageUrlList); /** * @brief Update the broken image Renderer object * @param[in,out] renderer renderer for broken image * @param[in] size the size of actor + * @param[in] rendererIsImage True if input renderer use image shader already. + * If true, we don't need to create new renderer when broken image is single image. + * Most of user experience use normal images. So It can reduce runtime. */ - void UpdateBrokenImageRenderer(Renderer& renderer, const Vector2& size); + void UpdateBrokenImageRenderer(Renderer& renderer, const Vector2& size, const bool& rendererIsImage = true); public: /** @@ -272,14 +283,6 @@ private: void ApplyTextureAndUniforms(Renderer& renderer, int index); /** - * @brief Creates a Npatch Geometry object - * - * @param[in] gridSize The gridSize for creating a geometry - * @return The Geometry for NPatch - */ - Geometry CreateNPatchGeometry(Uint16Pair gridSize); - - /** * @brief Gets a geometry for npatch image * * @param[in] index the index of broken image @@ -296,16 +299,6 @@ private: Shader GetNPatchShader(int index); /** - * @brief Registers a properties for Stretch Ranges - * - * @param[in,out] renderer The renderer for broken image - * @param[in] uniformName The name of the uniform - * @param[in] stretchPixels The stretchable pixels in the cropped image space - * @param[in] imageExtent The imageExtent - */ - void RegisterStretchProperties(Renderer& renderer, const char* uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent); - - /** * @brief Returns a broken image type * @param[in] index BrokenImage index * @return The broken image type. @@ -316,12 +309,12 @@ private: struct BrokenImageInfo { BrokenImageInfo() - :visualType(), - url(""), - npatchId(NPatchData::INVALID_NPATCH_DATA_ID), - texture(), - width(0), - height(0) + : visualType(), + url(""), + npatchId(NPatchData::INVALID_NPATCH_DATA_ID), + texture(), + width(0), + height(0) { } @@ -330,25 +323,27 @@ private: } // Data - VisualUrl::Type visualType; - std::string url; - NPatchData::NPatchDataId npatchId; - Texture texture; - uint32_t width; - uint32_t height; + VisualUrl::Type visualType; + std::string url; + NPatchData::NPatchDataId npatchId; + Texture texture; + uint32_t width; + uint32_t height; }; Geometry mGeometry[GEOMETRY_TYPE_MAX + 1]; Shader mShader[SHADER_TYPE_MAX + 1]; - ImageAtlasManagerPtr mAtlasManager; - TextureManager mTextureManager; - NPatchLoader mNPatchLoader; + ImageAtlasManagerPtr mAtlasManager; + TextureManager mTextureManager; + NPatchLoader mNPatchLoader; SvgRasterizeThread* mSvgRasterizeThread; std::unique_ptr mVectorAnimationManager; bool mPreMultiplyOnLoad; std::vector mBrokenImageInfoContainer; + std::string mDefaultBrokenImageUrl; + bool mUseDefaultBrokenImageOnly; }; } // namespace Internal