projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Sync bytesPerPixel when pixelFormat contain float at text-utils-devel
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
devel-api
/
text
/
text-utils-devel.cpp
diff --git
a/dali-toolkit/devel-api/text/text-utils-devel.cpp
b/dali-toolkit/devel-api/text/text-utils-devel.cpp
old mode 100755
(executable)
new mode 100644
(file)
index
e5ad925
..
e4733c1
--- a/
dali-toolkit/devel-api/text/text-utils-devel.cpp
+++ b/
dali-toolkit/devel-api/text/text-utils-devel.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 202
0
Samsung Electronics Co., Ltd.
+ * Copyright (c) 202
1
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.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-172,7
+172,10
@@
void ShapeTextPreprocess(const RendererParameters& textParameters, TextAbstracti
MarkupProcessData markupProcessData(colorRuns,
fontDescriptionRuns,
MarkupProcessData markupProcessData(colorRuns,
fontDescriptionRuns,
- textModel->mLogicalModel->mEmbeddedItems);
+ textModel->mLogicalModel->mEmbeddedItems,
+ textModel->mLogicalModel->mAnchors,
+ textModel->mLogicalModel->mUnderlinedCharacterRuns,
+ textModel->mLogicalModel->mBackgroundColorRuns);
if(textParameters.markupEnabled)
{
if(textParameters.markupEnabled)
{
@@
-825,7
+828,7
@@
void Ellipsis(const RendererParameters& textParameters, TextAbstraction::TextRen
{
Length finalNumberOfGlyphs = 0u;
{
Length finalNumberOfGlyphs = 0u;
- if((
line.ascender - line.descender
) > textLayoutArea.height)
+ if((
GetLineHeight(line)
) > textLayoutArea.height)
{
// The height of the line is bigger than the height of the text area.
// Show the ellipsis glyph even if it doesn't fit in the text area.
{
// The height of the line is bigger than the height of the text area.
// Show the ellipsis glyph even if it doesn't fit in the text area.
@@
-975,6
+978,7
@@
Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR
const bool isTextMirrored = internalDataModel.isTextMirrored;
const Vector<Character>& mirroredUtf32Characters = internalDataModel.mirroredUtf32Characters;
const Length numberOfCharacters = internalDataModel.numberOfCharacters;
const bool isTextMirrored = internalDataModel.isTextMirrored;
const Vector<Character>& mirroredUtf32Characters = internalDataModel.mirroredUtf32Characters;
const Length numberOfCharacters = internalDataModel.numberOfCharacters;
+ const auto ellipsisPosition = textModel->mEllipsisPosition;
Layout::Type layout = Layout::SINGLELINE;
Layout::Type layout = Layout::SINGLELINE;
@@
-1013,12
+1017,11
@@
Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR
// Set the layout parameters.
Size textLayoutArea = Size(static_cast<float>(textParameters.textWidth),
// Set the layout parameters.
Size textLayoutArea = Size(static_cast<float>(textParameters.textWidth),
-
static_cast<float>(textParameters.textHeight));
+ static_cast<float>(textParameters.textHeight));
// padding
// padding
- Extents padding = textParameters.padding;
- internalDataModel.textLayoutArea = Size(textLayoutArea.x - ( padding.start + padding.end ), textLayoutArea.y - ( padding.top + padding.bottom ) );
-
+ Extents padding = textParameters.padding;
+ internalDataModel.textLayoutArea = Size(textLayoutArea.x - (padding.start + padding.end), textLayoutArea.y - (padding.top + padding.bottom));
if(isCircularTextLayout)
{
if(isCircularTextLayout)
{
@@
-1029,9
+1032,8
@@
Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR
// Resize the vector of positions to have the same size than the vector of glyphs.
rendererParameters.positions.Resize(numberOfGlyphs);
// Resize the vector of positions to have the same size than the vector of glyphs.
rendererParameters.positions.Resize(numberOfGlyphs);
- textModel->mLineWrapMode = LineWrap::WORD;
- textModel->mIgnoreSpacesAfterText = false;
- textModel->mMatchSystemLanguageDirection = false;
+ textModel->mLineWrapMode = Text::LineWrap::WORD;
+ textModel->mIgnoreSpacesAfterText = false;
Text::Layout::Parameters layoutParameters(internalDataModel.textLayoutArea,
textModel);
Text::Layout::Parameters layoutParameters(internalDataModel.textLayoutArea,
textModel);
@@
-1052,7
+1054,8
@@
Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR
layoutEngine.LayoutText(layoutParameters,
newLayoutSize,
textParameters.ellipsisEnabled,
layoutEngine.LayoutText(layoutParameters,
newLayoutSize,
textParameters.ellipsisEnabled,
- isAutoScrollEnabled);
+ isAutoScrollEnabled,
+ ellipsisPosition);
return newLayoutSize;
}
return newLayoutSize;
}
@@
-1385,7
+1388,8
@@
void UpdateBuffer(Devel::PixelBuffer src, Devel::PixelBuffer dst, unsigned int x
}
const unsigned int bytesPerPixel = Dali::Pixel::GetBytesPerPixel(pixelFormat);
}
const unsigned int bytesPerPixel = Dali::Pixel::GetBytesPerPixel(pixelFormat);
- if(bytesPerPixel == 0u || bytesPerPixel == 12u || bytesPerPixel == 24u)
+ // Ignore when pixelFormat is invalid or contain float
+ if(bytesPerPixel == 0u || bytesPerPixel == 6u || bytesPerPixel == 12u)
{
return;
}
{
return;
}
@@
-1521,7
+1525,7
@@
Dali::Property::Array RenderForLastIndex(RendererParameters& textParameters)
const LineRun& line = *(lines.Begin() + index);
numberOfCharacters += line.characterRun.numberOfCharacters;
const LineRun& line = *(lines.Begin() + index);
numberOfCharacters += line.characterRun.numberOfCharacters;
- lineOffset = lineSize > 0.f ? lineSize :
(line.ascender + -line.descender
);
+ lineOffset = lineSize > 0.f ? lineSize :
GetLineHeight(line
);
penY += lineOffset;
if((penY + lineOffset) > boundingBox)
{
penY += lineOffset;
if((penY + lineOffset) > boundingBox)
{