SET( devel_api_src_dir dali-toolkit/devel-api )\r
\r
SET ( SOURCES ${SOURCES}\r
+ ${devel_api_src_dir}/accessibility-manager/accessibility-manager.cpp\r
${devel_api_src_dir}/builder/builder.cpp\r
${devel_api_src_dir}/builder/json-parser.cpp\r
${devel_api_src_dir}/builder/tree-node.cpp\r
${public_api_src_dir}/image-loader/async-image-loader.cpp\r
${public_api_src_dir}/image-loader/sync-image-loader.cpp\r
${public_api_src_dir}/styling/style-manager.cpp\r
- ${public_api_src_dir}/accessibility-manager/accessibility-manager.cpp\r
${public_api_src_dir}/focus-manager/keyboard-focus-manager.cpp\r
${public_api_src_dir}/dali-toolkit-version.cpp\r
${public_api_src_dir}/enums.cpp\r
utc-Dali-Text-Typesetter.cpp
utc-Dali-Text-ViewModel.cpp
utc-Dali-TextField-internal.cpp
+ utc-Dali-TextSelectionPopup-internal.cpp
utc-Dali-TextureManager.cpp
utc-Dali-Visuals-internal.cpp
utc-Dali-VisualModel.cpp
#include <dummy-visual.h>
#include <../dali-toolkit/dali-toolkit-test-utils/dummy-control.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/internal/controls/control/control-debug.h>
Vector2 naturalSize;
textVisual.GetNaturalSize( naturalSize );
- DALI_TEST_EQUALS( naturalSize, Vector2( 78.f, 20.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS( naturalSize, Vector2( 82.f, 20.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
const float height = textVisual.GetHeightForWidth( 40.f );
- DALI_TEST_EQUALS( height, 38.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+ DALI_TEST_EQUALS( height, 57.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
// Test that NPatchVisual is replaced with debug visual
// TEST_NPATCH_FILE_NAME: image_01.9.jpg
// single line, line spacing = 0px
{
const float EXPECTED_SPACING = 0.0f;
- const Vector2 EXPECTED_LAYOUT_SIZE( 342.0f, 19.0f);
- const Vector3 EXPECTED_NATURAL_SIZE( 342.0f, 20.0f, 0.0f );
+ const Vector2 EXPECTED_LAYOUT_SIZE( 360.0f, 19.0f);
+ const Vector3 EXPECTED_NATURAL_SIZE( 360.0f, 20.0f, 0.0f );
controller->SetText(textSingle);
controller->Relayout(size);
// single line, line spacing = 20px
{
const float EXPECTED_SPACING = 20.0f;
- const Vector2 EXPECTED_LAYOUT_SIZE( 342.0f, 19.0f );
- const Vector3 EXPECTED_NATURAL_SIZE( 342.0f, 40.0f, 0.0f );
+ const Vector2 EXPECTED_LAYOUT_SIZE( 360.0f, 19.0f );
+ const Vector3 EXPECTED_NATURAL_SIZE( 360.0f, 40.0f, 0.0f );
controller->SetText(textSingle);
controller->Relayout(size);
// multi-line, line spacing = 0px
{
const float EXPECTED_SPACING = 0.0f;
- const Vector2 EXPECTED_LAYOUT_SIZE( 332.0f, 39.0f );
- const Vector3 EXPECTED_NATURAL_SIZE( 118.0f, 58.0f, 0.0f );
+ const Vector2 EXPECTED_LAYOUT_SIZE( 350.0f, 39.0f );
+ const Vector3 EXPECTED_NATURAL_SIZE( 124.0f, 58.0f, 0.0f );
controller->SetText(textMulti);
controller->Relayout(size);
// multi-line, line spacing = 20px
{
const float EXPECTED_SPACING = 20.0f;
- const Vector2 EXPECTED_LAYOUT_SIZE( 118.0f, 57.0f );
- const Vector3 EXPECTED_NATURAL_SIZE( 118.0f, 118.0f, 0.0f );
+ const Vector2 EXPECTED_LAYOUT_SIZE( 124.0f, 57.0f );
+ const Vector3 EXPECTED_NATURAL_SIZE( 124.0f, 118.0f, 0.0f );
controller->SetText(textMulti);
controller->Relayout(size);
// multi-line, line spacing = 30px
{
const float EXPECTED_SPACING = 30.0f;
- const Vector2 EXPECTED_LAYOUT_SIZE( 118.0f, 117.0f );
- const Vector3 EXPECTED_NATURAL_SIZE( 118.0f, 148.0f, 0.0f );
+ const Vector2 EXPECTED_LAYOUT_SIZE( 124.0f, 117.0f );
+ const Vector3 EXPECTED_NATURAL_SIZE( 124.0f, 148.0f, 0.0f );
controller->SetText(textMulti);
controller->Relayout(size);
GetCursorPosition( parameters,
cursorInfo );
- if( cursorInfo.primaryPosition.x != data.visualX[index] )
+ if( floor(cursorInfo.primaryPosition.x) != data.visualX[index] )
{
std::cout << " test " << index << " failed. Different 'x' cursor position : " << cursorInfo.primaryPosition.x << ", expected : " << data.visualX[index] << std::endl;
return false;
}
- if( cursorInfo.primaryPosition.y != data.visualY[index] )
+ if( floor(cursorInfo.primaryPosition.y) != data.visualY[index] )
{
std::cout << " test " << index << " failed. Different 'y' cursor position : " << cursorInfo.primaryPosition.y << ", expected : " << data.visualY[index] << std::endl;
return false;
float visualX02[] = { -100.f, 1000.f, 60.f, 79.f, 83.f, 148.f, 99.f };
float visualY02[] = { -100.f, 1000.f, 12.f, 12.f, 12.f, 12.f, 12.f };
CharacterHitTest::Mode mode02[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
- CharacterIndex logicalIndex02[] = { 0, 21u, 8u, 11u, 11u, 13u, 20u };
+ CharacterIndex logicalIndex02[] = { 0, 21u, 7u, 10u, 10u, 14u, 12u };
bool isCharacterHit02[] = { false, false, true, true, true, true, true };
float visualX03[] = { 19.f, 104.f, -2.f, 127.f };
float visualY03[] = { 12.f, 12.f, 12.f, 12.f };
CharacterHitTest::Mode mode03[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
- CharacterIndex logicalIndex03[] = { 3u, 12u, 0, 18u };
+ CharacterIndex logicalIndex03[] = { 3u, 13u, 0, 18u };
bool isCharacterHit03[] = { true, true, false, false };
// 0 5 _ 6 11 12
CharacterHitTest::Mode mode04[] = { CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
- CharacterIndex logicalIndex04[] = { 0, 6u, 6u, 11u, 11u,
+ CharacterIndex logicalIndex04[] = { 0, 5u, 6u, 11u, 11u,
12u, 16u, 17u, 21u, 21u,
- 22u, 25u, 31u, 32u, 34u, 40u, 40u,
+ 22u, 25u, 30u, 32u, 35u, 33u, 40u,
41u };
- bool isCharacterHit04[] = { false, true, true, false, false,
- false, true, true, false, false,
- false, true, true, true, true, false, false };
+ bool isCharacterHit04[] = { false, true, true, true, false,
+ false, true, true, true, false,
+ false, true, true, true, true, true, false };
// 0 10 20 30 40 46
// abcשנבdefג קכghiעיןjk lחלךmnoצמם pqrפרףstuד אוvwxה
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
- CharacterIndex logicalIndex05[] = { 0, 10u, 20u, 30u, 40u, 46u,
- 47u, 52u, 62u, 71u, 82u, 93u,
- 94u, 99u, 112u, 122u, 131u, 140u,
- 141u, 153u, 162u, 171u, 181u, 187u,
- 188u, 194u, 201u, 213u, 222u, 234u,
- 236u, 244u, 254u, 263u, 265u };
+ CharacterIndex logicalIndex05[] = { 0, 10u, 19u, 28u, 39u, 44u,
+ 45u, 49u, 59u, 66u, 78u, 87u,
+ 89u, 96u, 107u, 115u, 124u, 133u,
+ 134u, 145u, 154u, 162u, 171u, 179u,
+ 180u, 184u, 191u, 203u, 212u,
+ 221u, 222u, 233u, 240u, 251u, 265u };
bool isCharacterHit05[] = { false, true, true, true, true, false,
false, true, true, true, true, false,
false, true, true, true, true, false,
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP,
CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP, CharacterHitTest::TAP };
- CharacterIndex logicalIndex06[] = { 0, 10u, 20u, 30u, 40u, 45u,
- 46u, 50u, 60u, 70u, 80u, 92u,
- 93u, 100u, 110u, 120u, 130u, 138u,
- 139u, 150u, 160u, 170u, 180u, 185u,
- 186u, 190u, 200u, 210u, 220u, 231u,
- 232u, 240u, 250u, 260u, 265u };
+ CharacterIndex logicalIndex06[] = { 0, 10u, 19u, 28u, 39u, 44u,
+ 45u, 48u, 57u, 65u, 78u, 87u,
+ 89u, 96u, 107u, 114u, 124u, 133u,
+ 134u, 144u, 154u, 162u, 171u, 178u,
+ 179u, 185u, 192u, 203u, 212u, 221u,
+ 222u, 232u, 240u, 251u, 265u };
bool isCharacterHit06[] = { false, true, true, true, true, false,
false, true, true, true, true, false,
false, true, true, true, true, false,
{
std::cout << " glyph run, index : " << line.glyphRun.glyphIndex << ", num glyphs : " << line.glyphRun.numberOfGlyphs << std::endl;
std::cout << " character run, index : " << line.characterRun.characterIndex << ", num chars : " << line.characterRun.numberOfCharacters << std::endl;
- std::cout << " width : " << line.width << std::endl;
+ std::cout << " width : " << floor(line.width) << std::endl;
std::cout << " ascender : " << line.ascender << std::endl;
std::cout << " descender : " << line.descender << std::endl;
std::cout << " extraLength : " << line.extraLength << std::endl;
return false;
}
- if( fabsf( line.width - expectedLine.width ) > Math::MACHINE_EPSILON_1 )
+ if( fabsf( floor( line.width ) - expectedLine.width ) > Math::MACHINE_EPSILON_1 )
{
std::cout << " Different line info for line : " << index << std::endl;
Print( line );
Vector<FontDescriptionRun> fontDescriptionRuns;
fontDescriptionRuns.PushBack( fontDescriptionRun );
Size textArea(1.f, 1.f);
- Size layoutSize(78.f, 19.f);
- float positions[] = { 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f };
+ Size layoutSize(81.f, 19.f);
+ float positions[] = { 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f };
struct LineRun line =
{
{ 0u, 11u },
{ 0u, 11u },
- 78.f,
+ 81.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun1 );
fontDescriptionRuns.PushBack( fontDescriptionRun2 );
Size textArea(100.f, 300.f);
- Size layoutSize(91.f, 95.f);
+ Size layoutSize(97.f, 95.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f, 42.f, -12.f,
- 0.f, -12.f, 8.f, -9.f, 16.f, -9.f, 26.f, -9.f, 35.f, -9.f, 44.f, -11.f, 50.f, -0.f,
- 0.f, -12.f, 10.f, -12.f, 14.f, -12.f, 25.f, -9.f, 34.f, -9.f, 40.f, -9.f, 49.f, -9.f, 58.f, -11.f, 64.f, -0.f,
- 0.f, -12.f, 4.f, -12.f, 8.f, -9.f, 18.f, -9.f, 27.f, -9.f, 34.f, -0.f, 40.f, -9.f, 49.f, -12.f, 53.f, -0.f, 58.f, -11.f, 65.f, -9.f, 74.f, -9.f, 82.f, -11.f, 90.f, -2.f
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f,
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -2.f, 45.f, -12.f,
+ 0.f, -12.f, 9.f, -9.f, 18.f, -9.f, 28.f, -9.f, 38.f, -9.f, 47.f, -11.f, 53.f, -0.f,
+ 0.f, -12.f, 10.f, -12.f, 15.f, -12.f, 26.f, -9.f, 35.f, -9.f, 42.f, -9.f, 52.f, -9.f, 61.f, -11.f, 67.f, -0.f,
+ 0.f, -12.f, 4.f, -12.f, 9.f, -9.f, 19.f, -9.f, 29.f, -9.f, 36.f, -0.f, 42.f, -9.f, 52.f, -12.f, 57.f, -0.f, 62.f, -11.f, 69.f, -9.f, 79.f, -9.f, 87.f, -11.f, 95.f, -2.f
};
struct LineRun line0 =
{
{ 0u, 12u },
{ 0u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 12u, 6u },
{ 12u, 6u },
- 42.f,
+ 44.f,
15.f,
-4.f,
0.f,
{
{ 18u, 7u },
{ 18u, 7u },
- 49.f,
+ 53.f,
15.f,
-4.f,
- 5.f,
+ 6.f,
0.f,
0.f,
false,
{
{ 25u, 9u },
{ 25u, 10u },
- 63.f,
+ 66.f,
15.f,
-4.f,
- 5.f,
+ 6.f,
0.f,
0.f,
false,
{
{ 34u, 14u },
{ 35u, 14u },
- 91.f,
+ 97.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun4 );
fontDescriptionRuns.PushBack( fontDescriptionRun5 );
Size textArea(100.f, 300.f);
- Size layoutSize(78.f, 114.f);
+ Size layoutSize(81.f, 114.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
- 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 28 .. 37
- 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 38 .. 49
- 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, // 50 .. 54
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 69.f, -10.f, 60.f, -13.f, 54.f, -10.f, 46.f, -10.f, 79.f, -0.f, // 12 .. 21
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -2.f, 35.f, -12.f, // 22 .. 27
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 28 .. 37
+ 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, // 38 .. 49
+ 4.f, -13.f, 13.f, -9.f, 23.f, -9.f, 36.f, -9.f, 0.f, -2.f, // 50 .. 54
};
struct LineRun line0 =
{
{ 0u, 12u },
{ 0u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 79.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 22u, 6u },
{ 22u, 6u },
- 32.f,
+ 34.f,
15.f,
-4.f,
0.f,
{
{ 28u, 10u },
{ 28u, 10u },
- 65.f,
+ 69.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 38u, 12u },
{ 38u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 50u, 5u },
{ 50u, 5u },
- 42.f,
+ 45.f,
15.f,
-4.f,
0.f,
Vector<FontDescriptionRun> fontDescriptionRuns;
fontDescriptionRuns.PushBack( fontDescriptionRun );
Size textArea(100.f, 300.f);
- Size layoutSize(94.f, 57.f);
+ Size layoutSize(98.f, 57.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -9.f, 46.f, -9.f, 56.f, -9.f, 62.f, -13.f, 65.f, -13.f, 74.f, -13.f, 83.f, -9.f,
- 0.f, -9.f, 12.f, -9.f, 22.f, -13.f, 30.f, -9.f, 39.f, -13.f, 43.f, -13.f, 46.f, -9.f, 55.f, -9.f, 66.f, -9.f, 76.f, -9.f, 82.f, -13.f, 85.f, -13.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f,
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -9.f, 48.f, -9.f, 58.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -13.f, 86.f, -9.f,
+ 0.f, -9.f, 13.f, -9.f, 23.f, -13.f, 31.f, -9.f, 41.f, -13.f, 45.f, -13.f, 48.f, -9.f, 57.f, -9.f, 69.f, -9.f, 79.f, -9.f, 85.f, -13.f, 88.f, -13.f,
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -2.f,
};
struct LineRun line0 =
{
{ 0u, 12u },
{ 0u, 12u },
- 91.f,
+ 95.f,
15.f,
-4.f,
0.f,
{
{ 12u, 12u },
{ 12u, 12u },
- 94.f,
+ 98.f,
15.f,
-4.f,
0.f,
{
{ 24u, 5u },
{ 24u, 5u },
- 42.f,
+ 44.f,
15.f,
-4.f,
0.f,
Vector<FontDescriptionRun> fontDescriptionRuns;
fontDescriptionRuns.PushBack( fontDescriptionRun );
Size textArea(100.f, 300.f);
- Size layoutSize(81.f, 38.f);
+ Size layoutSize(84.f, 38.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -2.f, 81.f, -12.f
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -2.f, 85.f, -12.f
};
struct LineRun line0 =
{
{ 0u, 13u },
{ 0u, 13u },
- 81.f,
+ 84.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun2 );
fontDescriptionRuns.PushBack( fontDescriptionRun3 );
Size textArea(100.f, 300.f);
- Size layoutSize(87.f, 51.f);
+ Size layoutSize(89.f, 51.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -14.f, 59.f, -9.f, 69.f, -9.f, 75.f, -13.f, 78.f, -13.f, 87.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -14.f, 60.f, -9.f, 71.f, -9.f, 77.f, -13.f, 80.f, -13.f, 89.f, -0.f,
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -2.f
};
struct LineRun line0 =
{
{ 0u, 12u },
{ 0u, 12u },
- 87.f,
+ 89.f,
25.f,
-7.f,
4.f,
{
{ 12u, 5u },
{ 12u, 5u },
- 42.f,
+ 44.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun );
Size textArea(64.f, 100.f);
- Size layoutSize(31.f, 38.f);
+ Size layoutSize(33.f, 38.f);
float positions[] =
{
- 26.f, -13.f, 17.f, -10.f, 8.f, -10.f, 4.f, -10.f, 0.f, -0.f,
- 22.f, -10.f, 17.f, -10.f, 12.f, -10.f, 4.f, -10.f, 0.f, -10.f
+ 28.f, -13.f, 18.f, -10.f, 9.f, -10.f, 4.f, -10.f, 0.f, -0.f,
+ 23.f, -10.f, 18.f, -10.f, 12.f, -10.f, 4.f, -10.f, 0.f, -10.f
};
struct LineRun line0 =
{
{ 0u, 5u },
{ 0u, 5u },
- 30.f,
+ 32.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
true,
{
{ 5u, 5u },
{ 5u, 5u },
- 31.f,
+ 33.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun );
Size textArea(26.f, 100.f);
- Size layoutSize(21.f, 57.f);
+ Size layoutSize(23.f, 57.f);
float positions[] =
{
- 10.f, -10.f, 5.f, -10.f, 0.f, -10.f,
- 11.f, -10.f, 7.f, -10.f, 0.f, -13.f,
- 13.f, -10.f, 4.f, -10.f, 0.f, -10.f
+ 11.f, -10.f, 5.f, -10.f, 0.f, -10.f,
+ 12.f, -10.f, 8.f, -10.f, 0.f, -13.f,
+ 14.f, -10.f, 4.f, -10.f, 0.f, -10.f
};
struct LineRun line0 =
{
{ 0u, 3u },
{ 0u, 3u },
- 19.f,
+ 20.f,
15.f,
-4.f,
0.f,
{
{ 3u, 3u },
{ 3u, 3u },
- 21.f,
+ 22.f,
15.f,
-4.f,
0.f,
{
{ 6u, 3u },
{ 6u, 3u },
- 21.f,
+ 23.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun16 );
fontDescriptionRuns.PushBack( fontDescriptionRun17 );
Size textArea(100.f, 300.f);
- Size layoutSize(92.f, 361.f);
+ Size layoutSize(100.f, 361.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
- 87.f, -8.f, 82.f, -6.f, 75.f, -8.f, 72.f, -7.f, 71.f, -11.f, 67.f, -0.f, 63.f, -7.f, 62.f, -11.f, 57.f, -11.f, 51.f, -8.f, 50.f, -11.f, 45.f, -11.f, 40.f, -8.f, 37.f, -0.f, 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 0.f, -0.f, // 28 .. 47
- 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 35.f, -0.f, 25.f, -10.f, 17.f, -13.f, 12.f, -10.f, 4.f, -10.f, 0.f, -0.f, // 48 .. 58
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
- 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
- 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 74 .. 85
- 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f, // 92 .. 103
- 81.f, -8.f, 76.f, -6.f, 69.f, -8.f, 66.f, -7.f, 65.f, -11.f, 61.f, -0.f, 57.f, -7.f, 56.f, -11.f, 51.f, -11.f, 45.f, -8.f, 44.f, -11.f, 39.f, -11.f, 34.f, -8.f, 31.f, -0.f, 21.f, -10.f, 13.f, -13.f, 8.f, -10.f, 0.f, -10.f, 88.f, -0.f, // 104 .. 122
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -0.f, // 123 .. 127
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 128 .. 139
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 140 .. 149
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 150 .. 155
- 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
- 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 166 .. 177
- 47.f, -8.f, 42.f, -6.f, 35.f, -8.f, 32.f, -7.f, 31.f, -11.f, 27.f, -0.f, 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 11.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 69.f, -10.f, 60.f, -13.f, 54.f, -10.f, 46.f, -10.f, 79.f, -0.f, // 12 .. 21
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -2.f, 35.f, -12.f, // 22 .. 27
+ 58.f, -8.f, 52.f, -6.f, 45.f, -8.f, 41.f, -7.f, 39.f, -11.f, 34.f, -0.f, 30.f, -7.f, 28.f, -11.f, 23.f, -11.f, 16.f, -8.f, 15.f, -11.f, 9.f, -11.f, 4.f, -8.f, 0.f, -0.f, 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, // 28 .. 47
+ 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, 59.f, -10.f, 50.f, -13.f, 45.f, -10.f, 36.f, -10.f, 31.f, -0.f, // 48 .. 58
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
+ 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, // 74 .. 85
+ 4.f, -13.f, 13.f, -9.f, 23.f, -9.f, 36.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
+ 0.f, -13.f, 8.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 79.f, -0.f, // 92 .. 103
+ 91.f, -8.f, 85.f, -6.f, 78.f, -8.f, 74.f, -7.f, 72.f, -11.f, 67.f, -0.f, 63.f, -7.f, 61.f, -11.f, 56.f, -11.f, 49.f, -8.f, 48.f, -11.f, 42.f, -11.f, 37.f, -8.f, 33.f, -0.f, 23.f, -10.f, 14.f, -13.f, 9.f, -10.f, 0.f, -10.f, 98.f, -0.f, // 104 .. 122
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -0.f, // 123 .. 127
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, // 128 .. 139
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 69.f, -10.f, 60.f, -13.f, 54.f, -10.f, 46.f, -10.f, 79.f, -0.f, // 140 .. 149
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -2.f, 35.f, -12.f, // 150 .. 155
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
+ 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, // 166 .. 177
+ 54.f, -8.f, 49.f, -6.f, 41.f, -8.f, 37.f, -7.f, 35.f, -11.f, 31.f, -0.f, 26.f, -7.f, 24.f, -11.f, 19.f, -11.f, 12.f, -8.f, 11.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
};
struct LineRun line01 =
{
{ 0u, 12u },
{ 0u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 79.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 22u, 6u },
{ 22u, 6u },
- 32.f,
+ 34.f,
15.f,
-4.f,
0.f,
};
struct LineRun line04 =
{
- { 28u, 20u },
- { 28u, 20u },
- 92.f,
+ { 28u, 14u },
+ { 28u, 14u },
+ 63.f,
15.f,
-4.f,
4.f,
};
struct LineRun line05 =
{
- { 48u, 11u },
- { 48u, 11u },
- 75.f,
+ { 42, 12u },
+ { 42, 12u },
+ 79.f,
15.f,
-4.f,
4.f,
0.f,
0.f,
- false,
+ true,
false
};
struct LineRun line06 =
{
- { 59u, 5u },
- { 59u, 5u },
- 29.f,
+ { 54u, 10u },
+ { 54u, 10u },
+ 69.f,
15.f,
-4.f,
0.f,
{
{ 64u, 10u },
{ 64u, 10u },
- 65.f,
+ 69.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
true,
{
{ 74u, 12u },
{ 74u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 86u, 6u },
{ 86u, 6u },
- 42.f,
+ 45.f,
15.f,
-4.f,
0.f,
{
{ 92u, 12u },
{ 92u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 104u, 19u },
{ 104u, 19u },
- 90.f,
+ 100.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 123u, 5u },
{ 123u, 5u },
- 29.f,
+ 31.f,
15.f,
-4.f,
0.f,
{
{ 128u, 12u },
{ 128u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 140u, 10u },
{ 140u, 10u },
- 75.f,
+ 79.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 150u, 6u },
{ 150u, 6u },
- 32.f,
+ 34.f,
15.f,
-4.f,
0.f,
{
{ 156u, 10u },
{ 156u, 10u },
- 65.f,
+ 69.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
true,
{
{ 166u, 12u },
{ 166u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 178u, 14u },
{ 178u, 14u },
- 56.f,
+ 63.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun16 );
fontDescriptionRuns.PushBack( fontDescriptionRun17 );
Size textArea(100.f, 300.f);
- Size layoutSize(92.f, 361.f);
+ Size layoutSize(100.f, 361.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
- 87.f, -8.f, 82.f, -6.f, 75.f, -8.f, 72.f, -7.f, 71.f, -11.f, 67.f, -0.f, 63.f, -7.f, 62.f, -11.f, 57.f, -11.f, 51.f, -8.f, 50.f, -11.f, 45.f, -11.f, 40.f, -8.f, 37.f, -0.f, 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 0.f, -0.f, // 28 .. 47
- 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 35.f, -0.f, 25.f, -10.f, 17.f, -13.f, 12.f, -10.f, 4.f, -10.f, 0.f, -0.f, // 48 .. 58
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
- 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
- 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 74 .. 85
- 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f, // 92 .. 103
- 81.f, -8.f, 76.f, -6.f, 69.f, -8.f, 66.f, -7.f, 65.f, -11.f, 61.f, -0.f, 57.f, -7.f, 56.f, -11.f, 51.f, -11.f, 45.f, -8.f, 44.f, -11.f, 39.f, -11.f, 34.f, -8.f, 31.f, -0.f, 21.f, -10.f, 13.f, -13.f, 8.f, -10.f, 0.f, -10.f, 88.f, -0.f, // 104 .. 122
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -0.f, // 123 .. 127
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 128 .. 139
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 140 .. 149
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 150 .. 155
- 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
- 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 166 .. 177
- 47.f, -8.f, 42.f, -6.f, 35.f, -8.f, 32.f, -7.f, 31.f, -11.f, 27.f, -0.f, 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 11.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 69.f, -10.f, 60.f, -13.f, 54.f, -10.f, 46.f, -10.f, 79.f, -0.f, // 12 .. 21
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -2.f, 35.f, -12.f, // 22 .. 27
+ 58.f, -8.f, 52.f, -6.f, 45.f, -8.f, 41.f, -7.f, 39.f, -11.f, 34.f, -0.f, 30.f, -7.f, 28.f, -11.f, 23.f, -11.f, 16.f, -8.f, 15.f, -11.f, 9.f, -11.f, 4.f, -8.f, 0.f, -0.f, 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, // 28 .. 47
+ 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, 59.f, -10.f, 50.f, -13.f, 45.f, -10.f, 36.f, -10.f, 31.f, -0.f, // 48 .. 58
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
+ 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, // 74 .. 85
+ 4.f, -13.f, 13.f, -9.f, 23.f, -9.f, 36.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
+ 0.f, -13.f, 8.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 79.f, -0.f, // 92 .. 103
+ 91.f, -8.f, 85.f, -6.f, 78.f, -8.f, 74.f, -7.f, 72.f, -11.f, 67.f, -0.f, 63.f, -7.f, 61.f, -11.f, 56.f, -11.f, 49.f, -8.f, 48.f, -11.f, 42.f, -11.f, 37.f, -8.f, 33.f, -0.f, 23.f, -10.f, 14.f, -13.f, 9.f, -10.f, 0.f, -10.f, 98.f, -0.f, // 104 .. 122
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -0.f, // 123 .. 127
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, // 128 .. 139
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 69.f, -10.f, 60.f, -13.f, 54.f, -10.f, 46.f, -10.f, 79.f, -0.f, // 140 .. 149
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -2.f, 35.f, -12.f, // 150 .. 155
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
+ 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, // 166 .. 177
+ 54.f, -8.f, 49.f, -6.f, 41.f, -8.f, 37.f, -7.f, 35.f, -11.f, 31.f, -0.f, 26.f, -7.f, 24.f, -11.f, 19.f, -11.f, 12.f, -8.f, 11.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
};
struct LineRun line01 =
{
{ 0u, 12u },
{ 0u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 79.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 22u, 6u },
{ 22u, 6u },
- 32.f,
+ 34.f,
15.f,
-4.f,
0.f,
};
struct LineRun line04 =
{
- { 28u, 20u },
- { 28u, 20u },
- 92.f,
+ { 28u, 14u },
+ { 28u, 14u },
+ 63.f,
15.f,
-4.f,
4.f,
};
struct LineRun line05 =
{
- { 48u, 11u },
- { 48u, 11u },
- 75.f,
+ { 42u, 12u },
+ { 42u, 12u },
+ 79.f,
15.f,
-4.f,
4.f,
};
struct LineRun line06 =
{
- { 59u, 5u },
- { 59u, 5u },
- 29.f,
+ { 54u, 10u },
+ { 54u, 10u },
+ 69.f,
15.f,
-4.f,
0.f,
{
{ 64u, 10u },
{ 64u, 10u },
- 65.f,
+ 69.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 74u, 12u },
{ 74u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 86u, 6u },
{ 86u, 6u },
- 42.f,
+ 45.f,
15.f,
-4.f,
0.f,
{
{ 92u, 12u },
{ 92u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 104u, 19u },
{ 104u, 19u },
- 90.f,
+ 100.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 123u, 5u },
{ 123u, 5u },
- 29.f,
+ 31.f,
15.f,
-4.f,
0.f,
{
{ 128u, 12u },
{ 128u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 140u, 10u },
{ 140u, 10u },
- 75.f,
+ 79.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 150u, 6u },
{ 150u, 6u },
- 32.f,
+ 34.f,
15.f,
-4.f,
0.f,
{
{ 156u, 10u },
{ 156u, 10u },
- 65.f,
+ 69.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 166u, 12u },
{ 166u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 178u, 14u },
{ 178u, 14u },
- 56.f,
+ 63.f,
15.f,
-4.f,
0.f,
fontDescriptionRuns.PushBack( fontDescriptionRun16 );
fontDescriptionRuns.PushBack( fontDescriptionRun17 );
Size textArea(100.f, 300.f);
- Size layoutSize(92.f, 361.f);
+ Size layoutSize(100.f, 361.f);
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 0 .. 11
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 12 .. 21
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 22 .. 27
- 87.f, -8.f, 82.f, -6.f, 75.f, -8.f, 72.f, -7.f, 71.f, -11.f, 67.f, -0.f, 63.f, -7.f, 62.f, -11.f, 57.f, -11.f, 51.f, -8.f, 50.f, -11.f, 45.f, -11.f, 40.f, -8.f, 37.f, -0.f, 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 0.f, -0.f, // 28 .. 47
- 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 35.f, -0.f, 25.f, -10.f, 17.f, -13.f, 12.f, -10.f, 4.f, -10.f, 0.f, -0.f, // 48 .. 58
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
- 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
- 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 74 .. 85
- 3.f, -13.f, 12.f, -9.f, 21.f, -9.f, 33.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
- 0.f, -13.f, 8.f, -9.f, 17.f, -13.f, 21.f, -13.f, 24.f, -9.f, 33.f, -0.f, 37.f, -9.f, 48.f, -9.f, 58.f, -9.f, 64.f, -13.f, 67.f, -13.f, 76.f, -0.f, // 92 .. 103
- 81.f, -8.f, 76.f, -6.f, 69.f, -8.f, 66.f, -7.f, 65.f, -11.f, 61.f, -0.f, 57.f, -7.f, 56.f, -11.f, 51.f, -11.f, 45.f, -8.f, 44.f, -11.f, 39.f, -11.f, 34.f, -8.f, 31.f, -0.f, 21.f, -10.f, 13.f, -13.f, 8.f, -10.f, 0.f, -10.f, 88.f, -0.f, // 104 .. 122
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -0.f, // 123 .. 127
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, // 128 .. 139
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 65.f, -10.f, 57.f, -13.f, 52.f, -10.f, 44.f, -10.f, 75.f, -0.f, // 140 .. 149
- 21.f, -10.f, 16.f, -10.f, 9.f, -13.f, 0.f, -10.f, 29.f, -2.f, 32.f, -12.f, // 150 .. 155
- 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
- 4.f, -13.f, 12.f, -9.f, 21.f, -13.f, 25.f, -13.f, 28.f, -9.f, 37.f, -0.f, 41.f, -9.f, 52.f, -9.f, 62.f, -9.f, 68.f, -13.f, 71.f, -13.f, 0.f, -0.f, // 166 .. 177
- 47.f, -8.f, 42.f, -6.f, 35.f, -8.f, 32.f, -7.f, 31.f, -11.f, 27.f, -0.f, 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 11.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, // 0 .. 11
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 69.f, -10.f, 60.f, -13.f, 54.f, -10.f, 46.f, -10.f, 79.f, -0.f, // 12 .. 21
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -2.f, 35.f, -12.f, // 22 .. 27
+ 58.f, -8.f, 52.f, -6.f, 45.f, -8.f, 41.f, -7.f, 39.f, -11.f, 34.f, -0.f, 30.f, -7.f, 28.f, -11.f, 23.f, -11.f, 16.f, -8.f, 15.f, -11.f, 9.f, -11.f, 4.f, -8.f, 0.f, -0.f, 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, // 28 .. 47
+ 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, 59.f, -10.f, 50.f, -13.f, 45.f, -10.f, 36.f, -10.f, 31.f, -0.f, // 48 .. 58
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 0.f, -0.f, // 59 .. 63
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 64 .. 73
+ 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, // 74 .. 85
+ 4.f, -13.f, 13.f, -9.f, 23.f, -9.f, 36.f, -9.f, 0.f, -2.f, 0.f, -12.f, // 86 .. 91
+ 0.f, -13.f, 8.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 79.f, -0.f, // 92 .. 103
+ 91.f, -8.f, 85.f, -6.f, 78.f, -8.f, 74.f, -7.f, 72.f, -11.f, 67.f, -0.f, 63.f, -7.f, 61.f, -11.f, 56.f, -11.f, 49.f, -8.f, 48.f, -11.f, 42.f, -11.f, 37.f, -8.f, 33.f, -0.f, 23.f, -10.f, 14.f, -13.f, 9.f, -10.f, 0.f, -10.f, 98.f, -0.f, // 104 .. 122
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -0.f, // 123 .. 127
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, // 128 .. 139
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 69.f, -10.f, 60.f, -13.f, 54.f, -10.f, 46.f, -10.f, 79.f, -0.f, // 140 .. 149
+ 23.f, -10.f, 18.f, -10.f, 10.f, -13.f, 0.f, -10.f, 31.f, -2.f, 35.f, -12.f, // 150 .. 155
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, // 156 .. 165
+ 4.f, -13.f, 12.f, -9.f, 22.f, -13.f, 26.f, -13.f, 29.f, -9.f, 38.f, -0.f, 42.f, -9.f, 54.f, -9.f, 64.f, -9.f, 70.f, -13.f, 73.f, -13.f, 0.f, -0.f, // 166 .. 177
+ 54.f, -8.f, 49.f, -6.f, 41.f, -8.f, 37.f, -7.f, 35.f, -11.f, 31.f, -0.f, 26.f, -7.f, 24.f, -11.f, 19.f, -11.f, 12.f, -8.f, 11.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f, // 178 .. 191
};
struct LineRun line01 =
{
{ 0u, 12u },
{ 0u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 12u, 10u },
{ 12u, 10u },
- 75.f,
+ 79.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 22u, 6u },
{ 22u, 6u },
- 32.f,
+ 34.f,
15.f,
-4.f,
0.f,
};
struct LineRun line04 =
{
- { 28u, 20u },
- { 28u, 20u },
- 92.f,
+ { 28u, 14u },
+ { 28u, 14u },
+ 63.f,
15.f,
-4.f,
4.f,
};
struct LineRun line05 =
{
- { 48u, 11u },
- { 48u, 11u },
- 75.f,
+ { 42u, 12u },
+ { 42u, 12u },
+ 79.f,
15.f,
-4.f,
4.f,
};
struct LineRun line06 =
{
- { 59u, 5u },
- { 59u, 5u },
- 29.f,
+ { 54u, 10u },
+ { 54u, 10u },
+ 69.f,
15.f,
-4.f,
0.f,
{
{ 64u, 10u },
{ 64u, 10u },
- 65.f,
+ 69.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 74u, 12u },
{ 74u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 86u, 6u },
{ 86u, 6u },
- 42.f,
+ 45.f,
15.f,
-4.f,
0.f,
{
{ 92u, 12u },
{ 92u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 104u, 19u },
{ 104u, 19u },
- 90.f,
+ 100.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 123u, 5u },
{ 123u, 5u },
- 29.f,
+ 31.f,
15.f,
-4.f,
0.f,
{
{ 128u, 12u },
{ 128u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 140u, 10u },
{ 140u, 10u },
- 75.f,
+ 79.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 150u, 6u },
{ 150u, 6u },
- 32.f,
+ 34.f,
15.f,
-4.f,
0.f,
{
{ 156u, 10u },
{ 156u, 10u },
- 65.f,
+ 69.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
{
{ 166u, 12u },
{ 166u, 12u },
- 76.f,
+ 79.f,
15.f,
-4.f,
4.f,
{
{ 178u, 14u },
{ 178u, 14u },
- 56.f,
+ 63.f,
15.f,
-4.f,
0.f,
struct LineRun line01 =
{
- { 0u, 14u },
- { 0u, 14u },
- 99.f,
+ { 0u, 13u },
+ { 0u, 13u },
+ 93.f,
15.f,
-4.f,
0.f,
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f, 82.f, -13.f,
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f, 85.f, -13.f,
};
Size textArea( 100.f, 50.f );
{
{ 0u, 12u },
{ 0u, 12u },
- 78.f,
+ 81.f,
15.f,
-4.f,
4.f,
{
{ 12u, 12u },
{ 12u, 12u },
- 93.f,
+ 95.f,
15.f,
-4.f,
0.f,
float positions[] =
{
- 0.f, -12.f, 10.f, -9.f, 19.f, -13.f, 23.f, -13.f, 26.f, -9.f, 35.f, -0.f, 39.f, -9.f, 50.f, -9.f, 60.f, -9.f, 66.f, -13.f, 69.f, -13.f, 78.f, -0.f,
- 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -13.f, 52.f, -9.f, 61.f, -13.f, 65.f, -13.f, 68.f, -9.f, 77.f, -0.f, 81.f, -9.f,
+ 0.f, -12.f, 10.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 52.f, -9.f, 62.f, -9.f, 69.f, -13.f, 72.f, -13.f, 81.f, -0.f,
+ 0.f, -13.f, 9.f, -9.f, 19.f, -9.f, 32.f, -9.f, 41.f, -0.f, 46.f, -13.f, 54.f, -9.f, 64.f, -13.f, 68.f, -13.f, 71.f, -9.f, 80.f, -0.f, 84.f, -9.f,
};
Size textArea( 100.f, 50.f );
struct LineRun line01 =
{
- { 0u, 17u },
- { 0u, 17u },
- 100.f,
+ { 0u, 14u },
+ { 0u, 14u },
+ 97.f,
15.f,
-4.f,
0.f,
float positions[] =
{
- 91.f, -10.f, 83.f, -13.f, 78.f, -10.f, 70.f, -10.f, 65.f, -0.f, 57.f, -10.f, 52.f, -10.f, 45.f, -13.f, 36.f, -10.f, 31.f, -0.f, 24.f, -8.f, 19.f, -6.f, 12.f, -8.f, 9.f, -7.f, 8.f, -11.f, 4.f, -0.f,
+ 88.f, -10.f, 80.f, -13.f, 74.f, -10.f, 66.f, -10.f, 60.f, -0.f, 52.f, -10.f, 47.f, -10.f, 39.f, -13.f, 30.f, -10.f, 24.f, -0.f, 17.f, -8.f, 12.f, -6.f, 4.f, -8.f, 0.f, -7.f, 77.f, -11.f, 72.f, -0.f,
};
Size textArea( 100.f, 50.f );
struct LineRun line01 =
{
- { 0u, 16u },
- { 0u, 16u },
- 94.f,
+ { 0u, 10u },
+ { 0u, 10u },
+ 69.f,
15.f,
-4.f,
- 3.f,
+ 5.f,
0.f,
0.f,
false,
};
struct LineRun line02 =
{
- { 16u, 18u },
- { 16u, 18u },
- 97.f,
+ { 10u, 19u },
+ { 10u, 19u },
+ 99.f,
15.f,
-4.f,
- 4.f,
+ 5.f,
0.f,
0.f,
false,
float positions[] =
{
- 86.f, -10.f, 78.f, -13.f, 73.f, -10.f, 65.f, -10.f, 60.f, -0.f, 52.f, -10.f, 47.f, -10.f, 40.f, -13.f, 31.f, -10.f, 26.f, -0.f, 19.f, -8.f, 14.f, -6.f, 7.f, -8.f, 4.f, -7.f, 3.f, -11.f, 0.f, -0.f,
- 95.f, -7.f, 94.f, -11.f, 89.f, -11.f, 83.f, -8.f, 82.f, -11.f, 77.f, -11.f, 72.f, -8.f, 69.f, -0.f, 59.f, -10.f, 51.f, -13.f, 46.f, -10.f, 38.f, -10.f, 33.f, -0.f, 25.f, -10.f, 20.f, -10.f, 13.f, -13.f, 4.f, -10.f, 0.f, -0.f,
+ 63.f, -10.f, 54.f, -13.f, 49.f, -10.f, 41.f, -10.f, 35.f, -0.f, 27.f, -10.f, 22.f, -10.f, 14.f, -13.f, 4.f, -10.f, 0.f, -0.f, 95.f, -8.f, 90.f, -6.f, 82.f, -8.f, 78.f, -7.f, 77.f, -11.f, 72.f, -0.f,
+ 67.f, -7.f, 66.f, -11.f, 60.f, -11.f, 54.f, -8.f, 52.f, -11.f, 46.f, -11.f, 41.f, -8.f, 37.f, -0.f, 27.f, -10.f, 18.f, -13.f, 13.f, -10.f, 4.f, -10.f, 0.f, -0.f, 93.f, -10.f, 88.f, -10.f, 80.f, -13.f, 71.f, -10.f, 65.f, -0.f,
};
Size textArea( 100.f, 50.f );
{
{ 0u, 11u },
{ 0u, 11u },
- 78.f,
+ 81.f,
15.f,
-4.f,
0.f,
};
Size textArea( 100.f, 19.f );
- Size layoutSize( 78.f, 19.f );
+ Size layoutSize( 81.f, 19.f );
LayoutTextData data =
{
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 0.f, 0.f, 2.f, 61.f, 0.f, 0.f };
+ float positions[] = { 0.f, 0.f, 33.f, 19.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 11.f, 17.f, 0.f, 0.f, 0.f, 0.f };
+ float positions[] = { 9.f, 15.f, 0.f, 0.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 0.f, 0.f, -1.f, 30.f, 0.f, 0.f };
+ float positions[] = { 0.f, 0.f, 14.f, 9.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 0.f, 0.f, 0.f, 0.f, 11.f, 21.f };
+ float positions[] = { 0.f, 0.f, 0.f, 0.f, 9.f, 17.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 22.f, 35.f, 0.f, 0.f, 0.f, 0.f };
+ float positions[] = { 19.f, 31.f, 0.f, 0.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 0.f, 0.f, 0.f, 0.f, 22.f, 42.f };
+ float positions[] = { 0.f, 0.f, 0.f, 0.f, 19.f, 34.f };
Size textArea( 100.f, 300.f );
AlignData data =
fontDescriptionRuns.PushBack( fontDescriptionRun05 );
fontDescriptionRuns.PushBack( fontDescriptionRun06 );
- float positions[] = { 22.f, 35.f, 2.f, 0.f, 0.f, 0.f };
+ float positions[] = { 19.f, 31.f, 33.f, 0.f, 0.f, 0.f };
Size textArea( 100.f, 300.f );
AlignData data =
Size layoutSize01 = Vector2(11.f, 19.f);
// Group: second glyph doesn't exceed the width of the first glyph
- float positions02[] = { 0.f, -11.f , 7.f, -15.f };
+ float positions02[] = { 0.f, -11.f, 7.f, -15.f, };
struct LineRun line02 =
{
{ 0u, 2u },
{ 0u, 2u },
- 15.f,
+ 16.f,
15.f,
-4.f,
0.f,
Vector<LineRun> lines02;
lines02.PushBack( line02 );
- Size layoutSize02 = Vector2(15.f, 19.f);
+ Size layoutSize02 = Vector2(16.f, 19.f);
// Group: second glyph doesn't exceed the width of the first glyph
float positions03[] = { 0.f, -11.f , 2.f, -15.f };
{
return false;
}
- if( fabsf( glyphData.advance - glyph.advance ) > Math::MACHINE_EPSILON_1000 )
+ if( fabsf( glyphData.advance - floor(glyph.advance) ) > Math::MACHINE_EPSILON_1000 )
{
return false;
}
std::cout << " height : " << glyphInfo.height << std::endl;
std::cout << " xBearing : " << glyphInfo.xBearing << std::endl;
std::cout << " yBearing : " << glyphInfo.yBearing << std::endl;
- std::cout << " advance : " << glyphInfo.advance << std::endl;
+ std::cout << " advance : " << floor(glyphInfo.advance) << std::endl;
std::cout << " scaleFactor : " << glyphInfo.scaleFactor << std::endl;
std::cout << " isItalicRequired : " << glyphInfo.isItalicRequired << std::endl;
std::cout << " isBoldRequired : " << glyphInfo.isBoldRequired << std::endl;
"Aliquip sanctůs delicáta quí ěá, et natum aliquam est?\n"
"Asšúm sapěret usu ůť.\n"
"Síť ut apeirián laboramúš percipitur, sůas hařum ín éos?\n";
-const Vector2 LOREM_SCROLL_POSITION( 0.f, -265.f );
-const Length LOREM_NUMBER_OF_LINES = 35u;
+const Vector2 LOREM_SCROLL_POSITION( 0.f, -284.f );
+const Length LOREM_NUMBER_OF_LINES = 36u;
const Length LOREM_NUMBER_OF_LINES_ELIDED = 21u;
const Length LOREM_NUMBER_OF_GLYPHS = 632;
-const Length LOREM_NUMBER_OF_GLYPHS_ELIDED = 395u;
+const Length LOREM_NUMBER_OF_GLYPHS_ELIDED = 373u;
// The expected layout size for UtcDaliTextViewModelGetLayoutSize
-const Size LAYOUT_SIZE( 194.f, 45.f );
+const Size LAYOUT_SIZE( 182.f, 45.f );
// The expected color indices for UtcDaliTextViewModelGetColors
const ColorIndex COLOR_INDICES[] = { 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 2u, 2u, 2u, 2u, 2u, 1u, 1u, 1u, 1u, 1u, 3u, 1u, 1u, 1u, 0u, 0u, 0u, 0u };
const LineRun& lastLine = *( model->GetLines() + numberOfLines - 1u );
const Length numberOfLastLineGlyphs = data.numberOfGlyphs - lastLine.glyphRun.glyphIndex;
- std::cout << " last line alignment offset : " << lastLine.alignmentOffset << std::endl;
+ std::cout << " last line alignment offset : " << floor(lastLine.alignmentOffset) << std::endl;
for( unsigned int index = 0u; index < numberOfLastLineGlyphs; ++index )
{
- if( *( data.positions + index ) != ( lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + index ) ).x ) )
+ if( *( data.positions + index ) != floor(lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + index ) ).x ) )
{
std::cout << " different layout :";
for( unsigned int i = 0; i < numberOfLastLineGlyphs; ++i )
{
- std::cout << " " << ( lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + i ) ).x );
+ std::cout << " " << floor( lastLine.alignmentOffset + ( *( layoutBuffer + lastLine.glyphRun.glyphIndex + i ) ).x );
}
std::cout << std::endl;
std::cout << " expected :";
Size textSize00( 100.f, 100.f );
Size textSize01( 80.f, 100.f );
- float positions01[] = { 0.f, 8.f, 16.f, 26.f, 33.f, 41.f, 45.f, 54.f, 64.0f };
+ float positions01[] = { 0.f, 8.f, 17.f, 27.f, 35.f, 43.f, 47.f, 58.f, 64.0f };
Size textSize02( 80.f, 100.f );
- float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 13.0f };
+ float positions02[] = { 69.f, 63.f, 58.f, 49.f, 45.f, 41.f, 32.f, 23.f, 8.f };
Size textSize03( 80.f, 100.f );
- float positions03[] = { 74.f, 69.f, 66.f, 61.f, 53.f, 51.f, 47.f, 46.f, 41.f, 31.f, 28.f, 14.f, 7.f };
+ float positions03[] = { 55.f, 48.f, 44.f, 42.f, 36.f, 29.f, 26.f, 20.f, 13.f, 8.f, 4.f, 6.f };
Size textSize04( 80.f, 10.f );
float positions04[] = { 2.f };
"<font family='TizenSans'>Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.</font>",
textSize01,
5u,
- 37u,
+ 36u,
positions01
},
{
"<font family='TizenSansHebrew'>צעד על לשון המלצת לאחרונה, אם לכאן שנורו סרבול מדע, קרן דת שפות להפוך.</font>",
textSize02,
5u,
- 49u,
+ 44u,
positions02
},
{
"<font family='TizenSansArabic'>عل النفط ديسمبر الإمداد بال, بين وترك شعار هو. لمّ من المبرمة النفط بالسيطرة, أم يتم تحرّك وبغطاء, عدم في لإعادة وإقامة رجوعهم.</font>",
textSize03,
5u,
- 73u,
+ 62u,
positions03
},
{
--- /dev/null
+/*
+ * Copyright (c) 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
+
+// THIS IS THE HEADER WE ARE TESTING
+#define private public // To access private members of class, just in the internal test cases
+#include <dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h>
+#undef private
+
+using namespace Dali;
+using namespace Toolkit;
+
+void dali_textselectionpopupinternal_startup(void)
+{
+ test_return_value = TET_UNDEF;
+}
+
+void dali_textselectionpopupinternal_cleanup(void)
+{
+ test_return_value = TET_PASS;
+}
+
+int UtcDaliToolkitTextSelectionPopupIconPropertiesN(void)
+{
+ ToolkitTestApplication application;
+ TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
+
+ Toolkit::Internal::TextSelectionPopup& popupImpl = GetImpl(popup);
+ DALI_TEST_EQUALS(std::string(), popupImpl.GetButtonImage(Toolkit::TextSelectionPopup::NONE), TEST_LOCATION);
+ DALI_TEST_EQUALS(std::string(), popupImpl.GetButtonImage(Toolkit::TextSelectionPopup::Buttons(-1)), TEST_LOCATION);
+
+ END_TEST;
+}
+
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
#include <dali-toolkit/internal/visuals/texture-upload-observer.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali-toolkit/internal/visuals/image-atlas-manager.h>
using namespace Dali::Toolkit::Internal;
END_TEST;
}
+
+int UtcTextureManagerUseInvalidMask(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "UtcTextureManagerUseInvalidMask" );
+
+ TextureManager textureManager; // Create new texture manager
+
+ TestObserver observer;
+ std::string filename( TEST_IMAGE_FILE_NAME );
+ std::string maskname("");
+ TextureManager::MaskingDataPointer maskInfo = nullptr;
+ maskInfo.reset(new TextureManager::MaskingData());
+ maskInfo->mAlphaMaskUrl = maskname;
+ maskInfo->mAlphaMaskId = TextureManager::INVALID_TEXTURE_ID;
+ maskInfo->mCropToMask = true;
+ maskInfo->mContentScaleFactor = 1.0f;
+
+ auto textureId( TextureManager::INVALID_TEXTURE_ID );
+ Vector4 atlasRect( 0.f, 0.f, 1.f, 1.f );
+ Dali::ImageDimensions atlasRectSize( 0,0 );
+ bool synchronousLoading(false);
+ bool atlasingStatus(false);
+ bool loadingStatus(false);
+ auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
+ ImageAtlasManagerPtr atlasManager = nullptr;
+ Toolkit::AtlasUploadObserver* atlasUploadObserver = nullptr;
+
+ textureManager.LoadTexture(
+ filename,
+ ImageDimensions(),
+ FittingMode::SCALE_TO_FILL,
+ SamplingMode::BOX_THEN_LINEAR,
+ maskInfo,
+ synchronousLoading,
+ textureId,
+ atlasRect,
+ atlasRectSize,
+ atlasingStatus,
+ loadingStatus,
+ WrapMode::DEFAULT,
+ WrapMode::DEFAULT,
+ &observer,
+ atlasUploadObserver,
+ atlasManager,
+ true,
+ TextureManager::ReloadPolicy::CACHED,
+ preMultiply
+ );
+
+ DALI_TEST_EQUALS( observer.mLoaded, false, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer.mObserverCalled, false, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
+ application.SendNotification();
+ application.Render();
+
+ DALI_TEST_EQUALS( observer.mLoaded, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer.mObserverCalled, true, TEST_LOCATION );
+ DALI_TEST_EQUALS( observer.mCompleteType, TestObserver::CompleteType::UPLOAD_COMPLETE, TEST_LOCATION );
+
+ END_TEST;
+}
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/internal/visuals/visual-factory-cache.h>
#include <dali-toolkit/internal/visuals/color/color-visual.h>
-#include <dali-toolkit/internal/visuals/npatch-loader.h>
#include <dummy-visual.h>
#include <../dali-toolkit/dali-toolkit-test-utils/dummy-control.h>
#include <dali-toolkit/devel-api/visuals/arc-visual-properties-devel.h>
END_TEST;
}
-int UtcDaliNPatchBufferGetRedOffsetAndMask(void)
-{
- TestApplication application;
-
- tet_infoline("UtcDaliNPatchBufferGetRedOffsetAndMask");
-
- int byteOffset = 0;
- int bitMask = 0;
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::A8, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::L8, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::LA88, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGB888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGB8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGBA8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::BGR8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 2 && bitMask == 0xff );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::BGRA8888, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 2 && bitMask == 0xff );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGB565, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf8 );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::BGR565, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0x1f );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGBA4444, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf0 );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::BGRA4444, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0xf0 );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGBA5551, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf8 );
-
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::BGRA5551, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0x1e );
-
- // Compressed formats are not supported
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::INVALID, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_R11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SIGNED_R11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RG11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SIGNED_RG11_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_ETC1, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB_PVRTC_4BPPV1, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA8_ETC2_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
-
- // Not supported
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGB16F, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
- Toolkit::Internal::NPatchBuffer::GetRedOffsetAndMask( Pixel::RGB32F, byteOffset, bitMask );
- DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
-
- END_TEST;
-}
-
int UtcDaliAnimatedVectorImageVisualCreateInstancePropertyMap(void)
{
ToolkitTestApplication application;
utc-Dali-SyncImageLoader.cpp
utc-Dali-ControlWrapper.cpp
utc-Dali-DragAndDropDetector.cpp
+ utc-Dali-NPatchUtilities.cpp
)
# Append list of test harness files (Won't get parsed for test cases)
uint32_t surfaceHeight,
uint32_t horizontalDpi,
uint32_t verticalDpi,
- bool initialize )
+ bool initialize,
+ bool enablePartialUpdate )
: mCore( NULL ),
mSurfaceWidth( surfaceWidth ),
mSurfaceHeight( surfaceHeight ),
mFrame( 0u ),
mDpi{ horizontalDpi, verticalDpi },
- mLastVSyncTime(0u)
+ mLastVSyncTime(0u),
+ mPartialUpdateEnabled(enablePartialUpdate)
{
if( initialize )
{
mGlContextHelperAbstraction,
Integration::RenderToFrameBuffer::FALSE,
Integration::DepthBufferAvailable::TRUE,
- Integration::StencilBufferAvailable::TRUE );
+ Integration::StencilBufferAvailable::TRUE,
+ mPartialUpdateEnabled ? Integration::PartialUpdateAvailable::TRUE : Integration::PartialUpdateAvailable::FALSE );
mCore->ContextCreated();
mRenderStatus.SetNeedsPostRender( false );
mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/);
- mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/);
+ mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
+ mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
mCore->PostRender( false /*do not skip rendering*/ );
mFrame++;
return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
}
+bool TestApplication::PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects)
+{
+ DoUpdate(intervalMilliseconds, location);
+
+ mCore->PreRender(mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
+ mCore->PreRender(mScene, damagedRects);
+
+ return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
+}
+
+bool TestApplication::RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect)
+{
+ mCore->RenderScene(mRenderStatus, mScene, true /*render the off-screen buffers*/, clippingRect);
+ mCore->RenderScene(mRenderStatus, mScene, false /*render the surface*/, clippingRect);
+ mCore->PostRender(false /*do not skip rendering*/);
+
+ mFrame++;
+
+ return mStatus.KeepUpdating() || mRenderStatus.NeedsUpdate();
+}
+
uint32_t TestApplication::GetUpdateStatus()
{
return mStatus.KeepUpdating();
{
// Update Time values
mCore->PreRender( mRenderStatus, false /*do not force clear*/, false /*do not skip rendering*/ );
- mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/);
- mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/);
+ mCore->RenderScene( mRenderStatus, mScene, true /*render the off-screen buffers*/ );
+ mCore->RenderScene( mRenderStatus, mScene, false /*render the surface*/ );
mCore->PostRender( false /*do not skip rendering*/ );
mFrame++;
uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
uint32_t verticalDpi = DEFAULT_VERTICAL_DPI,
- bool initialize = true );
+ bool initialize = true,
+ bool enablePartialUpdate = false );
void Initialize();
void CreateCore();
void ProcessEvent(const Integration::Event& event);
void SendNotification();
bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
+ bool PreRenderWithPartialUpdate(uint32_t intervalMilliseconds, const char* location, std::vector<Rect<int>>& damagedRects);
+ bool RenderWithPartialUpdate(std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect);
uint32_t GetUpdateStatus();
bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
bool RenderOnly( );
struct { uint32_t x; uint32_t y; } mDpi;
uint32_t mLastVSyncTime;
+ bool mPartialUpdateEnabled;
static bool mLoggingEnabled;
};
virtual void StartRender() {};
- virtual bool PreRender( bool resizingSurface ) { return false; };
+ virtual bool PreRender( bool resizingSurface, const std::vector<Rect<int>>& damagedRects, Rect<int>& clippingRect ) { return false; };
- virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) {};
+ virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface, const std::vector<Rect<int>>& damagedRects ) {};
virtual void StopRender() {};
#include <stdlib.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/accessibility-manager/accessibility-manager.h>
#include <dali-toolkit-test-suite-utils.h>
#include <toolkit-accessibility-adaptor.h>
#include <dali-toolkit-test-suite-utils.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali/integration-api/events/touch-event-integ.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
#include <dali-toolkit/dali-toolkit.h>
using namespace Dali;
}
-int UtcDaliAnimatedImageVisualGif01(void)
+int UtcDaliAnimatedImageVisualAnimatedImage01(void)
{
ToolkitTestApplication application;
TestGlAbstraction& gl = application.GetGlAbstraction();
application.SendNotification();
application.Render();
+ // Trigger count is 1 - render a frame
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
// renderer is added to actor
DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
+
Renderer renderer = actor.GetRendererAt( 0u );
DALI_TEST_CHECK( renderer );
application.SendNotification();
application.Render();
+ std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+
Property::Map map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
Property::Value* value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
DALI_TEST_EQUALS( value->Get< int >(), 2, TEST_LOCATION );
application.SendNotification();
application.Render();
+ std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+
map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
DALI_TEST_EQUALS( value->Get< int >(), 2, TEST_LOCATION );
application.SendNotification();
application.Render();
+ std::this_thread::sleep_for( std::chrono::milliseconds( 20 ) ); // wait for next rasterize thread run
+
map = actor.GetProperty< Property::Map >( DummyControl::Property::TEST_VISUAL );
value = map.Find( DevelImageVisual::Property::CURRENT_FRAME_NUMBER );
DALI_TEST_EQUALS( value->Get< int >(), 3, TEST_LOCATION );
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/public-api/align-enumerations.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/devel-api/visuals/image-visual-actions-devel.h>
#include <dali/integration-api/events/key-event-integ.h>
#include <dali-toolkit/devel-api/focus-manager/keyboard-focus-manager-devel.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
using namespace Dali;
using namespace Dali::Toolkit;
--- /dev/null
+/*
+ * Copyright (c) 2020 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <iostream>
+#include <stdlib.h>
+#include <dali-toolkit-test-suite-utils.h>
+#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
+
+using namespace Dali;
+using namespace Dali::Toolkit;
+
+namespace
+{
+
+void InitialiseRegionsToZeroAlpha( Dali::Devel::PixelBuffer pixelBuffer, uint32_t width, uint32_t height, Pixel::Format pixelFormat )
+{
+ unsigned char* buffer = pixelBuffer.GetBuffer();
+ uint32_t bytesPerPixel = GetBytesPerPixel( pixelFormat );
+
+ for( uint32_t row = 0; row < width; ++row )
+ {
+ uint32_t pixelOffset = row * bytesPerPixel;
+ buffer[ pixelOffset + 3 ] = 0x00;
+ pixelOffset += ( height - 1 ) * width * bytesPerPixel;
+ buffer[ pixelOffset + 3 ] = 0x00;
+ }
+
+ for( unsigned int column = 0; column < height; ++column )
+ {
+ uint32_t pixelOffset = column * width * bytesPerPixel;
+ buffer[ pixelOffset + 3 ] = 0x00;
+ pixelOffset += ( width -1 ) * bytesPerPixel;
+ buffer[ pixelOffset + 3 ] = 0x00;
+ }
+}
+
+void AddStretchRegionsToImage( Dali::Devel::PixelBuffer pixelBuffer, uint32_t width, uint32_t height, const Vector4& requiredStretchBorder, Pixel::Format pixelFormat )
+{
+ unsigned char* buffer = pixelBuffer.GetBuffer();
+ uint32_t bytesPerPixel = GetBytesPerPixel( pixelFormat );
+
+ for( uint32_t column = requiredStretchBorder.x; column < width - requiredStretchBorder.z; ++column )
+ {
+ uint32_t pixelOffset = column * bytesPerPixel;
+ buffer[ pixelOffset ] = 0x00;
+ buffer[ pixelOffset + 1 ] = 0x00;
+ buffer[ pixelOffset + 2 ] = 0x00;
+ buffer[ pixelOffset + 3 ] = 0xFF;
+ }
+
+ for( uint32_t row = requiredStretchBorder.y; row < height - requiredStretchBorder.w; ++row )
+ {
+ unsigned int pixelOffset = row * width * bytesPerPixel;
+ buffer[ pixelOffset ] = 0x00;
+ buffer[ pixelOffset + 1 ] = 0x00;
+ buffer[ pixelOffset + 2 ] = 0x00;
+ buffer[ pixelOffset + 3 ] = 0xFF;
+ }
+}
+
+Dali::Devel::PixelBuffer CustomizeNPatch( uint32_t width, uint32_t height, const Vector4& requiredStretchBorder )
+{
+ Pixel::Format pixelFormat = Pixel::RGBA8888;
+ Dali::Devel::PixelBuffer pixelBuffer = Dali::Devel::PixelBuffer::New( width, height, pixelFormat );
+
+ unsigned char* buffer = pixelBuffer.GetBuffer();
+ memset( buffer, 0, width * height * Dali::Pixel::GetBytesPerPixel( pixelFormat ) );
+
+ InitialiseRegionsToZeroAlpha( pixelBuffer, width, height, pixelFormat );
+
+ AddStretchRegionsToImage( pixelBuffer, width, height, requiredStretchBorder, pixelFormat );
+
+ return pixelBuffer;
+}
+
+} //namespace
+
+void dali_npatch_utilities_startup(void)
+{
+ test_return_value = TET_UNDEF;
+}
+
+void dali_npatch_utilities_cleanup(void)
+{
+ test_return_value = TET_PASS;
+}
+
+int UtcDaliNPatchUtilityGetRedOffsetAndMask(void)
+{
+ TestApplication application;
+
+ tet_infoline("UtcDaliNPatchUtilityGetRedOffsetAndMask");
+
+ int32_t byteOffset = 0;
+ int32_t bitMask = 0;
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::A8, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::L8, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::LA88, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGB888, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGB8888, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGBA8888, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xff );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::BGR8888, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 2 && bitMask == 0xff );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::BGRA8888, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 2 && bitMask == 0xff );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGB565, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf8 );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::BGR565, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0x1f );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGBA4444, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf0 );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::BGRA4444, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0xf0 );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGBA5551, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0xf8 );
+
+ NPatchUtility::GetRedOffsetAndMask( Pixel::BGRA5551, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 1 && bitMask == 0x1e );
+
+ // Compressed formats are not supported
+ NPatchUtility::GetRedOffsetAndMask( Pixel::INVALID, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_R11_EAC, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SIGNED_R11_EAC, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RG11_EAC, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SIGNED_RG11_EAC, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_ETC2, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ETC2, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_ETC1, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB_PVRTC_4BPPV1, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA8_ETC2_EAC, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+
+ // Not supported
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGB16F, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+ NPatchUtility::GetRedOffsetAndMask( Pixel::RGB32F, byteOffset, bitMask );
+ DALI_TEST_CHECK( byteOffset == 0 && bitMask == 0 );
+
+ END_TEST;
+}
+
+int UtcDaliNPatchUtilityParseBorders(void)
+{
+ TestApplication application;
+ tet_infoline("UtcDaliNPatchUtilityParseBorders");
+
+ /* Stretch region left(2) top(2) right (2) bottom (2)
+ * ss
+ * OOOOOO
+ * OOOOOOc
+ * sOOooOOc
+ * sOOooOOc
+ * OOOOOOc
+ * OOOOOO
+ * cccc
+ */
+
+ const unsigned int imageHeight = 18;
+ const unsigned int imageWidth = 28;
+ const Vector4 requiredStretchBorder( 3, 4, 5, 6 );
+
+ Dali::Devel::PixelBuffer pixelBuffer = CustomizeNPatch( imageHeight, imageWidth, requiredStretchBorder );
+ DALI_TEST_CHECK( pixelBuffer );
+
+ if( pixelBuffer )
+ {
+ NPatchUtility::StretchRanges stretchPixelsX;
+ NPatchUtility::StretchRanges stretchPixelsY;
+
+ NPatchUtility::ParseBorders( pixelBuffer, stretchPixelsX, stretchPixelsY );
+
+ DALI_TEST_CHECK( stretchPixelsX.Size() == 1 );
+ DALI_TEST_CHECK( stretchPixelsY.Size() == 1 );
+
+ Vector4 stretchBorders;
+ //The NPatch image stretch pixels are in the cropped image space, inset by 1 to get it to uncropped image space
+ stretchBorders.x = stretchPixelsX[ 0 ].GetX() + 1;
+ stretchBorders.y = stretchPixelsY[ 0 ].GetX() + 1;
+ stretchBorders.z = imageHeight - stretchPixelsX[ 0 ].GetY() - 1;
+ stretchBorders.w = imageWidth - stretchPixelsY[ 0 ].GetY() - 1;
+
+ DALI_TEST_EQUALS( stretchBorders, requiredStretchBorder, 0.001, TEST_LOCATION );
+ }
+ else
+ {
+ test_return_value = TET_FAIL;
+ }
+
+ END_TEST;
+}
+
+int UtcDaliNPatchUtilityIsNinePatchUrl(void)
+{
+ tet_infoline( "UtcDaliNPatchUtilityIsNinePatchUrl" );
+
+ DALI_TEST_CHECK( NPatchUtility::IsNinePatchUrl( "test.9.jpg" ) );
+ DALI_TEST_CHECK( NPatchUtility::IsNinePatchUrl( "test.#.jpg" ) );
+ DALI_TEST_CHECK( !NPatchUtility::IsNinePatchUrl( "test.9" ) );
+ DALI_TEST_CHECK( !NPatchUtility::IsNinePatchUrl( "test.#" ) );
+ DALI_TEST_CHECK( !NPatchUtility::IsNinePatchUrl( "test" ) );
+
+ END_TEST;
+}
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali/devel-api/actors/actor-devel.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
using namespace Dali;
using namespace Toolkit;
#include <sstream>
#include <dali-toolkit-test-suite-utils.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
using namespace Dali;
using namespace Toolkit;
application.SendNotification();
application.Render();
- const Vector3 EXPECTED_NATURAL_SIZE( 460.0f, 98.0f, 0.0f );
+ const Vector3 EXPECTED_NATURAL_SIZE( 452.0f, 94.0f, 0.0f );
DALI_TEST_EQUALS( EXPECTED_NATURAL_SIZE, label.GetNaturalSize(), TEST_LOCATION );
// check pixel size
END_TEST;
}
-
-
int UtcDaliToolkitTextSelectionPopupIconProperties(void)
{
ToolkitTestApplication application;
END_TEST;
}
+
+int UtcDaliToolkitTextSelectionPopupSizeProperties(void)
+{
+ ToolkitTestApplication application;
+ TextSelectionPopup popup = TextSelectionPopup::New(nullptr);
+
+ const Vector2 popupMaxSize(200.0f, 300.0f);
+ const Vector2 optionMaxSize(50.0f, 100.0f);
+ const Vector2 optionMinSize(10.0f, 10.0f);
+ const Vector2 optionDividerSize(5.0f, 5.0f);
+ popup.SetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE, popupMaxSize);
+ popup.SetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE, optionMaxSize);
+ popup.SetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE, optionMinSize);
+ popup.SetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE, optionDividerSize);
+
+ DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::POPUP_MAX_SIZE).Get<Vector2>(), popupMaxSize, TEST_LOCATION);
+ DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MAX_SIZE).Get<Vector2>(), optionMaxSize, TEST_LOCATION);
+ DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_MIN_SIZE).Get<Vector2>(), optionMinSize, TEST_LOCATION);
+ DALI_TEST_EQUALS( popup.GetProperty(TextSelectionPopup::Property::OPTION_DIVIDER_SIZE).Get<Vector2>(), optionDividerSize, TEST_LOCATION);
+
+ END_TEST;
+}
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
#include <dali-toolkit/internal/visuals/npatch-loader.h>
#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
#include "dummy-control.h"
#include <dali/integration-api/debug.h>
namespace
{
-typedef Toolkit::Internal::NPatchLoader::StretchRanges StretchRanges;
+typedef Toolkit::NPatchUtility::StretchRanges StretchRanges;
const char* TEST_9_PATCH_FILE_NAME = TEST_RESOURCE_DIR "/demo-tile-texture-focused.9.png";
const char* TEST_NPATCH_FILE_NAME = TEST_RESOURCE_DIR "/heartsframe.9.png";
#include <dali/dali.h>
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
#include <dali-toolkit/public-api/controls/buttons/button.h>
#include <dali-toolkit/public-api/controls/buttons/check-box-button.h>
#include <dali-toolkit/public-api/controls/buttons/push-button.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/public-api/controls/model3d-view/model3d-view.h>
#include <dali-toolkit/public-api/controls/progress-bar/progress-bar.h>
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout-property.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scrollable.h>
#include <dali-toolkit/public-api/controls/slider/slider.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
#include <dali-toolkit/public-api/controls/text-controls/hidden-input-properties.h>
#include <dali-toolkit/public-api/controls/text-controls/placeholder-properties.h>
#include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
#include <dali-toolkit/public-api/image-loader/async-image-loader.h>
#include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
-#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
-
#include <dali-toolkit/public-api/focus-manager/keyboard-focus-manager.h>
#include <dali-toolkit/public-api/styling/style-manager.h>
*/
// CLASS HEADER
-#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
+#include <dali-toolkit/devel-api/accessibility-manager/accessibility-manager.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
*/
// CLASS HEADER
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
// EXTERNAL INCLUDES
#include <dali/integration-api/debug.h>
*/
// CLASS HEADER
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/scroll-bar/scroll-bar-impl.h>
*/
// CLASS HEADER
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/table-view/table-view-impl.h>
#include <string>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
namespace Dali
{
# Add local source files here
SET( devel_api_src_files
+ ${devel_api_src_dir}/accessibility-manager/accessibility-manager.cpp
${devel_api_src_dir}/asset-manager/asset-manager.cpp
${devel_api_src_dir}/builder/base64-encoding.cpp
${devel_api_src_dir}/builder/builder.cpp
${devel_api_src_dir}/controls/control-devel.cpp
${devel_api_src_dir}/controls/control-wrapper.cpp
${devel_api_src_dir}/controls/control-wrapper-impl.cpp
+ ${devel_api_src_dir}/controls/alignment/alignment.cpp
${devel_api_src_dir}/controls/bloom-view/bloom-view.cpp
${devel_api_src_dir}/controls/bubble-effect/bubble-emitter.cpp
${devel_api_src_dir}/controls/buttons/toggle-button.cpp
${devel_api_src_dir}/controls/popup/popup.cpp
${devel_api_src_dir}/controls/progress-bar/progress-bar-devel.cpp
${devel_api_src_dir}/controls/scene3d-view/scene3d-view.cpp
+ ${devel_api_src_dir}/controls/scroll-bar/scroll-bar.cpp
${devel_api_src_dir}/controls/shadow-view/shadow-view.cpp
${devel_api_src_dir}/controls/super-blur-view/super-blur-view.cpp
+ ${devel_api_src_dir}/controls/table-view/table-view.cpp
${devel_api_src_dir}/controls/text-controls/text-editor-devel.cpp
${devel_api_src_dir}/controls/text-controls/text-field-devel.cpp
${devel_api_src_dir}/controls/text-controls/text-selection-popup.cpp
${devel_api_src_dir}/transition-effects/cube-transition-effect.cpp
${devel_api_src_dir}/transition-effects/cube-transition-fold-effect.cpp
${devel_api_src_dir}/transition-effects/cube-transition-wave-effect.cpp
+ ${devel_api_src_dir}/utility/npatch-utilities.cpp
${devel_api_src_dir}/visual-factory/transition-data.cpp
${devel_api_src_dir}/visual-factory/visual-factory.cpp
${devel_api_src_dir}/visual-factory/visual-base.cpp
${devel_api_src_dir}/toolkit-property-index-ranges.h
)
+SET( devel_api_accessibility-manager_header_files
+ ${devel_api_src_dir}/accessibility-manager/accessibility-manager.h
+)
+
SET( devel_api_controls_header_files
${devel_api_src_dir}/controls/control-depth-index-ranges.h
${devel_api_src_dir}/controls/control-devel.h
${devel_api_src_dir}/controls/control-wrapper-impl.h
)
+SET( devel_api_alignment_header_files
+ ${devel_api_src_dir}/controls/alignment/alignment.h
+)
+
SET( devel_api_bloom_view_header_files
${devel_api_src_dir}/controls/bloom-view/bloom-view.h
)
${devel_api_src_dir}/controls/progress-bar/progress-bar-devel.h
)
+SET( devel_api_scroll_bar_header_files
+ ${devel_api_src_dir}/controls/scroll-bar/scroll-bar.h
+)
+
+SET( devel_api_table_view_header_files
+ ${devel_api_src_dir}/controls/table-view/table-view.h
+)
+
SET( devel_api_visual_factory_header_files
${devel_api_src_dir}/visual-factory/transition-data.h
${devel_api_src_dir}/visual-factory/visual-factory.h
${devel_api_src_dir}/drag-drop-detector/drag-and-drop-detector.h
)
+SET( devel_api_utility_header_files
+ ${devel_api_src_dir}/utility/npatch-utilities.h
+)
+
SET( SOURCES ${SOURCES}
${devel_api_src_files}
)
SET( DEVEL_API_HEADERS ${DEVEL_API_HEADERS}
${devel_api_header_files}
+ ${devel_api_accessibility-manager_header_files}
+ ${devel_api_alignment_header_files}
${devel_api_controls_header_files}
${devel_api_bloom_view_header_files}
${devel_api_bubble_emitter_header_files}
${devel_api_page_turn_view_header_files}
${devel_api_popup_header_files}
${devel_api_progress_bar_header_files}
+ ${devel_api_scroll_bar_header_files}
+ ${devel_api_table_view_header_files}
${devel_api_visual_factory_header_files}
${devel_api_visuals_header_files}
${devel_api_scene3d_view_header_files}
${devel_api_video_view_header_files}
${devel_api_web_view_header_files}
${devel_api_drag_and_drop_detector_header_files}
+ ${devel_api_utility_header_files}
)
--- /dev/null
+/*
+* Copyright (c) 2020 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.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*/
+
+// CLASS HEADER
+#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
+
+// EXTERNAL INCLUDES
+#include <dali/integration-api/debug.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace NPatchUtility
+{
+
+namespace
+{
+
+Uint16Pair ParseRange( uint32_t& index, uint32_t width, uint8_t*& pixel, uint32_t pixelStride, int32_t testByte, int32_t testBits, int32_t testValue )
+{
+ unsigned int start = 0xFFFF;
+ for( ; index < width; ++index, pixel += pixelStride )
+ {
+ if( ( pixel[ testByte ] & testBits ) == testValue )
+ {
+ start = index;
+ ++index;
+ pixel += pixelStride;
+ break;
+ }
+ }
+
+ unsigned int end = width;
+ for( ; index < width; ++index, pixel += pixelStride )
+ {
+ if( ( pixel[ testByte ] & testBits ) != testValue )
+ {
+ end = index;
+ ++index;
+ pixel += pixelStride;
+ break;
+ }
+ }
+
+ return Uint16Pair( start, end );
+}
+
+} // unnamed namespace
+
+void GetRedOffsetAndMask( Dali::Pixel::Format pixelFormat, int32_t& byteOffset, int32_t& bitMask )
+{
+ switch( pixelFormat )
+ {
+ case Dali::Pixel::A8:
+ case Dali::Pixel::L8:
+ case Dali::Pixel::LA88:
+ {
+ byteOffset = 0;
+ bitMask = 0;
+ break;
+ }
+ case Dali::Pixel::RGB888:
+ case Dali::Pixel::RGB8888:
+ case Dali::Pixel::RGBA8888:
+ {
+ byteOffset = 0;
+ bitMask = 0xFF;
+ break;
+ }
+ case Dali::Pixel::BGR8888:
+ case Dali::Pixel::BGRA8888:
+ {
+ byteOffset = 2;
+ bitMask = 0xff;
+ break;
+ }
+ case Dali::Pixel::RGB565:
+ {
+ byteOffset = 0;
+ bitMask = 0xf8;
+ break;
+ }
+ case Dali::Pixel::BGR565:
+ {
+ byteOffset = 1;
+ bitMask = 0x1f;
+ break;
+ }
+ case Dali::Pixel::RGBA4444:
+ {
+ byteOffset = 0;
+ bitMask = 0xf0;
+ break;
+ }
+ case Dali::Pixel::BGRA4444:
+ {
+ byteOffset = 1;
+ bitMask = 0xf0;
+ break;
+ }
+ case Dali::Pixel::RGBA5551:
+ {
+ byteOffset = 0;
+ bitMask = 0xf8;
+ break;
+ }
+ case Dali::Pixel::BGRA5551:
+ {
+ byteOffset = 1;
+ bitMask = 0x1e;
+ break;
+ }
+ case Dali::Pixel::INVALID:
+ case Dali::Pixel::COMPRESSED_R11_EAC:
+ case Dali::Pixel::COMPRESSED_SIGNED_R11_EAC:
+ case Dali::Pixel::COMPRESSED_RG11_EAC:
+ case Dali::Pixel::COMPRESSED_SIGNED_RG11_EAC:
+ case Dali::Pixel::COMPRESSED_RGB8_ETC2:
+ case Dali::Pixel::COMPRESSED_SRGB8_ETC2:
+ case Dali::Pixel::COMPRESSED_RGB8_ETC1:
+ case Dali::Pixel::COMPRESSED_RGB_PVRTC_4BPPV1:
+ case Dali::Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+ case Dali::Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
+ case Dali::Pixel::COMPRESSED_RGBA8_ETC2_EAC:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR:
+ case Dali::Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
+ case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
+ {
+ DALI_LOG_ERROR("Pixel formats for compressed images are not compatible with simple masking-out of per-pixel alpha.\n");
+ byteOffset=0;
+ bitMask=0;
+ break;
+ }
+ case Dali::Pixel::RGB16F:
+ case Dali::Pixel::RGB32F:
+ case Dali::Pixel::DEPTH_UNSIGNED_INT:
+ case Dali::Pixel::DEPTH_FLOAT:
+ case Dali::Pixel::DEPTH_STENCIL:
+ {
+ DALI_LOG_ERROR("Pixel format not compatible.\n");
+ byteOffset=0;
+ bitMask=0;
+ break;
+ }
+ }
+}
+
+void ParseBorders( Devel::PixelBuffer& pixelBuffer, StretchRanges& stretchPixelsX, StretchRanges& stretchPixelsY )
+{
+ stretchPixelsX.Clear();
+ stretchPixelsY.Clear();
+
+ Pixel::Format pixelFormat = pixelBuffer.GetPixelFormat();
+
+ int32_t alphaByte = 0;
+ int32_t alphaBits = 0;
+ Pixel::GetAlphaOffsetAndMask( pixelFormat, alphaByte, alphaBits );
+
+ int32_t testByte = alphaByte;
+ int32_t testBits = alphaBits;
+ int32_t testValue = alphaBits; // Opaque == stretch
+ if( !alphaBits )
+ {
+ GetRedOffsetAndMask( pixelFormat, testByte, testBits );
+ testValue = 0; // Black == stretch
+ }
+
+ uint32_t bytesPerPixel = Pixel::GetBytesPerPixel( pixelFormat );
+ uint32_t width = pixelBuffer.GetWidth();
+ uint32_t height = pixelBuffer.GetHeight();
+ uint8_t* srcPixels = pixelBuffer.GetBuffer();
+ uint32_t srcStride = width * bytesPerPixel;
+
+ // TOP
+ uint8_t* top = srcPixels + bytesPerPixel;
+ uint32_t index = 0;
+
+ for( ; index < width - 2; )
+ {
+ Uint16Pair range = ParseRange( index, width - 2, top, bytesPerPixel, testByte, testBits, testValue );
+ if( range.GetX() != 0xFFFF )
+ {
+ stretchPixelsX.PushBack( range );
+ }
+ }
+
+ // LEFT
+ uint8_t* left = srcPixels + srcStride;
+ index = 0;
+ for( ; index < height - 2; )
+ {
+ Uint16Pair range = ParseRange( index, height - 2, left, srcStride, testByte, testBits, testValue );
+ if( range.GetX() != 0xFFFF )
+ {
+ stretchPixelsY.PushBack( range );
+ }
+ }
+
+ // If there are no stretch pixels then make the entire image stretchable
+ if( stretchPixelsX.Size() == 0 )
+ {
+ stretchPixelsX.PushBack( Uint16Pair( 0, width - 2 ) );
+ }
+ if( stretchPixelsY.Size() == 0 )
+ {
+ stretchPixelsY.PushBack( Uint16Pair( 0, height - 2 ) );
+ }
+}
+
+bool IsNinePatchUrl( const std::string& url )
+{
+ bool match = false;
+
+ std::string::const_reverse_iterator iter = url.rbegin();
+ enum { SUFFIX, HASH, HASH_DOT, DONE } state = SUFFIX;
+ while(iter < url.rend())
+ {
+ switch(state)
+ {
+ case SUFFIX:
+ {
+ if(*iter == '.')
+ {
+ state = HASH;
+ }
+ else if(!isalnum(*iter))
+ {
+ state = DONE;
+ }
+ }
+ break;
+ case HASH:
+ {
+ if( *iter == '#' || *iter == '9' )
+ {
+ state = HASH_DOT;
+ }
+ else
+ {
+ state = DONE;
+ }
+ }
+ break;
+ case HASH_DOT:
+ {
+ if(*iter == '.')
+ {
+ match = true;
+ }
+ state = DONE; // Stop testing characters
+ }
+ break;
+ case DONE:
+ {
+ }
+ break;
+ }
+
+ // Satisfy prevent
+ if( state == DONE )
+ {
+ break;
+ }
+
+ ++iter;
+ }
+ return match;
+}
+
+} // namespace NPatchBuffer
+
+} // namespace Toolkit
+
+} // namespace Dali
--- /dev/null
+#ifndef DALI_TOOLKIT_NPATCH_UTILITIES_H
+#define DALI_TOOLKIT_NPATCH_UTILITIES_H
+
+/*
+ * Copyright (c) 2020 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// EXTERNAL INCLUDES
+#include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/math/uint-16-pair.h>
+#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
+
+namespace Dali
+{
+
+namespace Toolkit
+{
+
+namespace NPatchUtility
+{
+
+/**
+ * The list that includes stretch pixel ranges
+ */
+using StretchRanges = Dali::Vector< Uint16Pair >;
+
+/**
+ * @brief Get the offset of the red channel for the format.
+ *
+ * @param[in] pixelFormat The pixel format
+ * @param[out] byteOffset The byte offset of the red channel.
+ * @param[out] bitMask The bit mask of the red channel.
+ */
+DALI_TOOLKIT_API void GetRedOffsetAndMask( Dali::Pixel::Format pixelFormat, int& byteOffset, int& bitMask );
+
+/**
+ * @brief Read the borders of the buffer and determine the child area and stretch borders.
+ *
+ * @param[in] pixelBuffer The npatch image buffer.
+ * @param[out] stretchPixelsX The horizontal stretchable pixels in the cropped image space.
+ * @param[out] stretchPixelsY The vertical stretchable pixels in the cropped image space.
+ */
+DALI_TOOLKIT_API void ParseBorders( Devel::PixelBuffer& pixelBuffer, StretchRanges& stretchPixelsX, StretchRanges& stretchPixelsY );
+
+/**
+ * @brief Helper method to determine if the filename indicates that the image has a 9 patch or n patch border.
+ *
+ * @param [in] url The URL of the image file.
+ * @return true if it is a 9 patch or n patch image
+ */
+DALI_TOOLKIT_API bool IsNinePatchUrl( const std::string& url );
+
+} // namespace NPatchUtility
+
+} // namespace Toolkit
+
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_NPATCH_UTILITIES_H
#include <dali/public-api/object/base-object.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
+#include <dali-toolkit/devel-api/accessibility-manager/accessibility-manager.h>
#include <dali/public-api/adaptor-framework/tts-player.h>
namespace Dali
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
namespace Dali
{
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/buttons/radio-button.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include "button-impl.h"
namespace Dali
#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
+#include <dali-toolkit/devel-api/accessibility-manager/accessibility-manager.h>
#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/devel-api/controls/popup/popup.h>
namespace Dali
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
namespace Dali
{
#include <dali/devel-api/object/property-helper-devel.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/item-factory.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout.h>
#include <dali-toolkit/public-api/controls/scrollable/item-view/default-item-layout-property.h>
#include <dali/integration-api/debug.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-constraints.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-mode.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
#include <dali-toolkit/internal/controls/scrollable/scroll-view/scroll-base-impl.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-effect.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include "array-2d.h"
namespace Dali
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
#include <dali-toolkit/public-api/controls/text-controls/text-editor.h>
#include <dali-toolkit/internal/text/decorator/text-decorator.h>
#include <dali-toolkit/internal/text/text-control-interface.h>
} // switch
}
-Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise )
+Size TextSelectionPopup::GetDimensionToCustomise( const PopupCustomisations& settingToCustomise ) const
{
switch( settingToCustomise )
{
} // switch
}
-std::string TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button )
+const std::string& TextSelectionPopup::GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) const
{
- std::string buttonImageUrl;
switch ( button )
{
- case Toolkit::TextSelectionPopup::CLIPBOARD :
+ case Toolkit::TextSelectionPopup::CLIPBOARD:
{
- buttonImageUrl = mClipboardIconImage;
+ return mClipboardIconImage;
break;
}
- case Toolkit::TextSelectionPopup::CUT :
+ case Toolkit::TextSelectionPopup::CUT:
{
- buttonImageUrl = mCutIconImage;
+ return mCutIconImage;
break;
}
- case Toolkit::TextSelectionPopup::COPY :
+ case Toolkit::TextSelectionPopup::COPY:
{
- buttonImageUrl = mCopyIconImage;
+ return mCopyIconImage;
break;
}
- case Toolkit::TextSelectionPopup::PASTE :
+ case Toolkit::TextSelectionPopup::PASTE:
{
- buttonImageUrl = mPasteIconImage;
+ return mPasteIconImage;
break;
}
- case Toolkit::TextSelectionPopup::SELECT :
+ case Toolkit::TextSelectionPopup::SELECT:
{
- buttonImageUrl = mSelectIconImage;
+ return mSelectIconImage;
break;
}
- case Toolkit::TextSelectionPopup::SELECT_ALL :
+ case Toolkit::TextSelectionPopup::SELECT_ALL:
{
- buttonImageUrl = mSelectAllIconImage;
+ return mSelectAllIconImage;
break;
}
- default :
+ case Toolkit::TextSelectionPopup::NONE:
{
- DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" );
+ break;
}
} // switch
- return buttonImageUrl;
+ DALI_ASSERT_DEBUG( "TextSelectionPopup GetPopupImage Unknown Button" );
+ static std::string empty;
+ return empty;
}
void TextSelectionPopup::SetPressedImage( const std::string& filename )
}
}
- std::size_t TextSelectionPopup::GetNumberOfEnabledOptions()
+ std::size_t TextSelectionPopup::GetNumberOfEnabledOptions() const
{
std::size_t numberOfOptions = 0u;
for( std::vector<ButtonRequirement>::const_iterator it = mOrderListOfButtons.begin(), endIt = mOrderListOfButtons.end(); ( it != endIt ); ++it )
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/buttons/push-button.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
*
* @param[in] setting The setting from the PopupCustomisations enum
*/
- Size GetDimensionToCustomise( const PopupCustomisations& setting );
+ Size GetDimensionToCustomise( const PopupCustomisations& setting ) const;
/**
* @brief Sets the image for the given button of the Popup.
* @param[in] button The button to get the image from
* @return The image used for that button.
*/
- std::string GetButtonImage( Toolkit::TextSelectionPopup::Buttons button );
+ const std::string& GetButtonImage( Toolkit::TextSelectionPopup::Buttons button ) const;
/**
* @brief Sets the image for the pressed state of a popup option.
void AddOption( const ButtonRequirement& button, bool showDivider, bool showIcons, bool showCaption );
- std::size_t GetNumberOfEnabledOptions();
+ std::size_t GetNumberOfEnabledOptions() const;
void AddPopupOptionsToToolbar( bool showIcons, bool showCaptions );
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view.h>
-#include <dali-toolkit/public-api/controls/scroll-bar/scroll-bar.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/scroll-bar/scroll-bar.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
// EXTERNAL INCLUDES
#include <dali/public-api/object/type-registry-helper.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/alignment/alignment.h>
+#include <dali-toolkit/devel-api/controls/alignment/alignment.h>
namespace Dali
{
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
namespace Dali
#include <dali/devel-api/scripting/enum-helper.h>
// INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/table-view/table-view.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/devel-api/controls/tooltip/tooltip-properties.h>
${toolkit_src_dir}/visuals/animated-image/image-cache.cpp
${toolkit_src_dir}/visuals/animated-image/fixed-image-cache.cpp
${toolkit_src_dir}/visuals/animated-image/rolling-image-cache.cpp
- ${toolkit_src_dir}/visuals/animated-image/rolling-gif-image-cache.cpp
+ ${toolkit_src_dir}/visuals/animated-image/rolling-animated-image-cache.cpp
${toolkit_src_dir}/visuals/animated-vector-image/animated-vector-image-visual.cpp
${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-task.cpp
${toolkit_src_dir}/visuals/animated-vector-image/vector-animation-thread.cpp
#include <dali-toolkit/public-api/controls/control.h>
#include <dali-toolkit/public-api/controls/control-impl.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
+#include <dali-toolkit/devel-api/accessibility-manager/accessibility-manager.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/public-api/styling/style-manager.h>
#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
#include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
#include <dali-toolkit/internal/visuals/animated-image/fixed-image-cache.h>
#include <dali-toolkit/internal/visuals/animated-image/rolling-image-cache.h>
-#include <dali-toolkit/internal/visuals/animated-image/rolling-gif-image-cache.h>
+#include <dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.h>
#include <dali-toolkit/devel-api/image-loader/image-atlas.h>
#include <dali-toolkit/devel-api/image-loader/texture-manager.h>
#include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
AnimatedImageVisualPtr AnimatedImageVisual::New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, const Property::Map& properties )
{
AnimatedImageVisualPtr visual( new AnimatedImageVisual( factoryCache, shaderFactory ) );
- visual->InitializeGif( imageUrl );
+ visual->InitializeAnimatedImage( imageUrl );
visual->SetProperties( properties );
if( visual->mFrameCount > 0 )
AnimatedImageVisualPtr AnimatedImageVisual::New( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl )
{
AnimatedImageVisualPtr visual( new AnimatedImageVisual( factoryCache, shaderFactory ) );
- visual->InitializeGif( imageUrl );
+ visual->InitializeAnimatedImage( imageUrl );
if( visual->mFrameCount > 0 )
{
return visual;
}
-void AnimatedImageVisual::InitializeGif( const VisualUrl& imageUrl )
+void AnimatedImageVisual::InitializeAnimatedImage( const VisualUrl& imageUrl )
{
mImageUrl = imageUrl;
- mGifLoading = GifLoading::New( imageUrl.GetUrl(), imageUrl.IsLocalResource() );
- mFrameCount = mGifLoading->GetImageCount();
- mGifLoading->LoadFrameDelays( mFrameDelayContainer );
+ mAnimatedImageLoading = AnimatedImageLoading::New( imageUrl.GetUrl(), imageUrl.IsLocalResource() );
+ mFrameCount = mAnimatedImageLoading.GetImageCount();
}
AnimatedImageVisual::AnimatedImageVisual( VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory )
mImageVisualShaderFactory( shaderFactory ),
mPixelArea( FULL_TEXTURE_RECT ),
mImageUrl(),
- mGifLoading( nullptr ),
+ mAnimatedImageLoading(),
mCurrentFrameIndex( 0 ),
mImageUrls( NULL ),
mImageCache( NULL ),
{
if( mImageUrl.IsValid() )
{
- mImageSize = mGifLoading->GetImageSize();
+ mImageSize = mAnimatedImageLoading.GetImageSize();
}
else if( mImageUrls && mImageUrls->size() > 0 )
{
}
case DevelAnimatedImageVisual::Action::PLAY:
{
- if( IsOnStage() && mActionStatus != DevelAnimatedImageVisual::Action::PLAY )
+ if( mFrameDelayTimer && IsOnStage() && mActionStatus != DevelAnimatedImageVisual::Action::PLAY )
{
mFrameDelayTimer.Start();
}
mUrlIndex = 0;
TextureManager& textureManager = mFactoryCache.GetTextureManager();
- if( mGifLoading != nullptr )
+ if( mAnimatedImageLoading )
{
- mImageCache = new RollingGifImageCache( textureManager, *mGifLoading, mFrameCount, *this, cacheSize, batchSize );
+ mImageCache = new RollingAnimatedImageCache( textureManager, mAnimatedImageLoading, mFrameCount, *this, cacheSize, batchSize );
}
else if( mImageUrls )
{
if( mFrameCount > 1 )
{
int frameDelay = mFrameDelay; // from URL array
- if( mFrameDelayContainer.Count() > 0 ) // from GIF
+ if( mAnimatedImageLoading && mImageCache )
{
- frameDelay = mFrameDelayContainer[0];
+ frameDelay = mImageCache->GetFrameInterval( 0 );
}
-
mFrameDelayTimer = Timer::New( frameDelay );
mFrameDelayTimer.TickSignal().Connect( this, &AnimatedImageVisual::DisplayNextFrame );
mFrameDelayTimer.Start();
return DisplayNextFrame();
}
}
-
- if( mFrameDelayContainer.Count() > 0 )
+ // TODO : newly added one.
+ if( mAnimatedImageLoading && mImageCache )
{
- unsigned int delay = mFrameDelayContainer[mCurrentFrameIndex];
-
+ unsigned int delay = mImageCache->GetFrameInterval( mCurrentFrameIndex );
if( mFrameDelayTimer.GetInterval() != delay )
{
mFrameDelayTimer.SetInterval( delay );
#include <dali/public-api/math/vector4.h>
#include <dali/public-api/object/weak-handle.h>
#include <dali/public-api/adaptor-framework/timer.h>
-#include <dali/devel-api/adaptor-framework/gif-loading.h>
+#include <dali/devel-api/adaptor-framework/animated-image-loading.h>
// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/visual-base-impl.h>
*
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] shaderFactory The ImageVisualShaderFactory object
- * @param[in] imageUrl The URL to gif resource to use
+ * @param[in] imageUrl The URL to animated image resource to use
* @param[in] properties A Property::Map containing settings for this visual
* @return A smart-pointer to the newly allocated visual.
*/
bool DisplayNextFrame();
/**
- * Initialize the gif variables.
- * @param[in] imageUrl The url of the animated gif
+ * Initialize the animated image variables.
+ * @param[in] imageUrl The url of the animated image
*/
- void InitializeGif( const VisualUrl& imageUrl );
+ void InitializeAnimatedImage( const VisualUrl& imageUrl );
// Undefined
AnimatedImageVisual( const AnimatedImageVisual& animatedImageVisual );
WeakHandle<Actor> mPlacementActor;
ImageVisualShaderFactory& mImageVisualShaderFactory;
- // Variables for GIF player
- Dali::Vector<uint32_t> mFrameDelayContainer;
+ // Variables for Animated Image player
Vector4 mPixelArea;
VisualUrl mImageUrl;
- std::unique_ptr<Dali::GifLoading> mGifLoading; // Only needed for animated gifs
+ Dali::AnimatedImageLoading mAnimatedImageLoading; // Only needed for animated image
uint32_t mCurrentFrameIndex; // Frame index into textureRects
// Variables for Multi-Image player
{
while( frameIndex > mFront )
{
- NextFrame();
+ ++mFront;
+ if( mFront >= mImageUrls.size() )
+ {
+ mFront = 0;
+ }
+ LoadBatch();
}
+
mFront = frameIndex;
TextureSet textureSet;
return textureSet;
}
-TextureSet FixedImageCache::NextFrame()
+uint32_t FixedImageCache::GetFrameInterval( uint32_t frameIndex )
{
- TextureSet textureSet;
- ++mFront;
- mFront %= mImageUrls.size();
-
- if( IsFrontReady() == true )
- {
- textureSet = GetFrontTextureSet();
- }
- else
- {
- mWaitingForReadyFrame = true;
- }
- LoadBatch();
-
- return textureSet;
+ return 0u;
}
bool FixedImageCache::IsFrontReady() const
TextureSet FirstFrame() override;
/**
- * Get the next frame. If it's not ready, this will trigger the
- * sending of FrameReady() when the image becomes ready.
- * This will trigger the loading of the next batch.
+ * Get the interval of Nth frame.
*/
- TextureSet NextFrame() override;
+ uint32_t GetFrameInterval( uint32_t frameIndex ) override;
private:
/**
virtual TextureSet FirstFrame() = 0;
/**
- * Get the next frame. If it's not ready, this will trigger the
+ * Get the Nth frame. If it's not ready, this will trigger the
* sending of FrameReady() when the image becomes ready.
- * This will trigger the loading of the next batch.
*/
- virtual TextureSet NextFrame() = 0;
+ virtual TextureSet Frame( uint32_t frameIndex ) = 0;
/**
- * Get the Nth frame. If it's not ready, this will trigger the
- * sending of FrameReady() when the image becomes ready.
+ * Get the interval of Nth frame.
*/
- virtual TextureSet Frame( uint32_t frameIndex ) = 0;
+ virtual uint32_t GetFrameInterval( uint32_t frameIndex ) = 0;
private:
*/
// CLASS HEADER
-#include "rolling-gif-image-cache.h"
+#include "rolling-animated-image-cache.h"
// EXTERNAL HEADERS
namespace Internal
{
-RollingGifImageCache::RollingGifImageCache(
- TextureManager& textureManager, GifLoading& gifLoading, uint32_t frameCount, ImageCache::FrameReadyObserver& observer,
+RollingAnimatedImageCache::RollingAnimatedImageCache(
+ TextureManager& textureManager, AnimatedImageLoading& animatedImageLoading, uint32_t frameCount, ImageCache::FrameReadyObserver& observer,
uint16_t cacheSize, uint16_t batchSize )
: ImageCache( textureManager, observer, batchSize ),
- mGifLoading( gifLoading ),
+ mAnimatedImageLoading( animatedImageLoading ),
mFrameCount( frameCount ),
mFrameIndex( 0 ),
mCacheSize( cacheSize ),
LoadBatch();
}
-RollingGifImageCache::~RollingGifImageCache()
+RollingAnimatedImageCache::~RollingAnimatedImageCache()
{
if( mTextureManagerAlive )
{
- while( !mQueue.IsEmpty() )
+ while( IsFrontReady() )
{
ImageFrame imageFrame = mQueue.PopFront();
Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
}
}
-TextureSet RollingGifImageCache::Frame( uint32_t frameIndex )
+TextureSet RollingAnimatedImageCache::Frame( uint32_t frameIndex )
{
- // If a frame of frameIndex is not loaded, clear the queue and remove all loaded textures.
- if( mImageUrls[ frameIndex ].mTextureId == TextureManager::INVALID_TEXTURE_ID )
+ bool popExist = false;
+ while( IsFrontReady() && mQueue.Front().mFrameNumber != frameIndex )
{
- mFrameIndex = frameIndex;
- while( !mQueue.IsEmpty() )
- {
- ImageFrame imageFrame = mQueue.PopFront();
- Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
- mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
- }
- LoadBatch();
+ ImageFrame imageFrame = mQueue.PopFront();
+ Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
+ mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
+ popExist = true;
}
- // If the frame is already loaded, remove previous frames of the frame in the queue
- // and load new frames amount of removed frames.
- else
+ if( popExist || mImageUrls[ frameIndex ].mTextureId == TextureManager::INVALID_TEXTURE_ID )
{
- bool popExist = false;
- while( !mQueue.IsEmpty() && mQueue.Front().mFrameNumber != frameIndex )
+ // If the frame of frameIndex was already loaded, load batch from the last frame of queue
+ if( IsFrontReady() )
{
- ImageFrame imageFrame = mQueue.PopFront();
- Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
- mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
- popExist = true;
+ mFrameIndex = ( mQueue.Back().mFrameNumber + 1 ) % mFrameCount;
}
- if( popExist )
+ // If the queue is empty, load batch from the frame of frameIndex
+ else
{
- mFrameIndex = ( mQueue.Back().mFrameNumber + 1 ) % mFrameCount;
- LoadBatch();
+ mFrameIndex = frameIndex;
}
+ LoadBatch();
}
return GetFrontTextureSet();
}
-TextureSet RollingGifImageCache::FirstFrame()
+TextureSet RollingAnimatedImageCache::FirstFrame()
{
return Frame( 0u );
}
-TextureSet RollingGifImageCache::NextFrame()
+uint32_t RollingAnimatedImageCache::GetFrameInterval( uint32_t frameIndex )
{
- ImageFrame imageFrame = mQueue.PopFront();
- Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
- mImageUrls[ imageFrame.mFrameNumber ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
-
- LoadBatch();
-
- return GetFrontTextureSet();
+ Frame( frameIndex );
+ return mAnimatedImageLoading.GetFrameInterval( frameIndex );
}
-bool RollingGifImageCache::IsFrontReady() const
+bool RollingAnimatedImageCache::IsFrontReady() const
{
return ( !mQueue.IsEmpty() );
}
-void RollingGifImageCache::LoadBatch()
+void RollingAnimatedImageCache::LoadBatch()
{
// Try and load up to mBatchSize images, until the cache is filled.
// Once the cache is filled, as frames progress, the old frame is
// Get the smallest number of frames we need to load
int batchSize = std::min( std::size_t(mBatchSize), mCacheSize - mQueue.Count() );
- DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingGifImageCache::LoadBatch() mFrameIndex:%d batchSize:%d\n", mFrameIndex, batchSize );
-
- if( mGifLoading.LoadNextNFrames( mFrameIndex, batchSize, pixelDataList) )
+ DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingAnimatedImageCache::LoadBatch() mFrameIndex:%d batchSize:%d\n", mFrameIndex, batchSize );
+ if( mAnimatedImageLoading.LoadNextNFrames( mFrameIndex, batchSize, pixelDataList) )
{
unsigned int pixelDataListCount = pixelDataList.size();
LOG_CACHE;
}
-TextureSet RollingGifImageCache::GetFrontTextureSet() const
+TextureSet RollingAnimatedImageCache::GetFrontTextureSet() const
{
- DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingGifImageCache::GetFrontTextureSet() FrameNumber:%d\n", mQueue[ 0 ].mFrameNumber );
+ DALI_LOG_INFO( gAnimImgLogFilter, Debug::Concise, "RollingAnimatedImageCache::GetFrontTextureSet() FrameNumber:%d\n", mQueue[ 0 ].mFrameNumber );
TextureManager::TextureId textureId = GetCachedTextureId( 0 );
return mTextureManager.GetTextureSet( textureId );
}
-TextureManager::TextureId RollingGifImageCache::GetCachedTextureId( int index ) const
+TextureManager::TextureId RollingAnimatedImageCache::GetCachedTextureId( int index ) const
{
return mImageUrls[ mQueue[ index ].mFrameNumber ].mTextureId;
}
-#ifndef DALI_TOOLKIT_INTERNAL_ROLLING_GIF_IMAGE_CACHE_H
-#define DALI_TOOLKIT_INTERNAL_ROLLING_GIF_IMAGE_CACHE_H
+#ifndef DALI_TOOLKIT_INTERNAL_ROLLING_ANIMATED_IMAGE_CACHE_H
+#define DALI_TOOLKIT_INTERNAL_ROLLING_ANIMATED_IMAGE_CACHE_H
/*
* Copyright (c) 2020 Samsung Electronics Co., Ltd.
*/
// EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/gif-loading.h>
+#include <dali/devel-api/adaptor-framework/animated-image-loading.h>
#include <dali/devel-api/common/circular-queue.h>
#include <dali-toolkit/internal/visuals/animated-image/image-cache.h>
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
{
/**
- * Class to manage a rolling cache of GIF images, where the cache size
+ * Class to manage a rolling cache of Animated images, where the cache size
* is smaller than the total number of images.
*
* Frames are always ready, so the observer.FrameReady callback is never triggered;
* the FirstFrame and NextFrame APIs will always return a texture.
*/
-class RollingGifImageCache : public ImageCache
+class RollingAnimatedImageCache : public ImageCache
{
public:
/**
* Constructor.
* @param[in] textureManager The texture manager
- * @param[in] gifLoader The loaded gif image
- * @param[in] frameCount The number of frames in the gif
+ * @param[in] animatedImageLoader The loaded animated image
+ * @param[in] frameCount The number of frames in the animated image
* @param[in] observer FrameReady observer
* @param[in] cacheSize The size of the cache
* @param[in] batchSize The size of a batch to load
* This will start loading textures immediately, according to the
* batch and cache sizes.
*/
- RollingGifImageCache( TextureManager& textureManager,
- GifLoading& gifLoader,
+ RollingAnimatedImageCache( TextureManager& textureManager,
+ AnimatedImageLoading& animatedImageLoader,
uint32_t frameCount,
ImageCache::FrameReadyObserver& observer,
uint16_t cacheSize,
/**
* Destructor
*/
- virtual ~RollingGifImageCache();
+ virtual ~RollingAnimatedImageCache();
/**
* Get the Nth frame. If it's not ready, this will trigger the
TextureSet FirstFrame() override;
/**
- * Get the next frame. If it's not ready, this will trigger the
- * sending of FrameReady() when the image becomes ready.
- * This will trigger the loading of the next batch.
+ * Get the interval of Nth frame.
*/
- TextureSet NextFrame() override;
+ uint32_t GetFrameInterval( uint32_t frameIndex ) override;
private:
/**
unsigned int mFrameNumber = 0u;
};
- GifLoading& mGifLoading;
- uint32_t mFrameCount;
- int mFrameIndex;
- std::vector<UrlStore> mImageUrls;
- uint16_t mCacheSize;
- CircularQueue<ImageFrame> mQueue;
+ Dali::AnimatedImageLoading& mAnimatedImageLoading;
+ uint32_t mFrameCount;
+ int mFrameIndex;
+ std::vector<UrlStore> mImageUrls;
+ uint16_t mCacheSize;
+ CircularQueue<ImageFrame> mQueue;
};
} // namespace Internal
+
} // namespace Toolkit
+
} // namespace Dali
-#endif
+#endif //DALI_TOOLKIT_INTERNAL_ROLLING_ANIMATED_IMAGE_CACHE_H
return Frame( 0u );
}
-TextureSet RollingImageCache::NextFrame()
+uint32_t RollingImageCache::GetFrameInterval( uint32_t frameIndex )
{
- TextureSet textureSet;
-
- ImageFrame imageFrame = mQueue.PopFront();
- mTextureManager.Remove( mImageUrls[ imageFrame.mUrlIndex ].mTextureId, this );
- mImageUrls[ imageFrame.mUrlIndex ].mTextureId = TextureManager::INVALID_TEXTURE_ID;
-
- LoadBatch();
-
- if( IsFrontReady() == true )
- {
- textureSet = GetFrontTextureSet();
- }
- else
- {
- mWaitingForReadyFrame = true;
- }
-
- return textureSet;
+ return 0u;
}
bool RollingImageCache::IsFrontReady() const
TextureSet FirstFrame() override;
/**
- * Get the next frame. If it's not ready, this will trigger the
- * sending of FrameReady() when the image becomes ready.
- * This will trigger the loading of the next batch.
+ * Get the interval of Nth frame.
*/
- TextureSet NextFrame() override;
+ uint32_t GetFrameInterval( uint32_t frameIndex ) override;
private:
/**
// CLASS HEADER
#include <dali-toolkit/internal/visuals/npatch-loader.h>
-// EXTERNAL HEADER
-#include <dali/devel-api/adaptor-framework/image-loading.h>
+// EXTERNAL INCLUDES
#include <dali/devel-api/common/hash.h>
#include <dali/integration-api/debug.h>
namespace NPatchBuffer
{
-void GetRedOffsetAndMask( Dali::Pixel::Format pixelFormat, int& byteOffset, int& bitMask )
-{
- switch( pixelFormat )
- {
- case Dali::Pixel::A8:
- case Dali::Pixel::L8:
- case Dali::Pixel::LA88:
- {
- byteOffset = 0;
- bitMask = 0;
- break;
- }
- case Dali::Pixel::RGB888:
- case Dali::Pixel::RGB8888:
- case Dali::Pixel::RGBA8888:
- {
- byteOffset = 0;
- bitMask = 0xFF;
- break;
- }
- case Dali::Pixel::BGR8888:
- case Dali::Pixel::BGRA8888:
- {
- byteOffset = 2;
- bitMask = 0xff;
- break;
- }
- case Dali::Pixel::RGB565:
- {
- byteOffset = 0;
- bitMask = 0xf8;
- break;
- }
- case Dali::Pixel::BGR565:
- {
- byteOffset = 1;
- bitMask = 0x1f;
- break;
- }
- case Dali::Pixel::RGBA4444:
- {
- byteOffset = 0;
- bitMask = 0xf0;
- break;
- }
- case Dali::Pixel::BGRA4444:
- {
- byteOffset = 1;
- bitMask = 0xf0;
- break;
- }
- case Dali::Pixel::RGBA5551:
- {
- byteOffset = 0;
- bitMask = 0xf8;
- break;
- }
- case Dali::Pixel::BGRA5551:
- {
- byteOffset = 1;
- bitMask = 0x1e;
- break;
- }
- case Dali::Pixel::INVALID:
- case Dali::Pixel::COMPRESSED_R11_EAC:
- case Dali::Pixel::COMPRESSED_SIGNED_R11_EAC:
- case Dali::Pixel::COMPRESSED_RG11_EAC:
- case Dali::Pixel::COMPRESSED_SIGNED_RG11_EAC:
- case Dali::Pixel::COMPRESSED_RGB8_ETC2:
- case Dali::Pixel::COMPRESSED_SRGB8_ETC2:
- case Dali::Pixel::COMPRESSED_RGB8_ETC1:
- case Dali::Pixel::COMPRESSED_RGB_PVRTC_4BPPV1:
- case Dali::Pixel::COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
- case Dali::Pixel::COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
- case Dali::Pixel::COMPRESSED_RGBA8_ETC2_EAC:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_4x4_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_5x4_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_5x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_6x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_6x6_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x6_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_8x8_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x5_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x6_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x8_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_10x10_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_12x10_KHR:
- case Dali::Pixel::COMPRESSED_RGBA_ASTC_12x12_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:
- case Dali::Pixel::COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:
- {
- DALI_LOG_ERROR("Pixel formats for compressed images are not compatible with simple masking-out of per-pixel alpha.\n");
- byteOffset=0;
- bitMask=0;
- break;
- }
- case Dali::Pixel::RGB16F:
- case Dali::Pixel::RGB32F:
- case Dali::Pixel::DEPTH_UNSIGNED_INT:
- case Dali::Pixel::DEPTH_FLOAT:
- case Dali::Pixel::DEPTH_STENCIL:
- {
- DALI_LOG_ERROR("Pixel format not compatible.\n");
- byteOffset=0;
- bitMask=0;
- break;
- }
- }
-}
-
-Uint16Pair ParseRange( unsigned int& index, unsigned int width, unsigned char*& pixel, unsigned int pixelStride, int testByte, int testBits, int testValue )
-{
- unsigned int start = 0xFFFF;
- for( ; index < width; ++index, pixel += pixelStride )
- {
- if( ( pixel[ testByte ] & testBits ) == testValue )
- {
- start = index;
- ++index;
- pixel += pixelStride;
- break;
- }
- }
-
- unsigned int end = width;
- for( ; index < width; ++index, pixel += pixelStride )
- {
- if( ( pixel[ testByte ] & testBits ) != testValue )
- {
- end = index;
- ++index;
- pixel += pixelStride;
- break;
- }
- }
-
- return Uint16Pair( start, end );
-}
-
-void ParseBorders( Devel::PixelBuffer& pixelBuffer, NPatchLoader::Data* data )
-{
- data->stretchPixelsX.Clear();
- data->stretchPixelsY.Clear();
-
- Pixel::Format pixelFormat = pixelBuffer.GetPixelFormat();
-
- int alphaByte = 0;
- int alphaBits = 0;
- Pixel::GetAlphaOffsetAndMask( pixelFormat, alphaByte, alphaBits );
-
- int testByte = alphaByte;
- int testBits = alphaBits;
- int testValue = alphaBits; // Opaque == stretch
- if( !alphaBits )
- {
- GetRedOffsetAndMask( pixelFormat, testByte, testBits );
- testValue = 0; // Black == stretch
- }
-
- unsigned int bytesPerPixel = Pixel::GetBytesPerPixel( pixelFormat );
- unsigned int width = pixelBuffer.GetWidth();
- unsigned int height = pixelBuffer.GetHeight();
- unsigned char* srcPixels = pixelBuffer.GetBuffer();
- unsigned int srcStride = width * bytesPerPixel;
-
- // TOP
- unsigned char* top = srcPixels + bytesPerPixel;
- unsigned int index = 0;
-
- for( ; index < width - 2; )
- {
- Uint16Pair range = ParseRange( index, width - 2, top, bytesPerPixel, testByte, testBits, testValue );
- if( range.GetX() != 0xFFFF )
- {
- data->stretchPixelsX.PushBack( range );
- }
- }
-
- // LEFT
- unsigned char* left = srcPixels + srcStride;
- index = 0;
- for( ; index < height - 2; )
- {
- Uint16Pair range = ParseRange( index, height - 2, left, srcStride, testByte, testBits, testValue );
- if( range.GetX() != 0xFFFF )
- {
- data->stretchPixelsY.PushBack( range );
- }
- }
-
- // If there are no stretch pixels then make the entire image stretchable
- if( data->stretchPixelsX.Size() == 0 )
- {
- data->stretchPixelsX.PushBack( Uint16Pair( 0, width - 2 ) );
- }
- if( data->stretchPixelsY.Size() == 0 )
- {
- data->stretchPixelsY.PushBack( Uint16Pair( 0, height - 2 ) );
- }
-}
-
void SetLoadedNPatchData( NPatchLoader::Data* data, Devel::PixelBuffer& pixelBuffer )
{
if( data->border == Rect< int >( 0, 0, 0, 0 ) )
{
- NPatchBuffer::ParseBorders( pixelBuffer, data );
+ NPatchUtility::ParseBorders( pixelBuffer, data->stretchPixelsX, data->stretchPixelsY );
// Crop the image
pixelBuffer.Crop( 1, 1, pixelBuffer.GetWidth() - 2, pixelBuffer.GetHeight() - 2 );
data->textureSet = mCache[ index ]->textureSet;
- StretchRanges stretchRangesX;
+ NPatchUtility::StretchRanges stretchRangesX;
stretchRangesX.PushBack( Uint16Pair( border.left, ( (data->croppedWidth >= static_cast< unsigned int >( border.right )) ? data->croppedWidth - border.right : 0 ) ) );
- StretchRanges stretchRangesY;
+ NPatchUtility::StretchRanges stretchRangesY;
stretchRangesY.PushBack( Uint16Pair( border.top, ( (data->croppedHeight >= static_cast< unsigned int >( border.bottom )) ? data->croppedHeight - border.bottom : 0 ) ) );
data->stretchPixelsX = stretchRangesX;
// EXTERNAL INCLUDES
#include <string>
#include <dali/public-api/rendering/texture-set.h>
-#include <dali/public-api/math/uint-16-pair.h>
#include <dali/devel-api/common/owner-container.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
-// INTERNAL HEADERS
+// INTERNAL INCLUDES
#include <dali-toolkit/internal/visuals/texture-manager-impl.h>
+#include <dali-toolkit/devel-api/utility/npatch-utilities.h>
namespace Dali
{
namespace Internal
{
-namespace NPatchBuffer
-{
-
-void GetRedOffsetAndMask( Dali::Pixel::Format pixelFormat, int& byteOffset, int& bitMask );
-
-} // namespace NPatchBuffer
-
/**
* The manager for loading Npatch textures.
* It caches them internally for better performance; i.e. to avoid loading and
{
public:
- typedef Dali::Vector< Uint16Pair > StretchRanges;
-
enum
{
UNINITIALIZED_ID = 0 ///< uninitialised id, use to initialize ids
std::string url; ///< Url of the N-Patch
TextureSet textureSet; ///< Texture containing the cropped image
- StretchRanges stretchPixelsX; ///< X stretch pixels
- StretchRanges stretchPixelsY; ///< Y stretch pixels
+ NPatchUtility::StretchRanges stretchPixelsX; ///< X stretch pixels
+ NPatchUtility::StretchRanges stretchPixelsY; ///< Y stretch pixels
std::size_t hash; ///< Hash code for the Url
uint32_t croppedWidth; ///< Width of the cropped middle part of N-patch
uint32_t croppedHeight; ///< Height of the cropped middle part of N-patch
vertices.PushBack( Vector2( x, y ) );
}
-void RegisterStretchProperties( Renderer& renderer, const char * uniformName, const NPatchLoader::StretchRanges& stretchPixels, uint16_t imageExtent)
+void RegisterStretchProperties( Renderer& renderer, const char * uniformName, const NPatchUtility::StretchRanges& stretchPixels, uint16_t imageExtent)
{
uint16_t prevEnd = 0;
uint16_t prevFix = 0;
uint16_t prevStretch = 0;
unsigned int i = 1;
- for( NPatchLoader::StretchRanges::ConstIterator it = stretchPixels.Begin(); it != stretchPixels.End(); ++it, ++i )
+ for( NPatchUtility::StretchRanges::ConstIterator it = stretchPixels.Begin(); it != stretchPixels.End(); ++it, ++i )
{
uint16_t start = it->GetX();
uint16_t end = it->GetY();
const NPatchLoader::Data* data;
// 0 is either no data (load failed?) or no stretch regions on image
// for both cases we use the default shader
- NPatchLoader::StretchRanges::SizeType xStretchCount = 0;
- NPatchLoader::StretchRanges::SizeType yStretchCount = 0;
+ NPatchUtility::StretchRanges::SizeType xStretchCount = 0;
+ NPatchUtility::StretchRanges::SizeType yStretchCount = 0;
auto fragmentShader = mAuxiliaryPixelBuffer ? FRAGMENT_MASK_SHADER
: FRAGMENT_SHADER;
{
Devel::PixelBuffer pixelBuffer = LoadImageFromFile( url.GetUrl(), desiredSize, fittingMode, samplingMode,
orientationCorrection );
- if( maskInfo )
+ if( maskInfo && maskInfo->mAlphaMaskUrl.IsValid() )
{
Devel::PixelBuffer maskPixelBuffer = LoadImageFromFile( maskInfo->mAlphaMaskUrl.GetUrl(), ImageDimensions(),
FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER, true );
if( !textureSet ) // big image, no atlasing or atlasing failed
{
atlasingStatus = false;
- if( !maskInfo )
+ if( !maskInfo || !maskInfo->mAlphaMaskUrl.IsValid() )
{
textureId = RequestLoad( url, desiredSize, fittingMode, samplingMode, TextureManager::NO_ATLAS,
textureObserver, orientationCorrection, reloadPolicy, preMultiplyOnLoad );
break;
}
case VisualUrl::GIF:
+ case VisualUrl::WEBP:
{
visualPtr = AnimatedImageVisual::New( GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl, propertyMap );
break;
break;
}
case VisualUrl::GIF:
+ case VisualUrl::WEBP:
{
visualPtr = AnimatedImageVisual::New( GetFactoryCache(), GetImageVisualShaderFactory(), visualUrl );
break;
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
enum { SUFFIX, HASH, HASH_DOT } state = SUFFIX;
char SVG[ 4 ] = { 'g', 'v', 's', '.' };
char GIF[ 4 ] = { 'f', 'i', 'g', '.' };
+ char WEBP[ 5 ] = { 'p', 'b', 'e', 'w', '.' };
char JSON[ 5 ] = { 'n', 'o', 's', 'j', '.' };
unsigned int svgScore = 0;
unsigned int gifScore = 0;
+ unsigned int webpScore = 0;
unsigned int jsonScore = 0;
int index = count;
while( --index >= 0 )
return VisualUrl::GIF;
}
}
+ if( ( offsetFromEnd < sizeof(WEBP) )&&( currentChar == WEBP[ offsetFromEnd ] ) )
+ {
+ // early out if WEBP as can't be used in N patch for now
+ if( ++webpScore == sizeof(WEBP) )
+ {
+ return VisualUrl::WEBP;
+ }
+ }
if( ( offsetFromEnd < sizeof(JSON) )&&( currentChar == JSON[ offsetFromEnd ] ) )
{
// early out if JSON as can't be used in N patch for now
#define DALI_TOOLKIT_INTERNAL_VISUAL_URL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
N_PATCH,
SVG,
GIF,
+ WEBP,
JSON
};
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 9;
-const unsigned int TOOLKIT_MICRO_VERSION = 17;
+const unsigned int TOOLKIT_MICRO_VERSION = 18;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
SET( public_api_src_files
${public_api_src_dir}/controls/control-impl.cpp
${public_api_src_dir}/controls/control.cpp
- ${public_api_src_dir}/controls/alignment/alignment.cpp
${public_api_src_dir}/controls/buttons/button.cpp
${public_api_src_dir}/controls/buttons/check-box-button.cpp
${public_api_src_dir}/controls/buttons/push-button.cpp
${public_api_src_dir}/controls/image-view/image-view.cpp
${public_api_src_dir}/controls/model3d-view/model3d-view.cpp
${public_api_src_dir}/controls/progress-bar/progress-bar.cpp
- ${public_api_src_dir}/controls/scroll-bar/scroll-bar.cpp
${public_api_src_dir}/controls/scrollable/item-view/default-item-layout.cpp
${public_api_src_dir}/controls/scrollable/item-view/item-layout.cpp
${public_api_src_dir}/controls/scrollable/item-view/item-view.cpp
${public_api_src_dir}/controls/scrollable/scroll-view/scroll-view.cpp
${public_api_src_dir}/controls/scrollable/scrollable.cpp
${public_api_src_dir}/controls/slider/slider.cpp
- ${public_api_src_dir}/controls/table-view/table-view.cpp
${public_api_src_dir}/controls/text-controls/text-editor.cpp
${public_api_src_dir}/controls/text-controls/text-label.cpp
${public_api_src_dir}/controls/text-controls/text-field.cpp
${public_api_src_dir}/image-loader/async-image-loader.cpp
${public_api_src_dir}/image-loader/sync-image-loader.cpp
${public_api_src_dir}/styling/style-manager.cpp
- ${public_api_src_dir}/accessibility-manager/accessibility-manager.cpp
${public_api_src_dir}/focus-manager/keyboard-focus-manager.cpp
${public_api_src_dir}/dali-toolkit-version.cpp
${public_api_src_dir}/enums.cpp
${public_api_src_dir}/controls/control.h
)
-SET( public_api_alignment_header_files
- ${public_api_src_dir}/controls/alignment/alignment.h
-)
-
SET( public_api_buttons_header_files
${public_api_src_dir}/controls/buttons/button.h
${public_api_src_dir}/controls/buttons/check-box-button.h
${public_api_src_dir}/controls/scrollable/scrollable.h
)
-SET( public_api_scroll_bar_header_files
- ${public_api_src_dir}/controls/scroll-bar/scroll-bar.h
-)
-
SET( public_api_scroll_view_header_files
${public_api_src_dir}/controls/scrollable/scroll-view/scroll-mode.h
${public_api_src_dir}/controls/scrollable/scroll-view/scroll-view-constraints.h
${public_api_src_dir}/styling/style-manager.h
)
-SET( public_api_table_view_header_files
- ${public_api_src_dir}/controls/table-view/table-view.h
-)
-
SET( public_api_text_controls_header_files
${public_api_src_dir}/controls/text-controls/hidden-input-properties.h
${public_api_src_dir}/controls/text-controls/placeholder-properties.h
${public_api_src_dir}/controls/text-controls/text-field.h
)
-SET( public_api_accessibility_manager_header_files
- ${public_api_src_dir}/accessibility-manager/accessibility-manager.h
-)
-
SET( public_api_focus_manager_header_files
${public_api_src_dir}/focus-manager/keyboard-focus-manager.h
)
SET( PUBLIC_API_HEADERS ${PUBLIC_API_HEADERS}
${public_api_header_files}
${public_api_controls_header_files}
- ${public_api_alignment_header_files}
${public_api_buttons_header_files}
${public_api_model3d_view_header_files}
${public_api_flex_container_header_files}
${public_api_image_loader_header_files}
${public_api_progress_bar_header_files}
${public_api_scrollable_header_files}
- ${public_api_scroll_bar_header_files}
${public_api_scroll_view_header_files}
${public_api_slider_header_files}
${public_api_styling_header_files}
- ${public_api_table_view_header_files}
${public_api_text_controls_header_files}
- ${public_api_accessibility_manager_header_files}
${public_api_focus_manager_header_files}
${public_api_text_header_files}
${public_api_video_view_header_files}
Name: dali2-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.9.17
+Version: 1.9.18
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT