*/
void DiscardTextLabelVisual(Dali::Toolkit::Visual::Base& visual)
{
- if(DALI_LIKELY(Dali::Stage::IsInstalled() && visual))
+ if(DALI_LIKELY(Dali::Adaptor::IsAvailable() && visual))
{
Dali::Toolkit::VisualFactory::Get().DiscardVisual(visual);
}
const Vector2& size = propertyValue.Get<Vector2>();
if(mSize != size)
{
- mSize = size;
+ mSize = size;
mIsSizeChanged = true;
}
break;
const float width = propertyValue.Get<float>();
if(mSize.width != width)
{
- mSize.width = width;
+ mSize.width = width;
mIsSizeChanged = true;
}
break;
const float height = propertyValue.Get<float>();
if(mSize.height != height)
{
- mSize.height = height;
+ mSize.height = height;
mIsSizeChanged = true;
}
break;
if(mController->GetDefaultColor() != textColor)
{
mController->SetDefaultColor(textColor);
- mTextUpdateNeeded = true;
+ mTextUpdateNeeded = true;
mIsAsyncRenderNeeded = true;
}
break;
if(backgroundValue)
{
Vector4 backgroundColor = Vector4::ZERO;
- backgroundColor = backgroundValue->Get<Vector4>();
+ backgroundColor = backgroundValue->Get<Vector4>();
mController->SetBackgroundColorWithCutout(backgroundColor);
}
}
void TextLabel::OnSceneDisconnection()
{
- mIsSizeChanged = false;
- mIsManualRender = false;
+ mIsSizeChanged = false;
+ mIsManualRender = false;
mIsManualRendered = false;
if(mTextScroller)
Extents padding;
padding = self.GetProperty<Extents>(Toolkit::Control::Property::PADDING);
- float width = std::max(size.x - (padding.start + padding.end), 0.0f);
- float height = std::max(size.y - (padding.top + padding.bottom), 0.0f);
+ float width = std::max(size.x - (padding.start + padding.end), 0.0f);
+ float height = std::max(size.y - (padding.top + padding.bottom), 0.0f);
Vector2 contentSize(width, height);
// Support Right-To-Left
DALI_LOG_RELEASE_INFO("Request render, size : %f, %f\n", contentSize.width, contentSize.height);
AsyncTextParameters parameters = GetAsyncTextParameters(Async::RENDER_FIXED_SIZE, contentSize, padding, layoutDirection);
TextVisual::UpdateAsyncRenderer(mVisual, parameters);
- mTextUpdateNeeded = false;
+ mTextUpdateNeeded = false;
mIsAsyncRenderNeeded = false;
return;
}
mController->GetRawText(text);
AsyncTextParameters parameters;
- parameters.requestType = requestType;
- parameters.textWidth = contentSize.width;
- parameters.textHeight = contentSize.height;
- parameters.padding = padding;
- parameters.layoutDirection = layoutDirection;
- parameters.text = text;
+ parameters.requestType = requestType;
+ parameters.textWidth = contentSize.width;
+ parameters.textHeight = contentSize.height;
+ parameters.padding = padding;
+ parameters.layoutDirection = layoutDirection;
+ parameters.text = text;
parameters.maxTextureSize = Dali::GetMaxTextureSize();
parameters.fontSize = mController->GetDefaultFontSize(Text::Controller::POINT_SIZE);
PixelData data = typesetter->Render(verifiedSize, mController->GetTextDirection(), Text::Typesetter::RENDER_TEXT_AND_STYLES, true, Pixel::RGBA8888); // ignore the horizontal alignment
Texture texture = Texture::New(Dali::TextureType::TEXTURE_2D,
- data.GetPixelFormat(),
- data.GetWidth(),
- data.GetHeight());
+ data.GetPixelFormat(),
+ data.GetWidth(),
+ data.GetHeight());
texture.Upload(data);
TextureSet textureSet = TextureSet::New();
Size controlSize = renderInfo.controlSize;
float wrapGap = renderInfo.autoScrollWrapGap;
- PixelData data = renderInfo.autoScrollPixelData;
- Texture texture = Texture::New(Dali::TextureType::TEXTURE_2D,
+ PixelData data = renderInfo.autoScrollPixelData;
+ Texture texture = Texture::New(Dali::TextureType::TEXTURE_2D,
data.GetPixelFormat(),
data.GetWidth(),
data.GetHeight());
if(mIsManualRender)
{
- mIsManualRender = false;
+ mIsManualRender = false;
mIsManualRendered = true;
}
void TextLabel::EmitAsyncNaturalSizeComputedSignal(float width, float height)
{
Dali::Toolkit::TextLabel handle(GetOwner());
- Extents padding;
+ Extents padding;
padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
mAsyncNaturalSizeComputedSignal.Emit(handle, width + (padding.start + padding.end), height + (padding.top + padding.bottom));
}
void TextLabel::EmitAsyncHeightForWidthComputedSignal(float width, float height)
{
Dali::Toolkit::TextLabel handle(GetOwner());
- Extents padding;
+ Extents padding;
padding = Self().GetProperty<Extents>(Toolkit::Control::Property::PADDING);
mAsyncHeightForWidthComputedSignal.Emit(handle, width, height + (padding.top + padding.bottom));
}
void TextLabel::RequestAsyncNaturalSize()
{
- Actor self = Self();
- Extents padding;
- Size contentSize = Size::ZERO;
+ Actor self = Self();
+ Extents padding;
+ Size contentSize = Size::ZERO;
Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self);
AsyncTextParameters parameters = GetAsyncTextParameters(Async::COMPUTE_NATURAL_SIZE, contentSize, padding, layoutDirection);
void TextLabel::RequestAsyncHeightForWidth(float width)
{
- Actor self = Self();
- Extents padding;
- Size contentSize(width, 0.0f);
+ Actor self = Self();
+ Extents padding;
+ Size contentSize(width, 0.0f);
Dali::LayoutDirection::Type layoutDirection = mController->GetLayoutDirection(self);
AsyncTextParameters parameters = GetAsyncTextParameters(Async::COMPUTE_HEIGHT_FOR_WIDTH, contentSize, padding, layoutDirection);
}
AsyncTextParameters parameters = GetAsyncTextParameters(Async::RENDER_FIXED_SIZE, contentSize, padding, layoutDirection);
- parameters.manualRender = true;
+ parameters.manualRender = true;
- mIsManualRender = TextVisual::UpdateAsyncRenderer(mVisual, parameters);
- mTextUpdateNeeded = false;
+ mIsManualRender = TextVisual::UpdateAsyncRenderer(mVisual, parameters);
+ mTextUpdateNeeded = false;
mIsAsyncRenderNeeded = false;
}
}
AsyncTextParameters parameters = GetAsyncTextParameters(Async::RENDER_FIXED_WIDTH, contentSize, padding, layoutDirection);
- parameters.manualRender = true;
+ parameters.manualRender = true;
- mIsManualRender = TextVisual::UpdateAsyncRenderer(mVisual, parameters);
- mTextUpdateNeeded = false;
+ mIsManualRender = TextVisual::UpdateAsyncRenderer(mVisual, parameters);
+ mTextUpdateNeeded = false;
mIsAsyncRenderNeeded = false;
}
}
AsyncTextParameters parameters = GetAsyncTextParameters(Async::RENDER_CONSTRAINT, contentSize, padding, layoutDirection);
- parameters.manualRender = true;
+ parameters.manualRender = true;
- mIsManualRender = TextVisual::UpdateAsyncRenderer(mVisual, parameters);
- mTextUpdateNeeded = false;
+ mIsManualRender = TextVisual::UpdateAsyncRenderer(mVisual, parameters);
+ mTextUpdateNeeded = false;
mIsAsyncRenderNeeded = false;
}