#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.
*/
// EXTERNAL INCLUDES
+#include <dali/public-api/animation/constraint.h>
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/object/weak-handle.h>
+#include <dali/public-api/rendering/visual-renderer.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/text/rendering/text-typesetter.h>
*/
void DoCreateInstancePropertyMap(Property::Map& map) const override;
+ /**
+ * @copydoc Visual::Base::EnablePreMultipliedAlpha
+ */
+ void EnablePreMultipliedAlpha(bool preMultiplied) override;
+
protected:
/**
* @brief Constructor.
{
unsigned char* textBuffer;
unsigned char* styleBuffer;
+ unsigned char* overlayStyleBuffer;
unsigned char* maskBuffer;
int width;
int height;
TilingInfo(int width, int height, Pixel::Format textPixelFormat)
: textBuffer(NULL),
styleBuffer(NULL),
+ overlayStyleBuffer(NULL),
maskBuffer(NULL),
width(width),
height(height),
{
free(styleBuffer);
}
+ if(overlayStyleBuffer)
+ {
+ free(overlayStyleBuffer);
+ }
if(maskBuffer)
{
free(maskBuffer);
* @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.
* @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.
* @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.
Text::ControllerPtr mController; ///< The text's controller.
Text::TypesetterPtr mTypesetter; ///< The text's typesetter.
WeakHandle<Actor> mControl; ///< The control where the renderer is added.
+ 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;
};