+ mRendererList.push_back(mImpl->mRenderer);
+ }
+ // If the pixel data exceeds the maximum size, tiling is required.
+ else
+ {
+ // Filter mode needs to be set to linear to produce better quality while scaling.
+ Sampler sampler = Sampler::New();
+ sampler.SetFilterMode(FilterMode::LINEAR, FilterMode::LINEAR);
+
+ // Create RGBA texture if the text contains emojis or multiple text colors, otherwise L8 texture
+ Pixel::Format textPixelFormat = (containsColorGlyph || hasMultipleTextColors) ? Pixel::RGBA8888 : Pixel::L8;
+
+ // Check the text direction
+ Toolkit::DevelText::TextDirection::Type textDirection = mController->GetTextDirection();
+
+ // Create a texture for the text without any styles
+ PixelData data = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_NO_STYLES, false, textPixelFormat);
+
+ int verifiedWidth = data.GetWidth();
+ int verifiedHeight = data.GetHeight();
+
+ // Set information for creating textures.
+ TilingInfo info(verifiedWidth, maxTextureSize, textPixelFormat);
+
+ // Get the pixel data of text.
+ info.textPixelData = data;
+
+ if(mTextShaderFeatureCache.IsEnabledStyle())
+ {
+ // Create RGBA texture for all the text styles (without the text itself)
+ info.stylePixelData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_NO_TEXT, false, Pixel::RGBA8888);
+ }
+
+ if(mTextShaderFeatureCache.IsEnabledOverlay())
+ {
+ // Create RGBA texture for all the overlay styles
+ info.overlayStylePixelData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_OVERLAY_STYLE, false, Pixel::RGBA8888);
+ }
+
+ if(mTextShaderFeatureCache.IsEnabledEmoji() && !mTextShaderFeatureCache.IsEnabledMultiColor())
+ {
+ // Create a L8 texture as a mask to avoid color glyphs (e.g. emojis) to be affected by text color animation
+ info.maskPixelData = mTypesetter->Render(size, textDirection, Text::Typesetter::RENDER_MASK, false, Pixel::L8);
+ }
+
+ // Get the current offset for recalculate the offset when tiling.
+ Property::Map retMap;
+ mImpl->mTransform.GetPropertyMap(retMap);
+ Property::Value* offsetValue = retMap.Find(Dali::Toolkit::Visual::Transform::Property::OFFSET);
+ if(offsetValue)
+ {
+ offsetValue->Get(info.transformOffset);
+ }
+
+ // Create a textureset in the default renderer.
+ CreateTextureSet(info, mImpl->mRenderer, sampler);
+
+ verifiedHeight -= maxTextureSize;
+
+ Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
+
+ // Create a renderer by cutting maxTextureSize.
+ while(verifiedHeight > 0)
+ {
+ VisualRenderer tilingRenderer = VisualRenderer::New(geometry, shader);
+ tilingRenderer.SetProperty(Dali::Renderer::Property::DEPTH_INDEX, Toolkit::DepthIndex::CONTENT);
+ // New offset position of buffer for tiling.
+ info.offsetHeight += maxTextureSize;
+ // New height for tiling.
+ info.height = (verifiedHeight - maxTextureSize) > 0 ? maxTextureSize : verifiedHeight;
+ // New offset for tiling.
+ info.transformOffset.y += maxTextureSize;
+ // Create a textureset int the new tiling renderer.
+ CreateTextureSet(info, tilingRenderer, sampler);
+
+ verifiedHeight -= maxTextureSize;
+ }
+ }
+
+ mImpl->mFlags &= ~Impl::IS_ATLASING_APPLIED;
+
+ const Vector4& defaultColor = mController->GetTextModel()->GetDefaultColor();
+
+ for(RendererContainer::iterator iter = mRendererList.begin(); iter != mRendererList.end(); ++iter)
+ {
+ Renderer renderer = (*iter);
+ if(renderer)
+ {
+ // Note, AddRenderer will ignore renderer if it is already added. @SINCE 2_3.22
+ actor.AddRenderer(renderer);
+
+ if(renderer != mImpl->mRenderer)
+ {
+ // Set constraint for text label's color for non-default renderers.
+ if(mAnimatableTextColorPropertyIndex != Property::INVALID_INDEX)
+ {
+ // Register unique property, or get property for default renderer.
+ Property::Index index = renderer.RegisterUniqueProperty("uTextColorAnimatable", defaultColor);
+
+ // Create constraint for the animatable text's color Property with uTextColorAnimatable in the renderer.
+ if(index != Property::INVALID_INDEX)
+ {
+ Constraint colorConstraint = Constraint::New<Vector4>(renderer, index, TextColorConstraint);
+ colorConstraint.AddSource(Source(actor, mAnimatableTextColorPropertyIndex));
+ colorConstraint.Apply();
+ }
+
+ // Make zero if the alpha value of text color is zero to skip rendering text
+ // VisualRenderer::Property::OPACITY uses same animatable property internally.
+ Constraint opacityConstraint = Constraint::New<float>(renderer, Dali::DevelRenderer::Property::OPACITY, OpacityConstraint);
+ opacityConstraint.AddSource(Source(actor, mAnimatableTextColorPropertyIndex));
+ opacityConstraint.AddSource(Source(mImpl->mRenderer, mTextRequireRenderPropertyIndex));
+ opacityConstraint.Apply();
+ }
+ }