X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Ftext%2Ftext-visual.h;h=c79c2548f9e12c67e374135517bdb1b33ca9215f;hp=7304f0f6fa00a117705484826d357c17fa6f1018;hb=ba2b1aa2e87716f4ef107e0fa627573475e93470;hpb=2b6e7d59a00075e2f83eedee483e3544a7af7f3d diff --git a/dali-toolkit/internal/visuals/text/text-visual.h b/dali-toolkit/internal/visuals/text/text-visual.h index 7304f0f..c79c254 100644 --- a/dali-toolkit/internal/visuals/text/text-visual.h +++ b/dali-toolkit/internal/visuals/text/text-visual.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_TEXT_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. @@ -22,6 +22,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -142,6 +143,11 @@ public: // from Visual::Base */ void DoCreateInstancePropertyMap(Property::Map& map) const override; + /** + * @copydoc Visual::Base::EnablePreMultipliedAlpha + */ + void EnablePreMultipliedAlpha(bool preMultiplied) override; + protected: /** * @brief Constructor. @@ -187,6 +193,7 @@ private: { unsigned char* textBuffer; unsigned char* styleBuffer; + unsigned char* overlayStyleBuffer; unsigned char* maskBuffer; int width; int height; @@ -197,6 +204,7 @@ private: TilingInfo(int width, int height, Pixel::Format textPixelFormat) : textBuffer(NULL), styleBuffer(NULL), + overlayStyleBuffer(NULL), maskBuffer(NULL), width(width), height(height), @@ -216,6 +224,10 @@ private: { free(styleBuffer); } + if(overlayStyleBuffer) + { + free(overlayStyleBuffer); + } if(maskBuffer) { free(maskBuffer); @@ -269,8 +281,9 @@ private: * @param[in] hasMultipleTextColors Whether the text contains multiple colors. * @param[in] containsColorGlyph Whether the text contains color glyph. * @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.). + * @param[in] isOverlayStyle Whether the style needs to overlay on the text (e.g. strikethrough, underline, etc.). */ - void CreateTextureSet(TilingInfo& info, Renderer& renderer, Sampler& sampler, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled); + void CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sampler& sampler, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle); /** * Create renderer of the text for rendering. @@ -279,8 +292,9 @@ private: * @param[in] hasMultipleTextColors Whether the text contains multiple colors. * @param[in] containsColorGlyph Whether the text contains color glyph. * @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.). + * @param[in] isOverlayStyle Whether the style needs to overlay on the text (e.g. strikethrough, underline, etc.). */ - void AddRenderer(Actor& actor, const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled); + void AddRenderer(Actor& actor, const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle); /** * Get the texture of the text for rendering. @@ -288,8 +302,9 @@ private: * @param[in] hasMultipleTextColors Whether the text contains multiple colors. * @param[in] containsColorGlyph Whether the text contains color glyph. * @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.). + * @param[in] isOverlayStyle Whether the style needs to overlay on the text (e.g. strikethrough, underline, etc.). */ - TextureSet GetTextTexture(const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled); + TextureSet GetTextTexture(const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled, bool isOverlayStyle); /** * Get the text rendering shader. @@ -336,6 +351,7 @@ private: Constraint mColorConstraint{}; ///< Color constraint Constraint mOpacityConstraint{}; ///< Opacity constraint Property::Index mAnimatableTextColorPropertyIndex; ///< The index of animatable text color property registered by the control. + Property::Index mTextColorAnimatableIndex; ///< The index of uTextColorAnimatable property. bool mRendererUpdateNeeded : 1; ///< The flag to indicate whether the renderer needs to be updated. RendererContainer mRendererList; };