# Append list of test harness files (Won't get parsed for test cases)
LIST(APPEND TC_SOURCES
+ ../dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
fontDescriptionRuns.PushBack( fontDescriptionRun );
Size textArea(1.f, 1.f);
Size layoutSize(80.f, 20.f);
- float positions[] = { 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f };
+ float positions[] = { 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f };
struct LineRun line =
{
{ 0u, 11u },
Size layoutSize(95.f, 97.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -3.f, 42.f, -12.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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,
1.f, -12.f, 9.f, -9.f, 17.f, -9.f, 27.f, -9.f, 36.f, -9.f, 45.f, -11.f, 51.f, -0.f,
1.f, -12.f, 11.f, -12.f, 15.f, -12.f, 26.f, -9.f, 35.f, -9.f, 41.f, -9.f, 50.f, -9.f, 59.f, -11.f, 65.f, -0.f,
1.f, -12.f, 5.f, -12.f, 9.f, -9.f, 19.f, -9.f, 28.f, -9.f, 35.f, -0.f, 41.f, -9.f, 50.f, -12.f, 54.f, -0.f, 59.f, -11.f, 66.f, -9.f, 75.f, -9.f, 83.f, -11.f, 91.f, -2.f
{
{ 0u, 12u },
{ 0u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
fontDescriptionRuns.PushBack( fontDescriptionRun4 );
fontDescriptionRuns.PushBack( fontDescriptionRun5 );
Size textArea(100.f, 300.f);
- Size layoutSize(81.f, 120.f);
+ Size layoutSize(80.f, 120.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -3.f, 33.f, -12.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
+ 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -2.f, 33.f, -12.f,
1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -3.f,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f,
};
struct LineRun line0 =
{
{ 0u, 12u },
{ 0u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
{
{ 38u, 12u },
{ 38u, 12u },
- 79.f,
+ 78.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
Size layoutSize(96.f, 60.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -9.f, 47.f, -9.f, 57.f, -9.f, 63.f, -13.f, 66.f, -13.f, 75.f, -13.f, 85.f, -9.f,
- 1.f, -9.f, 13.f, -9.f, 23.f, -13.f, 32.f, -9.f, 40.f, -13.f, 44.f, -13.f, 47.f, -9.f, 56.f, -9.f, 67.f, -9.f, 77.f, -9.f, 83.f, -13.f, 86.f, -13.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -3.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -9.f, 47.f, -9.f, 57.f, -9.f, 63.f, -13.f, 66.f, -13.f, 75.f, -13.f, 84.f, -9.f,
+ 1.f, -9.f, 13.f, -9.f, 23.f, -13.f, 31.f, -9.f, 40.f, -13.f, 44.f, -13.f, 47.f, -9.f, 56.f, -9.f, 67.f, -9.f, 77.f, -9.f, 83.f, -13.f, 86.f, -13.f,
+ 0.f, -13.f, 9.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -2.f,
};
struct LineRun line0 =
{
{ 0u, 12u },
{ 0u, 12u },
- 94.f,
+ 93.f,
15.f,
-5.f,
0.f,
Size layoutSize(83.f, 40.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -3.f, 82.f, -12.f
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -2.f, 82.f, -12.f
};
struct LineRun line0 =
{
Size layoutSize(88.f, 53.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.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, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -3.f
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.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
};
struct LineRun line0 =
{
Size layoutSize(92.f, 380.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -3.f, 33.f, -12.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 68.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
+ 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -2.f, 33.f, -12.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 67.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
0.f, -9.f, 11.f, -9.f, 21.f, -9.f, 27.f, -13.f, 30.f, -13.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -3.f, 42.f, -12.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.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,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -3.f, 33.f, -12.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
+ 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -2.f, 33.f, -12.f,
1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
};
struct LineRun line01 =
{
{ 0u, 12u },
{ 0u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
{
{ 74u, 12u },
{ 74u, 12u },
- 79.f,
+ 78.f,
15.f,
-5.f,
- 3.f,
- 0.f,
+ 4.f,
+ 1.f,
0.f,
false,
false
{
{ 128u, 12u },
{ 128u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
Size layoutSize(92.f, 380.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -3.f, 33.f, -12.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 68.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
+ 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -2.f, 33.f, -12.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 67.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
0.f, -9.f, 11.f, -9.f, 21.f, -9.f, 27.f, -13.f, 30.f, -13.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -3.f, 42.f, -12.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.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,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -3.f, 33.f, -12.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
+ 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -2.f, 33.f, -12.f,
1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
};
struct LineRun line01 =
{
{ 0u, 12u },
{ 0u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
{
{ 74u, 12u },
{ 74u, 12u },
- 79.f,
+ 78.f,
15.f,
-5.f,
- 3.f,
- 0.f,
+ 4.f,
+ 1.f,
0.f,
false,
false
{
{ 128u, 12u },
{ 128u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
Size layoutSize(92.f, 380.f);
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -3.f, 33.f, -12.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 68.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
+ 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -2.f, 33.f, -12.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -13.f, 67.f, -9.f, 76.f, -13.f, 80.f, -13.f, 83.f, -9.f, 92.f, -0.f,
0.f, -9.f, 11.f, -9.f, 21.f, -9.f, 27.f, -13.f, 30.f, -13.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -3.f, 42.f, -12.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.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,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
- 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -3.f, 33.f, -12.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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, -10.f, 55.f, -13.f, 62.f, -10.f, 67.f, -10.f, 75.f, -0.f,
+ 1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -2.f, 33.f, -12.f,
1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f,
- 1.f, -13.f, 10.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
+ 1.f, -13.f, 9.f, -9.f, 18.f, -13.f, 22.f, -13.f, 25.f, -9.f, 34.f, -0.f, 38.f, -9.f, 49.f, -9.f, 59.f, -9.f, 65.f, -13.f, 68.f, -13.f, 77.f, -0.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f,
};
struct LineRun line01 =
{
{ 0u, 12u },
{ 0u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
{
{ 74u, 12u },
{ 74u, 12u },
- 79.f,
+ 78.f,
15.f,
-5.f,
- 3.f,
- 0.f,
+ 4.f,
+ 1.f,
0.f,
false,
false
{
{ 128u, 12u },
{ 128u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f, 83.f, -13.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f, 83.f, -13.f,
};
Size textArea( 100.f, 50.f );
{
{ 0u, 12u },
{ 0u, 12u },
- 81.f,
+ 80.f,
15.f,
-5.f,
- 3.f,
+ 4.f,
0.f,
0.f,
false,
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.f, -0.f,
- 0.f, -13.f, 10.f, -9.f, 18.f, -9.f, 30.f, -9.f, 39.f, -0.f, 44.f, -13.f, 53.f, -9.f, 61.f, -13.f, 65.f, -13.f, 68.f, -9.f, 77.f, -0.f, 81.f, -9.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f, 79.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,
};
Size textArea( 100.f, 50.f );
float positions[] =
{
- 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -7.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
+ 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -8.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
};
Size textArea( 100.f, 50.f );
float positions[] =
{
- 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -7.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 10.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f, 32.f, -10.f, 43.f, -13.f, 50.f, -10.f, 55.f, -10.f, 63.f, -0.f, 68.f, -10.f, 76.f, -10.f, 81.f, -13.f, 89.f, -10.f, 97.f, -0.f,
+ 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -8.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
+ 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f, 32.f, -10.f, 43.f, -13.f, 50.f, -10.f, 55.f, -10.f, 63.f, -0.f, 68.f, -10.f, 76.f, -10.f, 81.f, -13.f, 89.f, -10.f, 97.f, -0.f,
};
Size textArea( 100.f, 50.f );
float positions[] =
{
- 1.f, -12.f, 12.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f,
+ 1.f, -12.f, 11.f, -9.f, 20.f, -13.f, 24.f, -13.f, 27.f, -9.f, 36.f, -0.f, 40.f, -9.f, 51.f, -9.f, 61.f, -9.f, 67.f, -13.f, 70.f, -13.f,
};
Size textArea( 100.f, 300.f );
float positions[] =
{
- 87.f, -10.f, 79.f, -13.f, 74.f, -10.f, 66.f, -10.f, 61.f, -0.f, 53.f, -10.f, 48.f, -10.f, 41.f, -13.f, 32.f, -10.f, 27.f, -0.f, 20.f, -8.f, 15.f, -6.f, 8.f, -7.f, 5.f, -7.f, 4.f, -11.f, 0.f, -0.f,
- 23.f, -7.f, 22.f, -11.f, 17.f, -11.f, 12.f, -8.f, 10.f, -11.f, 5.f, -11.f, 0.f, -8.f, 0.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
+ 87.f, -10.f, 79.f, -13.f, 74.f, -10.f, 66.f, -10.f, 61.f, -0.f, 53.f, -10.f, 48.f, -10.f, 41.f, -13.f, 32.f, -10.f, 27.f, -0.f, 20.f, -8.f, 15.f, -6.f, 8.f, -8.f, 5.f, -7.f, 4.f, -11.f, 0.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,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
- 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -7.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 10.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 30.f, -2.f,
+ 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -8.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
+ 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 30.f, -2.f,
};
Size textArea( 100.f, 300.f );
float positions[] =
{
- 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -7.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 10.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f,
- 86.f, -8.f, 81.f, -6.f, 74.f, -7.f, 71.f, -7.f, 70.f, -11.f, 66.f, -0.f, 62.f, -7.f, 61.f, -11.f, 56.f, -11.f, 51.f, -8.f, 49.f, -11.f, 44.f, -11.f, 39.f, -8.f, 36.f, -0.f, 26.f, -10.f, 18.f, -13.f, 13.f, -10.f, 5.f, -10.f, 0.f, -0.f,
+ 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -8.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
+ 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f,
+ 86.f, -8.f, 81.f, -6.f, 74.f, -8.f, 71.f, -7.f, 70.f, -11.f, 66.f, -0.f, 62.f, -7.f, 61.f, -11.f, 56.f, -11.f, 50.f, -8.f, 49.f, -11.f, 44.f, -11.f, 39.f, -8.f, 36.f, -0.f, 26.f, -10.f, 18.f, -13.f, 13.f, -10.f, 5.f, -10.f, 0.f, -0.f,
22.f, -10.f, 17.f, -10.f, 10.f, -13.f, 1.f, -10.f, 0.f, -0.f,
- 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -7.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 10.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 30.f, -2.f,
+ 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -8.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
+ 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 30.f, -2.f,
};
Size textArea( 100.f, 300.f );
float positions[] =
{
- 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -7.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
- 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 10.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f,
- 0.f, -8.f, 7.f, -6.f, 12.f, -7.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 37.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
+ 1.f, -10.f, 12.f, -13.f, 19.f, -10.f, 24.f, -10.f, 32.f, -0.f, 37.f, -10.f, 45.f, -10.f, 50.f, -13.f, 58.f, -10.f, 66.f, -0.f, 69.f, -8.f, 76.f, -6.f, 81.f, -8.f, 87.f, -7.f, 92.f, -11.f, 94.f, -0.f,
+ 0.f, -7.f, 5.f, -11.f, 6.f, -11.f, 9.f, -8.f, 17.f, -11.f, 18.f, -11.f, 22.f, -8.f, 28.f, -0.f,
+ 0.f, -8.f, 7.f, -6.f, 12.f, -8.f, 18.f, -7.f, 23.f, -11.f, 25.f, -0.f, 27.f, -7.f, 32.f, -11.f, 33.f, -11.f, 36.f, -8.f, 44.f, -11.f, 45.f, -11.f, 49.f, -8.f, 55.f, -0.f, 59.f, -10.f, 70.f, -13.f, 77.f, -10.f, 82.f, -10.f, 90.f, -0.f,
1.f, -10.f, 9.f, -10.f, 14.f, -13.f, 22.f, -10.f, 30.f, -0.f,
- 87.f, -10.f, 79.f, -13.f, 74.f, -10.f, 66.f, -10.f, 61.f, -0.f, 53.f, -10.f, 48.f, -10.f, 41.f, -13.f, 32.f, -10.f, 27.f, -0.f, 20.f, -8.f, 15.f, -6.f, 8.f, -7.f, 5.f, -7.f, 4.f, -11.f, 0.f, -0.f,
- 28.f, -7.f, 27.f, -11.f, 22.f, -11.f, 17.f, -8.f, 15.f, -11.f, 10.f, -11.f, 5.f, -8.f, 2.f, -2.f,
+ 87.f, -10.f, 79.f, -13.f, 74.f, -10.f, 66.f, -10.f, 61.f, -0.f, 53.f, -10.f, 48.f, -10.f, 41.f, -13.f, 32.f, -10.f, 27.f, -0.f, 20.f, -8.f, 15.f, -6.f, 8.f, -8.f, 5.f, -7.f, 4.f, -11.f, 0.f, -0.f,
+ 28.f, -7.f, 27.f, -11.f, 22.f, -11.f, 16.f, -8.f, 15.f, -11.f, 10.f, -11.f, 5.f, -8.f, 2.f, -2.f,
};
Size textArea( 100.f, 300.f );
if( scriptRun1.script != scriptRun2.script )
{
- tet_printf("ScriptsTest FAIL: different script. %s, should be %s\n", TextAbstraction::ScriptName[scriptRun1.script], TextAbstraction::ScriptName[scriptRun2.script] );
+ tet_printf("ScriptsTest FAIL: script index: %u, different script. %s, should be %s\n", index, TextAbstraction::ScriptName[scriptRun1.script], TextAbstraction::ScriptName[scriptRun2.script] );
return false;
}
}
0u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1101 =
{
3u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1102 =
{
25u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1104 =
{
28u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1105 =
{
46u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1107 =
{
48u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1108 =
{
50u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
scriptRuns11.PushBack( scriptRun1100 );
scriptRuns11.PushBack( scriptRun1101 );
0u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1201 =
{
3u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1202 =
{
6u,
3u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
ScriptRun scriptRun1203 =
{
9u,
2u,
},
- TextAbstraction::LATIN
+ TextAbstraction::UNKNOWN
};
scriptRuns12.PushBack( scriptRun1200 );
scriptRuns12.PushBack( scriptRun1201 );
0u,
4u,
},
- TextAbstraction::LATIN // An unknown script is transformed to LATIN
+ TextAbstraction::UNKNOWN
};
scriptRuns13.PushBack( scriptRun1301 );
Size textSize00( 100.f, 100.f );
Size textSize01( 80.f, 100.f );
- float positions01[] = { 0.f, 10.f, 16.f, 26.f, 35.f, 38.f, 46.f, 56.f };
+ float positions01[] = { 0.f, 9.f, 17.f, 27.f, 35.f, 37.f, 46.f, 56.f };
Size textSize02( 80.f, 100.f );
float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 11.f };
Size textSize03( 80.f, 100.f );
- float positions03[] = { 77.f, 76.f, 71.f, 62.f, 60.f, 52.f, 47.f, 42.f, 39.f, 35.f, 32.f, 13.f };
+ float positions03[] = { 77.f, 76.f, 71.f, 62.f, 59.f, 52.f, 47.f, 42.f, 39.f, 35.f, 32.f, 13.f };
Size textSize04( 80.f, 10.f );
float positions04[] = { 2.f };
TextureManager::ReloadPolicy::CACHED,
preMultiply);
- const VisualUrl& url = textureManager.GetVisualUrl( textureId );
+ VisualUrl url = textureManager.GetVisualUrl( textureId );
DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <dali-toolkit/dali-toolkit.h>
#include <toolkit-text-utils.h>
#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 <dummy-visual.h>
#include <../dali-toolkit/dali-toolkit-test-utils/dummy-control.h>
END_TEST;
}
+
+int UtcDaliVisualSetProperties(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline( "Register a visual and SetProperties" );
+
+ Toolkit::Internal::VisualFactoryCache* factoryCache = new Toolkit::Internal::VisualFactoryCache(false);
+
+ //Created ColorVisual
+ Property::Map propertyMap1;
+ propertyMap1.Insert(Visual::Property::TYPE, Visual::COLOR);
+ propertyMap1.Insert(ColorVisual::Property::MIX_COLOR, Color::RED);
+ Toolkit::Internal::ColorVisualPtr colorVisualPtr = Toolkit::Internal::ColorVisual::New( *factoryCache, propertyMap1 );
+
+ DummyControl dummyControl = DummyControl::New( true );
+ Impl::DummyControl& dummyImpl = static_cast< Impl::DummyControl& >( dummyControl.GetImplementation() );
+
+ Toolkit::Visual::Base visualBaseHandle = Toolkit::Visual::Base( colorVisualPtr.Get() );
+ dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, visualBaseHandle );
+ dummyControl.SetSize( 200.f, 200.f );
+ Stage::GetCurrent().Add( dummyControl );
+
+ application.SendNotification();
+ application.Render();
+
+ Property::Map propertyMap;
+ propertyMap.Insert( Visual::Property::MIX_COLOR, Color::BLUE );
+
+ colorVisualPtr->SetProperties( propertyMap );
+ application.SendNotification();
+ application.Render();
+
+ Property::Map resultMap;
+ visualBaseHandle.CreatePropertyMap( resultMap );
+
+ Property::Value* colorValue = resultMap.Find( Visual::Property::MIX_COLOR, Property::VECTOR4 );
+ DALI_TEST_CHECK( colorValue );
+ DALI_TEST_CHECK( colorValue->Get< Vector4 >() == Color::BLUE );
+
+ delete factoryCache;
+
+ END_TEST;
+}
bool TestApplication::Render( unsigned int intervalMilliseconds, const char* location )
{
DoUpdate( intervalMilliseconds, location );
- mCore->Render( mRenderStatus );
+ mCore->Render( mRenderStatus, false );
mFrame++;
bool TestApplication::RenderOnly( )
{
// Update Time values
- mCore->Render( mRenderStatus );
+ mCore->Render( mRenderStatus, false );
mFrame++;
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
#include <dali/public-api/object/base-object.h>
#include <toolkit-adaptor-impl.h>
+#include <dali/integration-api/debug.h>
+#include <test-application.h>
namespace Dali
{
{
}
+
+class LogFactory : public LogFactoryInterface
+{
+public:
+ virtual void InstallLogFunction() const
+ {
+ Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
+ Dali::Integration::Log::InstallLogFunction(logFunction);
+ }
+
+ LogFactory()
+ {
+ }
+ virtual ~LogFactory()
+ {
+ }
+};
+
+LogFactory* gLogFactory = NULL;
+const LogFactoryInterface& Adaptor::GetLogFactory()
+{
+ if( gLogFactory == NULL )
+ {
+ gLogFactory = new LogFactory;
+ }
+ return *gLogFactory;
+}
+
Adaptor::Adaptor()
: mImpl( NULL )
{
{
mMuted = false;
mLooping = false;
+ mPlayPosition = 0;
+ mDisplyMode = Dali::VideoPlayerPlugin::DisplayMode::DST_ROI;
}
void SetMuted( bool muted )
}
}
+ int GetPlayPosition()
+ {
+ return mPlayPosition;
+ }
+
+ void SetPlayPosition( int pos )
+ {
+ mPlayPosition = pos;
+ }
+
+ Dali::VideoPlayerPlugin::DisplayMode::Type GetDisplayMode() const
+ {
+ return mDisplyMode;
+ }
+
+ void SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mDisplyMode )
+ {
+ mDisplyMode = mDisplyMode;
+ }
+
+
public:
std::string mUrl;
bool mMuted;
bool mLooping;
+ int mPlayPosition;
+ Dali::VideoPlayerPlugin::DisplayMode::Type mDisplyMode;
};
inline VideoPlayer& GetImplementation( Dali::VideoPlayer& player )
void VideoPlayer::SetPlayPosition( int millisecond )
{
+ Internal::Adaptor::GetImplementation( *this ).SetPlayPosition( millisecond );
}
int VideoPlayer::GetPlayPosition()
{
- return 0;
+ return Internal::Adaptor::GetImplementation( *this ).GetPlayPosition();
}
void VideoPlayer::SetDisplayArea( DisplayArea area )
{
}
-bool VideoPlayer::IsVideoTextureSupported() const
+bool VideoPlayer::IsVideoTextureSupported()
{
return ToolkitApplication::DECODED_IMAGES_SUPPORTED;
}
+void VideoPlayer::SetCodecType( Dali::VideoPlayerPlugin::CodecType type )
+{
+}
+
+Dali::VideoPlayerPlugin::CodecType VideoPlayer::GetCodecType() const
+{
+ return Dali::VideoPlayerPlugin::CodecType::DEFAULT;
+}
+
+void VideoPlayer::SetDisplayMode( Dali::VideoPlayerPlugin::DisplayMode::Type mode )
+{
+ Internal::Adaptor::GetImplementation( *this ).SetDisplayMode( mode );
+}
+
+Dali::VideoPlayerPlugin::DisplayMode::Type VideoPlayer::GetDisplayMode() const
+{
+ return Internal::Adaptor::GetImplementation( *this ).GetDisplayMode();
+}
+
} // namespace Dali;
DALI_TEST_CHECK( srcFactorRgb == BlendFactor::ONE );
DALI_TEST_CHECK( destFactorRgb == BlendFactor::ONE_MINUS_SRC_ALPHA );
DALI_TEST_CHECK( srcFactorAlpha == BlendFactor::ONE );
- DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE );
+ DALI_TEST_CHECK( destFactorAlpha == BlendFactor::ONE_MINUS_SRC_ALPHA );
value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
DALI_TEST_CHECK( value.Get( enable ) );
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
application.SendNotification();
application.Render(0); // Ensure animation starts
application.Render(2000u); // Halfway point
- Vector4 testColor(1.0f, 0.0f, 0.5f, 0.75f );
+ Vector3 testColor( 1.0f, 0.0f, 0.5f );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f )), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor)), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", testColor.a), true, TEST_LOCATION );
+ // uColor.a should be actor's alpha * mixColor.a.
+ DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>( "uColor", Vector4( 0.5f, 0.5f, 0.5f, 0.75f ) ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>( "mixColor", testColor ), true, TEST_LOCATION );
application.Render(2000u); // Halfway point between blue and white
DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR)), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", TARGET_MIX_COLOR.a), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>( "uColor", Vector4( 1.0f, 1.0f, 1.0f, 0.5f ) ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>( "mixColor", Vector3( TARGET_MIX_COLOR ) ), true, TEST_LOCATION );
TestMixColor( visual, Visual::Property::MIX_COLOR, TARGET_MIX_COLOR );
DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION);
Renderer renderer = actor.GetRendererAt(0);
- tet_infoline("Test that the renderer has the opacity property");
- Property::Index index = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
- DALI_TEST_CHECK( index != Property::INVALID_INDEX );
-
-
Property::Value blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
application.Render(2000u); // Halfway point through animation
application.SendNotification(); // Handle any signals
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 0.75f), true, TEST_LOCATION );
+ Vector4 color;
+ DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) );
+ DALI_TEST_EQUALS( color.a, 0.75f, TEST_LOCATION );
application.Render(2001u); // end
application.SendNotification(); // ensure animation finished signal is sent
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 1.0f), true, TEST_LOCATION );
+ DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) );
+ DALI_TEST_EQUALS( color.a, 1.0f, TEST_LOCATION );
blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
application.Render(2000u); // Halfway point
application.SendNotification();
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 0.55f), true, TEST_LOCATION );
+ Vector4 color;
+ DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) );
+ DALI_TEST_EQUALS( color.a, 0.55f, TEST_LOCATION );
application.Render(2016u); // end
application.SendNotification();
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", 0.1f), true, TEST_LOCATION );
+ DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", color ) );
+ DALI_TEST_EQUALS( color.a, 0.1f, TEST_LOCATION );
blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::ON, TEST_LOCATION );
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
const char* const PROPERTY_NAME_SHADOW = "shadow";
const char* const PROPERTY_NAME_EMBOSS = "emboss";
const char* const PROPERTY_NAME_OUTLINE = "outline";
+const char* const PROPERTY_NAME_BACKGROUND = "textBackground";
const char* const PROPERTY_NAME_PIXEL_SIZE = "pixelSize";
const char* const PROPERTY_NAME_ELLIPSIS = "ellipsis";
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_SHADOW ) == TextLabel::Property::SHADOW );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_EMBOSS ) == TextLabel::Property::EMBOSS );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_OUTLINE ) == TextLabel::Property::OUTLINE );
+ DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_BACKGROUND ) == DevelTextLabel::Property::BACKGROUND );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_PIXEL_SIZE ) == TextLabel::Property::PIXEL_SIZE );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_ELLIPSIS ) == TextLabel::Property::ELLIPSIS );
DALI_TEST_CHECK( label.GetPropertyIndex( PROPERTY_NAME_AUTO_SCROLL_LOOP_DELAY ) == TextLabel::Property::AUTO_SCROLL_LOOP_DELAY );
DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
+ // Check the background property
+ Property::Map backgroundMapSet;
+ Property::Map backgroundMapGet;
+
+ backgroundMapSet["enable"] = true;
+ backgroundMapSet["color"] = Color::RED;
+ label.SetProperty( DevelTextLabel::Property::BACKGROUND, backgroundMapSet );
+
+ backgroundMapGet = label.GetProperty<Property::Map>( DevelTextLabel::Property::BACKGROUND );
+ DALI_TEST_EQUALS( backgroundMapGet.Count(), backgroundMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( backgroundMapGet, backgroundMapSet ), true, TEST_LOCATION );
+
// Check the pixel size of font
label.SetProperty( TextLabel::Property::PIXEL_SIZE, 20.f );
DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::PIXEL_SIZE ), 20.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
#include <dali-toolkit-test-suite-utils.h>
#include <dali.h>
#include <dali/devel-api/object/handle-devel.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali-toolkit/dali-toolkit.h>
#include <dali-toolkit/devel-api/visual-factory/transition-data.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
Renderer renderer = actor.GetRendererAt(0);
Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
- Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
anim.Play();
application.Render(500); // Halfway thru anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
application.Render(500); // End of anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
END_TEST;
}
Renderer renderer = actor.GetRendererAt(0);
Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
- Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
anim.Play();
application.Render(500); // Halfway thru anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
application.Render(500); // End of anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
END_TEST;
}
Renderer renderer = actor.GetRendererAt(0);
Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, PrimitiveVisual::Property::MIX_COLOR );
- Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
anim.Play();
application.Render(500); // Halfway thru anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA+Color::RED)*0.5f, TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
application.Render(500); // End of anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::RED), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION);
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION);
END_TEST;
}
Renderer renderer = actor.GetRendererAt(0);
Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
- Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 0.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION );
DALI_TEST_EQUALS( renderer.GetProperty<int>(Renderer::Property::BLEND_MODE), (int)BlendMode::ON, TEST_LOCATION );
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION );
DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
anim.Play();
application.Render(500); // Halfway thru anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.5f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.5f, 0.001f, TEST_LOCATION );
DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
application.Render(501); // End of anim
application.SendNotification();
+ application.Render();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::AUTO, TEST_LOCATION );
END_TEST;
Renderer renderer = actor.GetRendererAt(0);
Property::Index mixColorIndex = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
- Property::Index opacityIndex = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
application.SendNotification();
application.Render(0);
DALI_TEST_EQUALS( renderer.GetProperty<Vector3>(mixColorIndex), Vector3(Color::MAGENTA), TEST_LOCATION);
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetProperty<float>(opacityIndex), 1.0f, 0.001f, TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 1.0f, 0.001f, TEST_LOCATION );
// Note, This should be testing for AUTO
// this is the same problem as C# target value being set before Play is called.
application.Render(500); // Halfway thru anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION);
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.5f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.5f, 0.001f, TEST_LOCATION );
DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
application.Render(500); // End of anim
application.SendNotification();
DALI_TEST_EQUALS( renderer.GetCurrentProperty< Vector3 >( mixColorIndex ), Vector3(Color::MAGENTA), TEST_LOCATION );
- DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( opacityIndex ), 0.0f, 0.001f, TEST_LOCATION );
+ DALI_TEST_EQUALS( renderer.GetCurrentProperty< float >( DevelRenderer::Property::OPACITY ), 0.0f, 0.001f, TEST_LOCATION );
DALI_TEST_EQUALS( renderer.GetCurrentProperty< int >( Renderer::Property::BLEND_MODE ), (int)BlendMode::ON, TEST_LOCATION );
END_TEST;
Renderer renderer = actor.GetRendererAt(0);
Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
- Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
tet_printf( "Test that the property has been set to target value\n");
DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
- DALI_TEST_EQUALS(renderer.GetProperty<float>(opacityIdx), 1.0f, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001, TEST_LOCATION);
END_TEST;
}
Renderer renderer = actor.GetRendererAt(0);
Property::Index mixColorIdx = DevelHandle::GetPropertyIndex( renderer, ColorVisual::Property::MIX_COLOR );
- Property::Index opacityIdx = DevelHandle::GetPropertyIndex( renderer, Visual::Property::OPACITY );
tet_printf( "Test that the property has been set to target value\n");
DALI_TEST_EQUALS(renderer.GetProperty<Vector3>(mixColorIdx), Vector3(Color::RED), 0.001, TEST_LOCATION);
- DALI_TEST_EQUALS(renderer.GetProperty<float>(opacityIdx), 1.0f, 0.001, TEST_LOCATION);
+ DALI_TEST_EQUALS(renderer.GetProperty<float>( DevelRenderer::Property::OPACITY ), 1.0f, 0.001, TEST_LOCATION);
END_TEST;
}
int UtcDaliVideoViewPropertyUnderlay(void)
{
ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewPropertyUnderlay");
ToolkitApplication::DECODED_IMAGES_SUPPORTED = true;
VideoView view = VideoView::New();
END_TEST;
}
+
+int UtcDaliVideoViewPropertyPlayPosition(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewPropertyPlayPosition");
+
+ VideoView view = VideoView::New();
+ DALI_TEST_CHECK( view );
+
+ Stage::GetCurrent().Add( view );
+ view.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ int playPos = view.GetProperty( Toolkit::VideoView::Property::PLAY_POSITION ).Get< int >();
+ DALI_TEST_CHECK( playPos == 0 );
+
+ view.SetProperty( Toolkit::VideoView::Property::PLAY_POSITION, 10 );
+ playPos = view.GetProperty( Toolkit::VideoView::Property::PLAY_POSITION ).Get< int >();
+ // Actually setting play position will be async
+ // Actual platform result may be different.
+ DALI_TEST_CHECK( playPos == 10 );
+
+ END_TEST;
+}
+
+// For coverage.
+int UtcDaliVideoViewNew2(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewNew2");
+
+ VideoView view = VideoView::New( true );
+ DALI_TEST_CHECK( view );
+
+ Stage::GetCurrent().Add( view );
+ view.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ VideoView view2 = VideoView::New( "", false );
+ DALI_TEST_CHECK( view2 );
+
+ Stage::GetCurrent().Add( view2 );
+ view2.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ END_TEST;
+}
+
+int UtcDaliVideoViewPropertyDisplayMode(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline("UtcDaliVideoViewPropertyDisplayMode");
+
+ VideoView view = VideoView::New();
+ DALI_TEST_CHECK( view );
+
+ Stage::GetCurrent().Add( view );
+ view.Play();
+
+ application.SendNotification();
+ application.Render();
+
+ view.SetProperty( Toolkit::VideoView::Property::DISPLAY_MODE, Toolkit::VideoView::DisplayMode::DST_ROI );
+ int displayMode = view.GetProperty( Toolkit::VideoView::Property::DISPLAY_MODE ).Get< int >();
+ DALI_TEST_CHECK( displayMode == Toolkit::VideoView::DisplayMode::DST_ROI );
+
+ END_TEST;
+}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
Property::Map outlineMapSet;
propertyMap.Insert( "outline", outlineMapSet.Add("color", Color::YELLOW).Add("width", 1) );
+ Property::Map backgroundMapSet;
+ propertyMap.Insert( "textBackground", backgroundMapSet.Add("enable", true).Add("color", Color::CYAN) );
+
Visual::Base textVisual = factory.CreateVisual( propertyMap );
Property::Map resultMap;
DALI_TEST_EQUALS( outlineMapGet.Count(), outlineMapSet.Count(), TEST_LOCATION );
DALI_TEST_EQUALS( DaliTestCheckMaps( outlineMapGet, outlineMapSet ), true, TEST_LOCATION );
+ value = resultMap.Find( DevelTextVisual::Property::BACKGROUND, Property::MAP );
+ DALI_TEST_CHECK( value );
+
+ Property::Map backgroundMapGet = value->Get<Property::Map>();
+ DALI_TEST_EQUALS( backgroundMapGet.Count(), backgroundMapSet.Count(), TEST_LOCATION );
+ DALI_TEST_EQUALS( DaliTestCheckMaps( backgroundMapGet, backgroundMapSet ), true, TEST_LOCATION );
+
END_TEST;
}
Property::Map map;
map["target"] = "testVisual";
map["property"] = "mixColor";
- map["targetValue"] = Vector4(1,1,1,0);
+ map["targetValue"] = Vector4(1,1,1,0.1);
map["animator"] = Property::Map()
.Add("alphaFunction", "LINEAR")
.Add("timePeriod", Property::Map()
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", testColor ), true, TEST_LOCATION );
color = renderer.GetCurrentProperty< Vector3 >( mixColorIndex );
- testColor = Vector4( 1,1,1,0.4f );
+ testColor = Vector4( 1,1,1,0.45f );
DALI_TEST_EQUALS( Vector3(color), Vector3(testColor), 0.0001f, TEST_LOCATION );
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor) ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", testColor.a ) , true, TEST_LOCATION );
+
+ Vector4 uColor;
+ DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", uColor ) );
+ DALI_TEST_EQUALS( uColor.a, testColor.a, TEST_LOCATION );
application.Render(2000u);
DALI_TEST_EQUALS( color, Color::WHITE, TEST_LOCATION );
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", Color::WHITE ), true, TEST_LOCATION );
- color = renderer.GetCurrentProperty< Vector4 >( mixColorIndex );
- testColor = Vector4(1,1,1,0);
- DALI_TEST_EQUALS( color, testColor, TEST_LOCATION );
+ color = renderer.GetCurrentProperty< Vector3 >( mixColorIndex );
+ testColor = Vector4(1,1,1,0.1);
+ DALI_TEST_EQUALS( Vector3(color), Vector3(testColor), TEST_LOCATION );
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor) ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", testColor.a ), true, TEST_LOCATION );
+
+ DALI_TEST_CHECK( application.GetGlAbstraction().GetUniformValue< Vector4 >( "uColor", uColor ) );
+ DALI_TEST_EQUALS( uColor.a, testColor.a, TEST_LOCATION );
END_TEST;
}
application.Render(2000u); // halfway point
application.SendNotification();
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f )), true, TEST_LOCATION );
-
Vector4 halfwayColor = (INITIAL_MIX_COLOR + TARGET_MIX_COLOR)*0.5;
+ DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, halfwayColor.a )), true, TEST_LOCATION );
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(halfwayColor) ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", halfwayColor.a ), true, TEST_LOCATION );
application.Render(2001u); // go past end
application.SendNotification(); // Trigger signals
DALI_TEST_EQUALS( actor.GetCurrentColor(), Color::WHITE, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4( 1.0f, 1.0f, 1.0f, TARGET_MIX_COLOR.a ) ), true, TEST_LOCATION );
DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR) ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( application.GetGlAbstraction().CheckUniformValue<float>("opacity", TARGET_MIX_COLOR.a ), true, TEST_LOCATION );
blendModeValue = renderer.GetProperty( Renderer::Property::BLEND_MODE );
DALI_TEST_EQUALS( blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION );
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
TestVisualRender( application, actor, visual );
Vector3 actualValue(Vector4::ZERO);
- float opacity=0.0f;
+ Vector4 actualColor(Vector4::ZERO);
TestGlAbstraction& gl = application.GetGlAbstraction();
DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "mixColor", actualValue ) );
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "opacity", opacity ) );
+ DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uColor", actualColor ) );
DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION );
- DALI_TEST_EQUALS( opacity, testColor.a, TEST_LOCATION );
+ DALI_TEST_EQUALS( actualColor.a, testColor.a, TEST_LOCATION );
END_TEST;
}
TestVisualRender( application, actor, visual );
Vector3 actualValue;
- float opacity;
+ Vector4 actualColor;
TestGlAbstraction& gl = application.GetGlAbstraction();
DALI_TEST_CHECK( gl.GetUniformValue<Vector3>( "mixColor", actualValue ) );
- DALI_TEST_CHECK( gl.GetUniformValue<float>( "opacity", opacity ) );
+ DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "uColor", actualColor ) );
DALI_TEST_EQUALS( actualValue, Vector3(testColor), TEST_LOCATION );
- DALI_TEST_EQUALS( opacity, testColor.a, TEST_LOCATION );
+ DALI_TEST_EQUALS( actualColor.a, testColor.a, TEST_LOCATION );
Stage::GetCurrent().Remove(actor);
DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
END_TEST;
}
+//Test if primitive shape loads a conic section correctly.
+int UtcDaliVisualFactoryGetPrimitiveVisual18(void)
+{
+ //Set up test application first, so everything else can be handled.
+ ToolkitTestApplication application;
+
+ tet_infoline( "UtcDaliVisualFactoryGetPrimitiveVisual18: Request primitive visual to display a conic section" );
+
+ //Set up visual properties.
+ Property::Map propertyMap;
+ propertyMap.Insert( Toolkit::Visual::Property::TYPE, Visual::PRIMITIVE );
+ propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTUM );
+ propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) );
+ propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 );
+ propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f );
+ propertyMap.Insert( PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f );
+ propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f );
+
+ //Test to see if shape loads correctly.
+ TestPrimitiveVisualWithProperties( propertyMap, application );
+
+ END_TEST;
+}
+
//Test if primitive shape visual handles the case of not being passed a specific shape to use.
int UtcDaliVisualFactoryGetPrimitiveVisualN1(void)
{
ALIASES += SINCE_1_0="@since 1.0"
ALIASES += SINCE_1_1="@since 1.1"
ALIASES += SINCE_1_2="@since 1.2"
+ALIASES += SINCE_1_3="@since 1.3"
# Extra tags for Tizen 3.0
ALIASES += SINCE_1_2_2="@since 1.2.2"
# Extra tags for Tizen 4.0
ALIASES += SINCE_1_3_4="@since 1.3.4"
ALIASES += SINCE_1_3_5="@since 1.3.5"
+ALIASES += SINCE_1_3_9="@since 1.3.9"
+ALIASES += SINCE_1_3_15="@since 1.3.15"
ALIASES += DEPRECATED_1_0="@deprecated Deprecated since 1.0"
ALIASES += DEPRECATED_1_1="@deprecated Deprecated since 1.1"
ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 1.2.8"
ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 1.2.10"
ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 1.2"
+ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 1.3"
ALIASES += PLATFORM=""
ALIASES += PRIVLEVEL_PLATFORM=""
#ALIASES += SINCE_1_0="\par Since:\n 2.4, DALi version 1.0"
#ALIASES += SINCE_1_1="\par Since:\n 3.0, DALi version 1.1"
#ALIASES += SINCE_1_2="\par Since:\n 4.0, DALi version 1.2"
+#ALIASES += SINCE_1_3="\par Since:\n 5.0, DALi version 1.3"
## Extra tags for Tizen 3.0
#ALIASES += SINCE_1_2_2="\par Since:\n 3.0, DALi version 1.2.2"
## Extra tags for Tizen 4.0
#ALIASES += SINCE_1_3_4="\par Since:\n 4.0, DALi version 1.3.4"
#ALIASES += SINCE_1_3_5="\par Since:\n 4.0, DALi version 1.3.5"
+#ALIASES += SINCE_1_3_9="\par Since:\n 4.0, DALi version 1.3.9"
+#ALIASES += SINCE_1_3_15="\par Since:\n 4.0, DALi version 1.3.15"
## DALi has no deprecated API in Tizen 2.4 because it's DALi's first release.
## Thus deprecated APIs in DALi 1.0.xx will be deprecated in Tizen 3.0.
#ALIASES += DEPRECATED_1_2_8="@deprecated Deprecated since 3.0, DALi version 1.2.8"
#ALIASES += DEPRECATED_1_2_10="@deprecated Deprecated since 3.0, DALi version 1.2.10"
#ALIASES += DEPRECATED_1_2="@deprecated Deprecated since 4.0, DALi version 1.2"
+#ALIASES += DEPRECATED_1_3="@deprecated Deprecated since 5.0, DALi version 1.3"
#ALIASES += PLATFORM="@platform"
#ALIASES += PRIVLEVEL_PLATFORM="\par Privilege Level:\n platform"
#define DALI_TOOLKIT_TEXT_LABEL_DEVEL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
* @see VerticalLineAlignment::Type for supported values
*/
VERTICAL_LINE_ALIGNMENT,
+
+ /**
+ * @brief The default text background parameters.
+ * @details Name "textBackground", type Property::MAP.
+ * @note Use "textBackground" as property name to avoid conflict with Control's "background" property
+ *
+ * The background map contains the following keys:
+ *
+ * | %Property Name | Type | Required | Description |
+ * |----------------------|----------|----------|--------------------------------------------------------------------------------------------------------------------|
+ * | enable | BOOLEAN | No | True to enable the background or false to disable (the default value is false) |
+ * | color | VECTOR4 | No | The color of the background (the default value is Color::CYAN) |
+ */
+ BACKGROUND,
};
} // namespace Property
#define DALI_TOOLKIT_DEVEL_API_VISUALS_TEXT_VISUAL_PROPERTIES_DEVEL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
* @brief The default outline parameters.
* @details name "outline", type Property::MAP.
*/
- OUTLINE = UNDERLINE + 1
+ OUTLINE = UNDERLINE + 1,
+
+ /**
+ * @copydoc Dali::Toolkit::DevelTextLabel::Property::BACKGROUND
+ */
+ BACKGROUND = UNDERLINE + 2,
};
AccessibilityManager::AccessibilityManager()
: mCurrentFocusActor(FocusIDPair(0, 0)),
+ mCurrentGesturedActor(),
mFocusIndicatorActor(),
+ mPreviousPosition( 0.0f, 0.0f ),
mRecursiveFocusMoveCounter(0),
mIsWrapped(false),
mIsFocusWithinGroup(false),
/**
* Perform the accessibility action to move the focus to the first item on the top
- * and read from the top item continously (by three fingers single tap).
+ * and read from the top item continuously (by three fingers single tap).
* @return whether the accessibility action is performed or not.
*/
virtual bool AccessibilityActionReadFromTop();
/**
* Perform the accessibility action to move the focus to and read from the next item
- * continously (by three fingers double tap).
+ * continuously (by three fingers double tap).
* @return whether the accessibility action is performed or not.
*/
virtual bool AccessibilityActionReadFromNext();
mMargin( 0, 0, 0, 0 ),
mPadding( 0, 0, 0, 0 ),
mKeyEventSignal(),
+ mKeyInputFocusGainedSignal(),
+ mKeyInputFocusLostSignal(),
+ mResourceReadySignal(),
mPinchGestureDetector(),
mPanGestureDetector(),
mTapGestureDetector(),
mIndicatorHideDuration(DEFAULT_INDICATOR_HIDE_DURATION),
mTransientIndicatorDuration(DEFAULT_INDICATOR_TRANSIENT_DURATION),
mScrollStart(0.0f),
+ mGestureDisplacement( Vector3::ZERO ),
mCurrentScrollPosition(0.0f),
mIndicatorHeightPolicy(Toolkit::ScrollBar::Variable),
mIndicatorFixedHeight(DEFAULT_INDICATOR_FIXED_HEIGHT),
Constraint mIndicatorPositionConstraint;
Constraint mIndicatorSizeConstraint;
- Constraint mScrollPositionInCurrentAxisConstraint;
bool mIsPanning : 1; ///< Whether the scroll bar is being panned.
bool mIndicatorFirstShow : 1; ///< True if the indicator has never been shown
mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
mOvershootSize( OVERSHOOT_DEFAULT_SIZE ),
mScrollToAlphaFunction( AlphaFunction::EASE_OUT ),
+ mScrollStartedSignal(),
+ mScrollUpdatedSignal(),
+ mScrollCompletedSignal(),
mOvershootEnabled(true)
{
}
mOvershootAnimationSpeed ( DEFAULT_OVERSHOOT_ANIMATION_SPEED ),
mOvershootSize( OVERSHOOT_DEFAULT_SIZE ),
mScrollToAlphaFunction( AlphaFunction::EASE_OUT ),
+ mScrollStartedSignal(),
+ mScrollUpdatedSignal(),
+ mScrollCompletedSignal(),
mOvershootEnabled(true)
{
}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
DALI_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "lineCount", INTEGER, LINE_COUNT )
DALI_PROPERTY_REGISTRATION( Toolkit, TextLabel, "lineWrapMode", INTEGER, LINE_WRAP_MODE )
DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "textDirection", INTEGER, TEXT_DIRECTION )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalLineAlignment", INTEGER, VERTICAL_LINE_ALIGNMENT )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalLineAlignment", INTEGER, VERTICAL_LINE_ALIGNMENT )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textBackground", MAP, BACKGROUND )
DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT( Toolkit, TextLabel, "textColor", Color::BLACK, TEXT_COLOR )
DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorRed", TEXT_COLOR_RED, TEXT_COLOR, 0 )
DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorGreen", TEXT_COLOR_GREEN, TEXT_COLOR, 1 )
}
break;
}
+ case Toolkit::DevelTextLabel::Property::BACKGROUND:
+ {
+ const bool update = SetBackgroundProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
+ if( update )
+ {
+ impl.mTextUpdateNeeded = true;
+ }
+ break;
+ }
}
// Request relayout when text update is needed. It's necessary to call it
}
break;
}
+ case Toolkit::DevelTextLabel::Property::BACKGROUND:
+ {
+ GetBackgroundProperties( impl.mController, value, Text::EffectStyle::DEFAULT );
+ break;
+ }
}
}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "muted", BOOLEAN, MUTED )
DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "volume", MAP, VOLUME )
DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "underlay", BOOLEAN, UNDERLAY )
+DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "playPosition", INTEGER, PLAY_POSITION )
+DALI_PROPERTY_REGISTRATION( Toolkit, VideoView, "displayMode", INTEGER, DISPLAY_MODE )
DALI_SIGNAL_REGISTRATION( Toolkit, VideoView, "finished", FINISHED_SIGNAL )
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
\n
void main()\n
{\n
- gl_FragColor = vec4(mixColor, opacity)*uColor;\n
+ gl_FragColor = vec4(mixColor, 1.0)*uColor;\n
}\n
);
}
break;
}
+ case Toolkit::VideoView::Property::PLAY_POSITION:
+ {
+ int pos;
+ if( value.Get( pos ) )
+ {
+ impl.SetPlayPosition( pos );
+ }
+ break;
+ }
+ case Toolkit::VideoView::Property::DISPLAY_MODE:
+ {
+ int mode;
+ if( value.Get( mode ) )
+ {
+ impl.SetDisplayMode( mode );
+ }
+ break;
+ }
}
}
}
value = impl.IsUnderlay();
break;
}
+ case Toolkit::VideoView::Property::PLAY_POSITION:
+ {
+ value = impl.GetPlayPosition();
+ break;
+ }
+ case Toolkit::VideoView::Property::DISPLAY_MODE:
+ {
+ value = impl.GetDisplayMode();
+ break;
+ }
}
}
return mIsUnderlay;
}
+void VideoView::SetSWCodec( bool on )
+{
+ // If setting SW or HW type is failed , video-view shows video by default codec type.
+ // The default codec type is selected by platform.
+ if( on )
+ {
+ mVideoPlayer.SetCodecType( Dali::VideoPlayerPlugin::CodecType::SW );
+ }
+ else
+ {
+ mVideoPlayer.SetCodecType( Dali::VideoPlayerPlugin::CodecType::HW );
+ }
+}
+
+int VideoView::GetPlayPosition()
+{
+ return mVideoPlayer.GetPlayPosition();
+}
+
+void VideoView::SetPlayPosition( int pos )
+{
+ mVideoPlayer.SetPlayPosition( pos );
+}
+
+void VideoView::SetDisplayMode( int mode )
+{
+ mVideoPlayer.SetDisplayMode( static_cast< Dali::VideoPlayerPlugin::DisplayMode::Type >( mode ) );
+}
+
+int VideoView::GetDisplayMode() const
+{
+ return static_cast< int >( mVideoPlayer.GetDisplayMode() );
+}
+
} // namespace Internal
} // namespace toolkit
*/
bool IsUnderlay();
+ /**
+ * @brief Sets sw codec type.
+ */
+ void SetSWCodec( bool on );
+
+ /**
+ * @brief Gets play position.
+ */
+ int GetPlayPosition();
+
+ /**
+ * @brief Sets play position.
+ */
+ void SetPlayPosition( int pos );
+
+ /**
+ * @brief Sets Display mode.
+ */
+ void SetDisplayMode( int mode );
+
+ /**
+ * @brief Gets Display mode.
+ */
+ int GetDisplayMode() const;
+
private: // From Control
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/devel-api/adaptor-framework/image-loading.h>
+#include <dali/integration-api/adaptors/adaptor.h>
namespace Dali
{
ImageLoadThread::ImageLoadThread( EventThreadCallback* trigger )
-: mTrigger( trigger )
+: mTrigger( trigger ),
+ mLogFactory( Dali::Adaptor::Get().GetLogFactory() )
{
}
void ImageLoadThread::Run()
{
+ mLogFactory.InstallLogFunction();
+
while( LoadingTask* task = NextTaskToProcess() )
{
task->Load();
#define __DALI_TOOLKIT_IMAGE_LOAD_THREAD_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
#include <dali/devel-api/threading/thread.h>
#include <dali/devel-api/adaptor-framework/event-thread-callback.h>
#include <dali/devel-api/adaptor-framework/pixel-buffer.h>
+#include <dali/integration-api/adaptors/log-factory-interface.h>
#include <dali-toolkit/internal/visuals/visual-url.h>
namespace Dali
Vector< LoadingTask* > mLoadQueue; ///<The task queue with images for loading.
Vector< LoadingTask* > mCompleteQueue; ///<The task queue with images loaded.
+ EventThreadCallback* mTrigger;
+ const Dali::LogFactoryInterface& mLogFactory; ///< The log factory
ConditionalWait mConditionalWait;
Dali::Mutex mMutex;
- EventThreadCallback* mTrigger;
};
} // namespace Internal
Impl()
: mLayout( Layout::Engine::SINGLE_LINE_BOX ),
mCursorWidth( CURSOR_WIDTH ),
- mDefaultLineSpacing( LINE_SPACING )
+ mDefaultLineSpacing( LINE_SPACING ),
+ mPreviousCharacterExtraWidth( 0.0f )
{
}
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
+ tmpExtraWidth = std::max( mPreviousCharacterExtraWidth - glyphMetrics.advance, tmpExtraWidth );
}
}
else
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
+ tmpExtraWidth = std::max( mPreviousCharacterExtraWidth - glyphMetrics.advance, tmpExtraWidth );
}
else // LTR
{
const float extraWidth = glyphMetrics.xBearing + glyphMetrics.width - glyphMetrics.advance;
tmpExtraWidth = ( 0.f < extraWidth ) ? extraWidth : 0.f;
+ tmpExtraWidth = std::max( mPreviousCharacterExtraWidth - glyphMetrics.advance, tmpExtraWidth );
}
}
}
tmpLineLayout.wsLengthEndOfLine = 0.f;
}
+ // Save the current extra width to compare with the next one
+ mPreviousCharacterExtraWidth = tmpExtraWidth;
+
// Check if the accumulated length fits in the width of the box.
if( ( completelyFill || isMultiline ) && !isWhiteSpace &&
( tmpExtraBearing + lineLayout.length + lineLayout.wsLengthEndOfLine + tmpLineLayout.length + tmpExtraWidth > parameters.boundingBox.width ) )
Type mLayout;
float mCursorWidth;
float mDefaultLineSpacing;
+ float mPreviousCharacterExtraWidth;
IntrusivePtr<Metrics> mMetrics;
};
*/
void ParseAttributes( Tag& tag )
{
+ if( tag.buffer == NULL )
+ {
+ return;
+ }
+
tag.attributes.Resize( MAX_NUM_OF_ATTRIBUTES );
// Find first the tag name.
{
// Initializes the default font cache to zero (invalid font).
// Reserves space to cache the default fonts and access them with the script as an index.
- mDefaultFontPerScriptCache.Resize( TextAbstraction::UNKNOWN, NULL );
+ mDefaultFontPerScriptCache.Resize( TextAbstraction::UNKNOWN + 1, NULL );
// Initializes the valid fonts cache to NULL (no valid fonts).
// Reserves space to cache the valid fonts and access them with the script as an index.
- mValidFontsPerScriptCache.Resize( TextAbstraction::UNKNOWN, NULL );
+ mValidFontsPerScriptCache.Resize( TextAbstraction::UNKNOWN + 1, NULL );
}
MultilanguageSupport::~MultilanguageSupport()
currentScriptRun.characterRun.numberOfCharacters += numberOfAllScriptCharacters;
// Store the script run.
- if( TextAbstraction::UNKNOWN == currentScriptRun.script )
- {
- currentScriptRun.script = TextAbstraction::LATIN;
- }
scripts.Insert( scripts.Begin() + scriptIndex, currentScriptRun );
++scriptIndex;
else if( ( TextAbstraction::UNKNOWN == currentScriptRun.script ) &&
( TextAbstraction::EMOJI == script ) )
{
- currentScriptRun.script = TextAbstraction::LATIN;
currentScriptRun.characterRun.numberOfCharacters += numberOfAllScriptCharacters;
numberOfAllScriptCharacters = 0u;
}
if( 0u != currentScriptRun.characterRun.numberOfCharacters )
{
- if( TextAbstraction::UNKNOWN == currentScriptRun.script )
- {
- // There are only white spaces in the last script. Set the latin script.
- currentScriptRun.script = TextAbstraction::LATIN;
- }
-
// Store the last run.
scripts.Insert( scripts.Begin() + scriptIndex, currentScriptRun );
++scriptIndex;
description.path.c_str() );
}
#endif
- if( script == TextAbstraction::UNKNOWN )
- {
- script = TextAbstraction::LATIN;
- }
// Validate whether the current character is supported by the given font.
bool isValidFont = false;
fontId = fontClient.FindDefaultFont( UTF32_A, currentFontPointSize );
}
- // Cache the font.
- if( NULL == defaultFontsPerScript )
+ if ( script != TextAbstraction::UNKNOWN )
{
- defaultFontsPerScript = *( defaultFontPerScriptCacheBuffer + script );
-
+ // Cache the font if it is not an unknown script
if( NULL == defaultFontsPerScript )
{
- defaultFontsPerScript = new DefaultFonts();
- *( defaultFontPerScriptCacheBuffer + script ) = defaultFontsPerScript;
+ defaultFontsPerScript = *( defaultFontPerScriptCacheBuffer + script );
+
+ if( NULL == defaultFontsPerScript )
+ {
+ defaultFontsPerScript = new DefaultFonts();
+ *( defaultFontPerScriptCacheBuffer + script ) = defaultFontsPerScript;
+ }
}
+ defaultFontsPerScript->Cache( currentFontDescription, fontId );
}
- defaultFontsPerScript->Cache( currentFontDescription, fontId );
}
} // !isValidFont (3)
} // !isValidFont (2)
// EXTERNAL INCLUDES
#include <dali/public-api/rendering/geometry.h>
#include <dali/public-api/rendering/renderer.h>
-#include <dali/public-api/images/frame-buffer-image.h>
#include <dali/devel-api/text-abstraction/font-client.h>
#include <dali/integration-api/debug.h>
#include <dali/public-api/animation/constraints.h>
uint32_t mAtlasId;
AtlasManager::Mesh2D mMesh;
- FrameBufferImage mBuffer;
};
/**
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
// Pointer to the color glyph if there is one.
const uint32_t* const colorGlyphBuffer = isColorGlyph ? reinterpret_cast<uint32_t*>( data.glyphBitmap.buffer ) : NULL;
- // Pack the given color into a 32bit buffer. The alpha channel will be updated later for each pixel.
- // The format is RGBA8888.
- uint32_t packedColor = 0u;
- uint8_t* packedColorBuffer = reinterpret_cast<uint8_t*>( &packedColor );
- *( packedColorBuffer + 2 ) = static_cast<uint8_t>( color->b * 255.f );
- *( packedColorBuffer + 1 ) = static_cast<uint8_t>( color->g * 255.f );
- *packedColorBuffer = static_cast<uint8_t>( color->r * 255.f );
-
// Initial vertical offset.
const int yOffset = data.verticalOffset + position->y;
uint32_t packedColorGlyph = *( colorGlyphBuffer + glyphBufferOffset + index );
uint8_t* packedColorGlyphBuffer = reinterpret_cast<uint8_t*>( &packedColorGlyph );
- if( Typesetter::STYLE_SHADOW == style )
- {
- // The shadow of color glyph needs to have the shadow color.
- *( packedColorGlyphBuffer + 2 ) = static_cast<uint8_t>( color->b * 255.f );
- *( packedColorGlyphBuffer + 1 ) = static_cast<uint8_t>( color->g * 255.f );
- *packedColorGlyphBuffer = static_cast<uint8_t>( color->r * 255.f );
- }
- else
- {
- std::swap( *packedColorGlyphBuffer, *( packedColorGlyphBuffer + 2u ) ); // Swap B and R.
- }
-
// Update the alpha channel.
if( Typesetter::STYLE_MASK == style || Typesetter::STYLE_OUTLINE == style ) // Outline not shown for color glyph
{
// Create an alpha mask for color glyph.
*( packedColorGlyphBuffer + 3u ) = 0u;
+ *( packedColorGlyphBuffer + 2u ) = 0u;
+ *( packedColorGlyphBuffer + 1u ) = 0u;
+ *packedColorGlyphBuffer = 0u;
}
else
{
- *( packedColorGlyphBuffer + 3u ) = static_cast<uint8_t>( color->a * static_cast<float>( *( packedColorGlyphBuffer + 3u ) ) );
+ uint8_t colorAlpha = static_cast<uint8_t>( color->a * static_cast<float>( *( packedColorGlyphBuffer + 3u ) ) );
+ *( packedColorGlyphBuffer + 3u ) = colorAlpha;
+
+ if( Typesetter::STYLE_SHADOW == style )
+ {
+ // The shadow of color glyph needs to have the shadow color.
+ *( packedColorGlyphBuffer + 2u ) = static_cast<uint8_t>( color->b * colorAlpha );
+ *( packedColorGlyphBuffer + 1u ) = static_cast<uint8_t>( color->g * colorAlpha );
+ *packedColorGlyphBuffer = static_cast<uint8_t>( color->r * colorAlpha );
+ }
+ else
+ {
+ std::swap( *packedColorGlyphBuffer, *( packedColorGlyphBuffer + 2u ) ); // Swap B and R.
+
+ *( packedColorGlyphBuffer + 2u ) = ( *( packedColorGlyphBuffer + 2u ) * colorAlpha / 255 );
+ *( packedColorGlyphBuffer + 1u ) = ( *( packedColorGlyphBuffer + 1u ) * colorAlpha / 255 );
+ *packedColorGlyphBuffer = ( *( packedColorGlyphBuffer ) * colorAlpha / 255 );
+ }
}
// Set the color into the final pixel buffer.
}
else
{
+ // Pack the given color into a 32bit buffer. The alpha channel will be updated later for each pixel.
+ // The format is RGBA8888.
+ uint32_t packedColor = 0u;
+ uint8_t* packedColorBuffer = reinterpret_cast<uint8_t*>( &packedColor );
+
// Update the alpha channel.
const uint8_t alpha = *( data.glyphBitmap.buffer + glyphBufferOffset + index );
uint32_t& currentColor = *( bitmapBuffer + verticalOffset + xOffsetIndex );
uint8_t* packedCurrentColorBuffer = reinterpret_cast<uint8_t*>( ¤tColor );
- uint8_t currentAlpha = *( packedCurrentColorBuffer + 3u );
- uint8_t newAlpha = static_cast<uint8_t>( color->a * static_cast<float>( alpha ) );
-
// For any pixel overlapped with the pixel in previous glyphs, make sure we don't
// overwrite a previous bigger alpha with a smaller alpha (in order to avoid
// semi-transparent gaps between joint glyphs with overlapped pixels, which could
// happen, for example, in the RTL text when we copy glyphs from right to left).
- *( packedColorBuffer + 3u ) = std::max( currentAlpha, newAlpha );
+ uint8_t currentAlpha = *( packedCurrentColorBuffer + 3u );
+ currentAlpha = std::max( currentAlpha, alpha );
+
+ // Color is pre-muliplied with its alpha.
+ *( packedColorBuffer + 3u ) = static_cast<uint8_t>( color->a * currentAlpha );
+ *( packedColorBuffer + 2u ) = static_cast<uint8_t>( color->b * currentAlpha );
+ *( packedColorBuffer + 1u ) = static_cast<uint8_t>( color->g * currentAlpha );
+ *( packedColorBuffer ) = static_cast<uint8_t>( color->r * currentAlpha );
// Set the color into the final pixel buffer.
currentColor = packedColor;
{
// Check alpha of overlapped pixels
uint8_t& currentAlpha = *( bitmapBuffer + verticalOffset + xOffsetIndex );
- uint8_t newAlpha = static_cast<uint8_t>( color->a * static_cast<float>( alpha ) );
// For any pixel overlapped with the pixel in previous glyphs, make sure we don't
// overwrite a previous bigger alpha with a smaller alpha (in order to avoid
// semi-transparent gaps between joint glyphs with overlapped pixels, which could
// happen, for example, in the RTL text when we copy glyphs from right to left).
- *( bitmapBuffer + verticalOffset + xOffsetIndex ) = std::max( currentAlpha, newAlpha );
+ *( bitmapBuffer + verticalOffset + xOffsetIndex ) = std::max( currentAlpha, alpha );
}
}
}
// Combine the two buffers
imageBuffer = CombineImageBuffer( imageBuffer, underlineImageBuffer, bufferWidth, bufferHeight );
}
+
+ // Generate the background if enabled
+ const bool backgroundEnabled = mModel->IsBackgroundEnabled();
+ if ( backgroundEnabled )
+ {
+ Devel::PixelBuffer backgroundImageBuffer = CreateImageBuffer( bufferWidth, bufferHeight, Typesetter::STYLE_BACKGROUND, ignoreHorizontalAlignment, pixelFormat, penX, penY, 0u, numberOfGlyphs -1 );
+
+ // Combine the two buffers
+ imageBuffer = CombineImageBuffer( imageBuffer, backgroundImageBuffer, bufferWidth, bufferHeight );
+ }
}
// Create the final PixelData for the combined image buffer
// Retrieves the glyph's color.
const ColorIndex colorIndex = *( colorIndexBuffer + glyphIndex );
- const Vector4* color;
+ Vector4 color;
if ( style == Typesetter::STYLE_SHADOW )
{
- color = &( mModel->GetShadowColor() );
+ color = mModel->GetShadowColor();
}
else if ( style == Typesetter::STYLE_OUTLINE )
{
- color = &( mModel->GetOutlineColor() );
+ color = mModel->GetOutlineColor();
}
else
{
- color = ( useDefaultColor || ( 0u == colorIndex ) ) ? &defaultColor : colorsBuffer + ( colorIndex - 1u );
+ color = ( useDefaultColor || ( 0u == colorIndex ) ) ? defaultColor : *( colorsBuffer + ( colorIndex - 1u ) );
}
+ // Premultiply alpha
+ color.r *= color.a;
+ color.g *= color.a;
+ color.b *= color.a;
+
// Retrieves the glyph's bitmap.
glyphData.glyphBitmap.buffer = NULL;
glyphData.glyphBitmap.width = glyphInfo->width; // Desired width and height.
{
TypesetGlyph( glyphData,
position,
- color,
+ &color,
style,
pixelFormat);
// delete the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer
uint8_t* underlinePixelBuffer = reinterpret_cast<uint8_t*>( &underlinePixel );
// Write the underline color to the pixel buffer
- *( underlinePixelBuffer ) = static_cast<uint8_t>( underlineColor.r * 255.f );
- *( underlinePixelBuffer + 1u ) = static_cast<uint8_t>( underlineColor.g * 255.f );
- *( underlinePixelBuffer + 2u ) = static_cast<uint8_t>( underlineColor.b * 255.f );
- *( underlinePixelBuffer + 3u ) = static_cast<uint8_t>( underlineColor.a * 255.f );
+ uint8_t colorAlpha = static_cast< uint8_t >( underlineColor.a * 255.f );
+ *( underlinePixelBuffer + 3u ) = colorAlpha;
+ *( underlinePixelBuffer + 2u ) = static_cast< uint8_t >( underlineColor.b * colorAlpha );
+ *( underlinePixelBuffer + 1u ) = static_cast< uint8_t >( underlineColor.g * colorAlpha );
+ *( underlinePixelBuffer ) = static_cast< uint8_t >( underlineColor.r * colorAlpha );
*( bitmapBuffer + y * glyphData.width + x ) = underlinePixel;
}
}
}
+ // Draw the background color from the leftmost glyph to the rightmost glyph
+ if ( style == Typesetter::STYLE_BACKGROUND )
+ {
+ Vector4 backgroundColor = mModel->GetBackgroundColor();
+
+ for( int y = glyphData.verticalOffset + baseline - line.ascender; y < glyphData.verticalOffset + baseline - line.descender; y++ )
+ {
+ if( ( y < 0 ) || ( y > static_cast<int>(bufferHeight - 1) ) )
+ {
+ // Do not write out of bounds.
+ continue;
+ }
+
+ for( int x = glyphData.horizontalOffset + lineExtentLeft; x <= glyphData.horizontalOffset + lineExtentRight; x++ )
+ {
+ if( ( x < 0 ) || ( x > static_cast<int>(bufferWidth - 1) ) )
+ {
+ // Do not write out of bounds.
+ continue;
+ }
+
+ // Always RGBA image for text with styles
+ uint32_t* bitmapBuffer = reinterpret_cast< uint32_t* >( glyphData.bitmapBuffer.GetBuffer() );
+ uint32_t backgroundPixel = *( bitmapBuffer + y * glyphData.width + x );
+ uint8_t* backgroundPixelBuffer = reinterpret_cast<uint8_t*>( &backgroundPixel );
+
+ // Write the background color to the pixel buffer
+ uint8_t colorAlpha = static_cast< uint8_t >( backgroundColor.a * 255.f );
+ *( backgroundPixelBuffer + 3u ) = colorAlpha;
+ *( backgroundPixelBuffer + 2u ) = static_cast< uint8_t >( backgroundColor.b * colorAlpha );
+ *( backgroundPixelBuffer + 1u ) = static_cast< uint8_t >( backgroundColor.g * colorAlpha );
+ *( backgroundPixelBuffer ) = static_cast< uint8_t >( backgroundColor.r * colorAlpha );
+
+ *( bitmapBuffer + y * glyphData.width + x ) = backgroundPixel;
+ }
+ }
+ }
+
// Increases the vertical offset with the line's descender.
glyphData.verticalOffset += static_cast<int>( -line.descender );
}
// Otherwise, copy pixel from topBuffer to combinedBuffer.
unsigned int alphaBuffer1 = topBuffer[pixelIndex*4+3];
- unsigned int alphaBuffer2 = bottomBuffer[pixelIndex*4+3];
- if ( alphaBuffer1 != 255 || alphaBuffer2 != 255 )
+ if ( alphaBuffer1 != 255 )
{
// At least one pixel is not fully opaque
// "Over" blend the the pixel from topBuffer with the pixel in bottomBuffer
- combinedBuffer[pixelIndex*4] = ( topBuffer[pixelIndex*4] * topBuffer[pixelIndex*4+3] / 255 ) + ( bottomBuffer[pixelIndex*4] * bottomBuffer[pixelIndex*4+3] * ( 255 - topBuffer[pixelIndex*4+3] ) / ( 255*255 ) );
- combinedBuffer[pixelIndex*4+1] = ( topBuffer[pixelIndex*4+1] * topBuffer[pixelIndex*4+3] / 255 ) + ( bottomBuffer[pixelIndex*4+1] * bottomBuffer[pixelIndex*4+3] * ( 255 - topBuffer[pixelIndex*4+3] ) / ( 255*255 ) );
- combinedBuffer[pixelIndex*4+2] = ( topBuffer[pixelIndex*4+2] * topBuffer[pixelIndex*4+3] / 255 ) + ( bottomBuffer[pixelIndex*4+2] * bottomBuffer[pixelIndex*4+3] * ( 255 - topBuffer[pixelIndex*4+3] ) / ( 255*255 ) );
+ combinedBuffer[pixelIndex*4] = topBuffer[pixelIndex*4] + ( bottomBuffer[pixelIndex*4] * ( 255 - topBuffer[pixelIndex*4+3] ) / 255 );
+ combinedBuffer[pixelIndex*4+1] = topBuffer[pixelIndex*4+1] + ( bottomBuffer[pixelIndex*4+1] * ( 255 - topBuffer[pixelIndex*4+3] ) / 255 );
+ combinedBuffer[pixelIndex*4+2] = topBuffer[pixelIndex*4+2] + ( bottomBuffer[pixelIndex*4+2] * ( 255 - topBuffer[pixelIndex*4+3] ) / 255 );
combinedBuffer[pixelIndex*4+3] = topBuffer[pixelIndex*4+3] + ( bottomBuffer[pixelIndex*4+3] * ( 255 - topBuffer[pixelIndex*4+3] ) / 255 );
}
else
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
return mModel->GetOutlineWidth();
}
+const Vector4& ViewModel::GetBackgroundColor() const
+{
+ return mModel->GetBackgroundColor();
+}
+
+bool ViewModel::IsBackgroundEnabled() const
+{
+ return mModel->IsBackgroundEnabled();
+}
+
void ViewModel::ElideGlyphs()
{
mIsTextElided = false;
#define DALI_TOOLKIT_TEXT_VIEW_MODEL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
virtual float GetOutlineWidth() const;
- /**
+ /**
+ * @copydoc ModelInterface::GetBackgroundColor()
+ */
+ virtual const Vector4& GetBackgroundColor() const;
+
+ /**
+ * @copydoc ModelInterface::IsBackgroundEnabled()
+ */
+ virtual bool IsBackgroundEnabled() const;
+
+/**
* @brief Does the text elide.
*
* It stores a copy of the visible glyphs and removes as many glyphs as needed
mAllTextSelected( false ),
mUpdateInputStyle( false ),
mPasswordInput( false ),
+ mCheckScrollAmount( false ),
mIsPlaceholderPixelSize( false ),
mIsPlaceholderElideEnabled( false ),
mPlaceholderEllipsisFlag( false ),
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
return mImpl->mModel->mVisualModel->GetOutlineWidth();
}
+void Controller::SetBackgroundColor( const Vector4& color )
+{
+ mImpl->mModel->mVisualModel->SetBackgroundColor( color );
+
+ mImpl->RequestRelayout();
+}
+
+const Vector4& Controller::GetBackgroundColor() const
+{
+ return mImpl->mModel->mVisualModel->GetBackgroundColor();
+}
+
+void Controller::SetBackgroundEnabled( bool enabled )
+{
+ mImpl->mModel->mVisualModel->SetBackgroundEnabled( enabled );
+
+ mImpl->RequestRelayout();
+}
+
+bool Controller::IsBackgroundEnabled() const
+{
+ return mImpl->mModel->mVisualModel->IsBackgroundEnabled();
+}
+
void Controller::SetDefaultEmbossProperties( const std::string& embossProperties )
{
if( NULL == mImpl->mEmbossDefaults )
if ( mImpl->mUpdateTextDirection )
{
// Operations that can be done only once until the text changes.
- const OperationsMask onlyOnceOperations = static_cast<OperationsMask>( GET_SCRIPTS |
+ const OperationsMask onlyOnceOperations = static_cast<OperationsMask>( CONVERT_TO_UTF32 |
+ GET_SCRIPTS |
VALIDATE_FONTS |
GET_LINE_BREAKS |
GET_WORD_BREAKS |
BIDI_INFO |
- SHAPE_TEXT );
+ SHAPE_TEXT |
+ GET_GLYPH_METRICS );
// Set the update info to relayout the whole text.
mImpl->mTextUpdateInfo.mParagraphCharacterIndex = 0u;
LAYOUT | REORDER | UPDATE_DIRECTION ),
naturalSize.GetVectorXY() );
+ // Do not do again the only once operations.
+ mImpl->mOperationsPending = static_cast<OperationsMask>( mImpl->mOperationsPending & ~onlyOnceOperations );
+
// Clear the update info. This info will be set the next time the text is updated.
mImpl->mTextUpdateInfo.Clear();
#define DALI_TOOLKIT_TEXT_CONTROLLER_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
unsigned int GetOutlineWidth() const;
/**
+ * @brief Set the background color.
+ *
+ * @param[in] color color of background.
+ */
+ void SetBackgroundColor( const Vector4& color );
+
+ /**
+ * @brief Retrieve the background color.
+ *
+ * @return The background color.
+ */
+ const Vector4& GetBackgroundColor() const;
+
+ /**
+ * @brief Set the background enabled flag.
+ *
+ * @param[in] enabled The background enabled flag.
+ */
+ void SetBackgroundEnabled( bool enabled );
+
+ /**
+ * @brief Returns whether to enable text background or not.
+ *
+ * @return Whether text background is enabled.
+ */
+ bool IsBackgroundEnabled() const;
+
+ /**
* @brief Sets the emboss's properties string.
*
* @note The string is stored to be recovered.
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
return 0u == numberOfItems;
}
+bool ParseBackgroundProperties( const Property::Map& backgroundProperties,
+ bool& enabled,
+ bool& colorDefined,
+ Vector4& color )
+{
+ const unsigned int numberOfItems = backgroundProperties.Count();
+
+ // Parses and applies the style.
+ for( unsigned int index = 0u; index < numberOfItems; ++index )
+ {
+ const KeyValuePair& valueGet = backgroundProperties.GetKeyValue( index );
+
+ if( ENABLE_KEY == valueGet.first.stringKey )
+ {
+ /// Enable key.
+ enabled = valueGet.second.Get<bool>();
+ }
+ else if( COLOR_KEY == valueGet.first.stringKey )
+ {
+ /// Color key.
+ colorDefined = true;
+ color = valueGet.second.Get<Vector4>();
+ }
+ }
+
+ return 0u == numberOfItems;
+}
+
bool SetUnderlineProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type )
{
bool update = false;
}
}
+bool SetBackgroundProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type )
+{
+ bool update = false;
+
+ if( controller )
+ {
+ switch( type )
+ {
+ case EffectStyle::DEFAULT:
+ {
+ const Property::Map& propertiesMap = value.Get<Property::Map>();
+
+ bool enabled = false;
+ bool colorDefined = false;
+ Vector4 color;
+
+ bool empty = true;
+
+ if ( !propertiesMap.Empty() )
+ {
+ empty = ParseBackgroundProperties( propertiesMap,
+ enabled,
+ colorDefined,
+ color );
+ }
+
+ if( !empty )
+ {
+ if( enabled != controller->IsBackgroundEnabled() )
+ {
+ controller->SetBackgroundEnabled( enabled );
+ update = true;
+ }
+
+ if( colorDefined && ( controller->GetBackgroundColor() != color ) )
+ {
+ controller->SetBackgroundColor( color );
+ update = true;
+ }
+ }
+ else
+ {
+ // Disable background.
+ if( controller->IsBackgroundEnabled() )
+ {
+ controller->SetBackgroundEnabled( false );
+ update = true;
+ }
+ }
+ break;
+ }
+ case EffectStyle::INPUT:
+ {
+ // Text background is not supported while inputting yet
+ break;
+ }
+ } // switch
+ } // if( controller )
+
+ return update;
+}
+
+void GetBackgroundProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type )
+{
+ if( controller )
+ {
+ switch( type )
+ {
+ case EffectStyle::DEFAULT:
+ {
+ const bool enabled = controller->IsBackgroundEnabled();
+ const Vector4& color = controller->GetBackgroundColor();
+
+ Property::Map map;
+ map.Insert( ENABLE_KEY, enabled );
+ map.Insert( COLOR_KEY, color );
+
+ value = map;
+
+ break;
+
+ }
+ case EffectStyle::INPUT:
+ {
+ // Text background is not supported while inputting yet
+ break;
+ }
+ }
+ }
+}
+
+
} // namespace Text
} // namespace Toolkit
#define __DALI_TOOLKIT_INTERNAL_TEXT_EFFECTS_STYLE_H__
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
bool& widthDefined,
unsigned int& width );
+
+/**
+ * @brief Parses the background properties.
+ *
+ * @param[in] backgroundProperties The map with the background properties.
+ * @param[out] enabled Whether the background is enabled.
+ * @param[out] colorDefined Whether the background color is defined.
+ * @param[out] color The background color.
+ */
+bool ParseBackgroundProperties( const Property::Map& backgroundProperties,
+ bool& enabled,
+ bool& colorDefined,
+ Vector4& color );
+
/**
* @brief Sets the underline properties.
*
*/
void GetOutlineProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
+/**
+ * @brief Sets the background properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[in] value The values of the background's properties.
+ * @param[in] type Whether the property is for the default background or the input background.
+ *
+ * @return Whether the background properties have been updated.
+ */
+bool SetBackgroundProperties( ControllerPtr controller, const Property::Value& value, EffectStyle::Type type );
+
+/**
+ * @brief Retrieves the background's properties.
+ *
+ * @param[in] controller The text's controller.
+ * @param[out] value The value of the underline's properties.
+ * @param[in] type Whether the property is for the default background or the input background.
+ */
+void GetBackgroundProperties( ControllerPtr controller, Property::Value& value, EffectStyle::Type type );
+
} // namespace Text
} // namespace Toolkit
#define DALI_TOOLKIT_TEXT_MODEL_INTERFACE_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
virtual float GetOutlineWidth() const = 0;
+ /**
+ * @brief Retrieves the background color.
+ *
+ * @return The background color.
+ */
+ virtual const Vector4& GetBackgroundColor() const = 0;
+
+ /**
+ * @brief Returns whether background is enabled or not.
+ *
+ * @return The background state.
+ */
+ virtual bool IsBackgroundEnabled() const = 0;
+
};
} // namespace Text
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
return mVisualModel->GetOutlineWidth();
}
+const Vector4& Model::GetBackgroundColor() const
+{
+ return mVisualModel->GetBackgroundColor();
+}
+
+bool Model::IsBackgroundEnabled() const
+{
+ return mVisualModel->IsBackgroundEnabled();
+}
+
Model::Model()
: mLogicalModel(),
mVisualModel(),
#define DALI_TOOLKIT_TEXT_MODEL_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
virtual float GetOutlineWidth() const;
+ /**
+ * @copydoc ModelInterface::GetBackgroundColor()
+ */
+ virtual const Vector4& GetBackgroundColor() const;
+
+ /**
+ * @copydoc ModelInterface::IsBackgroundEnabled()
+ */
+ virtual bool IsBackgroundEnabled() const;
+
private: // Private contructors & copy operator.
/**
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
uniform sampler2D sTexture;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
if ( vTexCoord.y > 1.0 )\n
discard;\n
\n
mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
- textTexture.rgb *= mix( 1.0, textTexture.a, preMultipliedAlpha );\n
\n
- gl_FragColor = textTexture * uColor * visualMixColor();
+ gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 );
}\n
);
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
mOutlineWidth = width;
}
+void VisualModel::SetBackgroundColor( const Vector4& color )
+{
+ mBackgroundColor = color;
+}
+
+void VisualModel::SetBackgroundEnabled( bool enabled )
+{
+ mBackgroundEnabled = enabled;
+}
+
const Vector4& VisualModel::GetTextColor() const
{
return mTextColor;
return mOutlineWidth;
}
+const Vector4& VisualModel::GetBackgroundColor() const
+{
+ return mBackgroundColor;
+}
+
+bool VisualModel::IsBackgroundEnabled() const
+{
+ return mBackgroundEnabled;
+}
+
Length VisualModel::GetNumberOfUnderlineRuns() const
{
return mUnderlineRuns.Count();
mShadowColor( Color::BLACK ),
mUnderlineColor( Color::BLACK ),
mOutlineColor( Color::WHITE ),
+ mBackgroundColor( Color::CYAN ),
mControlSize(),
mShadowOffset(),
mUnderlineHeight( 0.0f ),
mLayoutSize(),
mCachedLineIndex( 0u ),
mUnderlineEnabled( false ),
- mUnderlineColorSet( false )
+ mUnderlineColorSet( false ),
+ mBackgroundEnabled( false )
{
}
#define __DALI_TOOLKIT_TEXT_VISUAL_MODEL_IMPL_H__
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
*/
unsigned int GetOutlineWidth() const;
+ /**
+ * @brief Sets the text's background color.
+ *
+ * @param[in] color The text's background color.
+ */
+ void SetBackgroundColor( const Vector4& color );
+
+ /**
+ * @brief Retrieves the text's background color.
+ *
+ * @return The text's background color.
+ */
+ const Vector4& GetBackgroundColor() const;
+
+ /**
+ * @brief Sets whether the text has a background or not.
+ *
+ * @param[in] enabled true if the text has a background.
+ */
+ void SetBackgroundEnabled( bool enabled );
+
+ /**
+ * @brief Returns whether the text has a background or not.
+ *
+ * @return whether the text has a background or not.
+ */
+ bool IsBackgroundEnabled() const;
+
protected:
/**
Vector4 mShadowColor; ///< Color of drop shadow
Vector4 mUnderlineColor; ///< Color of underline
Vector4 mOutlineColor; ///< Color of outline
+ Vector4 mBackgroundColor; ///< Color of text background
Size mControlSize; ///< The size of the UI control.
Vector2 mShadowOffset; ///< Offset for drop shadow, 0 indicates no shadow
float mUnderlineHeight; ///< Fixed height for underline to override font metrics.
bool mUnderlineEnabled:1; ///< Underline enabled flag
bool mUnderlineColorSet:1; ///< Has the underline color been explicitly set?
+ bool mBackgroundEnabled:1; ///< Background enabled flag
};
} // namespace Text
void AnimatedImageVisual::InitializeGif( const VisualUrl& imageUrl )
{
mImageUrl = imageUrl;
- mGifLoading = GifLoading::New( imageUrl.GetUrl() );
+ mGifLoading = GifLoading::New( imageUrl.GetUrl(), imageUrl.IsLocalResource() );
mFrameCount = mGifLoading->GetImageCount();
mGifLoading->LoadFrameDelays( mFrameDelayContainer );
}
}
case Toolkit::ImageVisual::Property::WRAP_MODE_U:
{
- int wrapMode;
+ int wrapMode = 0;
if(Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode ))
{
mWrapModeU = Dali::WrapMode::Type(wrapMode);
}
case Toolkit::ImageVisual::Property::WRAP_MODE_V:
{
- int wrapMode;
+ int wrapMode = 0;
if(Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode ))
{
mWrapModeV = Dali::WrapMode::Type(wrapMode);
FixedImageCache::~FixedImageCache()
{
- for( std::size_t i = 0; i < mImageUrls.size() ; ++i )
+ if( mTextureManagerAlive )
{
- mTextureManager.Remove( mImageUrls[i].mTextureId );
+ for( std::size_t i = 0; i < mImageUrls.size() ; ++i )
+ {
+ mTextureManager.Remove( mImageUrls[i].mTextureId );
+ }
}
}
mBatchSize( batchSize ),
mUrlIndex(0u),
mWaitingForReadyFrame(false),
- mRequestingLoad(false)
+ mRequestingLoad(false),
+ mTextureManagerAlive(true)
{
+ mTextureManager.AddObserver( *this );
}
ImageCache::~ImageCache()
{
+ if( mTextureManagerAlive )
+ {
+ mTextureManager.RemoveObserver( *this );
+ }
+}
+
+void ImageCache::TextureManagerDestroyed()
+{
+ mTextureManagerAlive = false;
}
} //namespace Internal
namespace Internal
{
-class ImageCache
+class ImageCache : public TextureManager::LifecycleObserver
{
public:
/**
*/
virtual TextureSet NextFrame() = 0;
+private:
+ /**
+ * Called before the texture manager is destroyed.
+ */
+ virtual void TextureManagerDestroyed() override final;
+
protected:
TextureManager& mTextureManager;
FrameReadyObserver& mObserver;
unsigned int mUrlIndex;
bool mWaitingForReadyFrame:1;
bool mRequestingLoad:1;
+ bool mTextureManagerAlive:1;
};
} //namespace Internal
RollingGifImageCache::~RollingGifImageCache()
{
- while( !mQueue.IsEmpty() )
+ if( mTextureManagerAlive )
{
- ImageFrame imageFrame = mQueue.PopFront();
- Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
+ while( !mQueue.IsEmpty() )
+ {
+ ImageFrame imageFrame = mQueue.PopFront();
+ Dali::Toolkit::TextureManager::RemoveTexture( mImageUrls[ imageFrame.mFrameNumber ].mUrl );
+ }
}
}
+
TextureSet RollingGifImageCache::FirstFrame()
{
return GetFrontTextureSet();
RollingImageCache::~RollingImageCache()
{
- while( !mQueue.IsEmpty() )
+ if( mTextureManagerAlive )
{
- ImageFrame imageFrame = mQueue.PopFront();
- mTextureManager.Remove( mImageUrls[ imageFrame.mUrlIndex ].mTextureId );
+ while( !mQueue.IsEmpty() )
+ {
+ ImageFrame imageFrame = mQueue.PopFront();
+ mTextureManager.Remove( mImageUrls[ imageFrame.mUrlIndex ].mTextureId );
+ }
}
}
uniform lowp vec4 uColor;\n
uniform lowp vec4 borderColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
\n
void main()\n
{\n
- gl_FragColor = vec4(mixColor, opacity)*borderColor*uColor;\n
+ gl_FragColor = vec4(mixColor, 1.0)*borderColor*uColor;\n
}\n
);
uniform lowp vec4 uColor;\n
uniform lowp vec4 borderColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform mediump float borderSize;\n
varying mediump float vAlpha;\n
\n
void main()\n
{\n
- gl_FragColor = vec4(mixColor, opacity)*borderColor*uColor;\n
+ gl_FragColor = vec4(mixColor, 1.0)*borderColor*uColor;\n
gl_FragColor.a *= smoothstep(0.0, 1.5, vAlpha)*smoothstep( borderSize+1.5, borderSize, vAlpha );\n
}\n
);
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
\n
void main()\n
{\n
- gl_FragColor = vec4(mixColor, opacity)*uColor;\n
+ gl_FragColor = vec4(mixColor, 1.0)*uColor;\n
}\n
);
}
uniform sampler2D sTexture;\n // sampler1D?
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
varying mediump vec2 vTexCoord;\n
\n
void main()\n
{\n
- gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor*opacity, opacity) * uColor;\n
+ gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor, 1.0) * uColor;\n
}\n
),
uniform sampler2D sTexture;\n // sampler1D?
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
varying mediump vec2 vTexCoord;\n
\n
void main()\n
{\n
- gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor*opacity, opacity) * uColor;\n
+ gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor, 1.0) * uColor;\n
}\n
)
};
uniform sampler2D sTexture;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
void main()\n
{\n
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * visualMixColor();\n
+ gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
uniform mediump vec4 uAtlasRect;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- gl_FragColor = texture2D( sTexture, texCoord ) * uColor * visualMixColor();\n
+ gl_FragColor = texture2D( sTexture, texCoord ) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
uniform lowp vec2 wrapMode;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
mediump float wrapCoordinate( mediump vec2 range, mediump float coordinate, lowp float wrap )\n
return clamp( mix(range.x, range.y, coord), range.x, range.y );
}\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
mediump vec2 texCoord = vec2( wrapCoordinate( uAtlasRect.xz, vTexCoord.x, wrapMode.x ),
wrapCoordinate( uAtlasRect.yw, vTexCoord.y, wrapMode.y ) );\n
- gl_FragColor = texture2D( sTexture, texCoord ) * uColor * visualMixColor();\n
+ gl_FragColor = texture2D( sTexture, texCoord ) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
ImageDimensions size,
FittingMode::Type fittingMode,
Dali::SamplingMode::Type samplingMode )
-: Visual::Base( factoryCache, Visual::FittingMode::FIT_KEEP_ASPECT_RATIO ),
+: Visual::Base( factoryCache, Visual::FittingMode::FILL ),
mImage(),
mPixelArea( FULL_TEXTURE_RECT ),
mPlacementActor(),
{
case Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING:
{
- bool sync;
+ bool sync = false;
if( value.Get( sync ) )
{
if( sync )
case Toolkit::ImageVisual::Property::DESIRED_WIDTH:
{
- float desiredWidth;
+ float desiredWidth = 0.0f;
if( value.Get( desiredWidth ) )
{
mDesiredSize.SetWidth( desiredWidth );
case Toolkit::ImageVisual::Property::DESIRED_HEIGHT:
{
- float desiredHeight;
+ float desiredHeight = 0.0f;
if( value.Get( desiredHeight ) )
{
mDesiredSize.SetHeight( desiredHeight );
case Toolkit::ImageVisual::Property::FITTING_MODE:
{
- int fittingMode;
+ int fittingMode = 0;
Scripting::GetEnumerationProperty( value, FITTING_MODE_TABLE, FITTING_MODE_TABLE_COUNT, fittingMode );
mFittingMode = Dali::FittingMode::Type( fittingMode );
break;
case Toolkit::ImageVisual::Property::SAMPLING_MODE:
{
- int samplingMode;
+ int samplingMode = 0;
Scripting::GetEnumerationProperty( value, SAMPLING_MODE_TABLE, SAMPLING_MODE_TABLE_COUNT, samplingMode );
mSamplingMode = Dali::SamplingMode::Type( samplingMode );
break;
case Toolkit::ImageVisual::Property::WRAP_MODE_U:
{
- int wrapMode;
+ int wrapMode = 0;
Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode );
mWrapModeU = Dali::WrapMode::Type( wrapMode );
break;
case Toolkit::ImageVisual::Property::WRAP_MODE_V:
{
- int wrapMode;
+ int wrapMode = 0;
Scripting::GetEnumerationProperty( value, WRAP_MODE_TABLE, WRAP_MODE_TABLE_COUNT, wrapMode );
mWrapModeV = Dali::WrapMode::Type( wrapMode );
break;
case Toolkit::ImageVisual::Property::ALPHA_MASK_URL:
{
- std::string alphaUrl;
+ std::string alphaUrl = "";
if( value.Get( alphaUrl ) )
{
AllocateMaskData();
case Toolkit::ImageVisual::Property::MASK_CONTENT_SCALE:
{
- float scale;
+ float scale = 1.0f;
if( value.Get( scale ) )
{
AllocateMaskData();
case Toolkit::ImageVisual::Property::RELEASE_POLICY:
{
- int releasePolicy;
+ int releasePolicy = 0;
Scripting::GetEnumerationProperty( value, RELEASE_POLICY_TABLE, RELEASE_POLICY_TABLE_COUNT, releasePolicy );
mReleasePolicy = Toolkit::ImageVisual::ReleasePolicy::Type( releasePolicy );
break;
case Toolkit::ImageVisual::Property::LOAD_POLICY:
{
- int loadPolicy;
+ int loadPolicy = 0;
Scripting::GetEnumerationProperty( value, LOAD_POLICY_TABLE, LOAD_POLICY_TABLE_COUNT, loadPolicy );
mLoadPolicy = Toolkit::ImageVisual::LoadPolicy::Type( loadPolicy );
break;
varying mediump vec3 vIllumination;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
void main()\n
{\n
- gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a ) * visualMixColor();\n
+ gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a ) * vec4( mixColor, 1.0 );\n
}\n
);
uniform sampler2D sDiffuse;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
void main()\n
{\n
vec4 texture = texture2D( sDiffuse, vTexCoord );\n
- vec4 visualMixColor = visualMixColor();\n
+ vec4 visualMixColor = vec4( mixColor, 1.0 );\n
gl_FragColor = vec4( vIllumination.rgb * texture.rgb * uColor.rgb * visualMixColor.rgb + vSpecular * 0.3, texture.a * uColor.a * visualMixColor.a );\n
}\n
);
uniform sampler2D sGloss;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
void main()\n
{\n
vec4 texture = texture2D( sDiffuse, vTexCoord );\n
vec3 normal = normalize( texture2D( sNormal, vTexCoord ).xyz * 2.0 - 1.0 );\n
vec4 glossMap = texture2D( sGloss, vTexCoord );\n
- vec4 visualMixColor = visualMixColor();\n
+ vec4 visualMixColor = vec4( mixColor, 1.0 );\n
float lightDiffuse = max( 0.0, dot( normal, normalize( vLightDirection ) ) );\n
lightDiffuse = lightDiffuse * 0.5 + 0.5;\n
uniform sampler2D sTexture;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
+ \n
void main()\n
{\n
- gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * visualMixColor();\n
+ gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
uniform sampler2D sMask;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
uniform mediump float auxiliaryImageAlpha;\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
+ \n
void main()\n
{\n
// Where mask image is transparent, all of background image must show through.
mediump vec3 mixedColor = color.rgb * mix( 1.0-mask.a, 1.0, 1.0-auxiliaryImageAlpha)
+ mask.rgb*mask.a * auxiliaryImageAlpha;\n
- gl_FragColor = vec4(mixedColor,1.0) * uColor * visualMixColor();\n
+ gl_FragColor = vec4(mixedColor,1.0) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
// shapes
DALI_ENUM_TO_STRING_TABLE_BEGIN( SHAPE_TYPE )
DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, SPHERE )
-DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONICAL_FRUSTRUM )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONICAL_FRUSTRUM ) // deprecated
DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONE )
DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CYLINDER )
DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CUBE )
DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, OCTAHEDRON )
DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, BEVELLED_CUBE )
+DALI_ENUM_TO_STRING_WITH_SCOPE( Toolkit::PrimitiveVisual::Shape, CONICAL_FRUSTUM )
DALI_ENUM_TO_STRING_TABLE_END( SHAPE_TYPE )
//Property names
//Primitive property defaults
const int DEFAULT_SLICES = 128; ///< For spheres and conics
const int DEFAULT_STACKS = 128; ///< For spheres and conics
-const float DEFAULT_SCALE_TOP_RADIUS = 1.0; ///< For conical frustrums
-const float DEFAULT_SCALE_BOTTOM_RADIUS = 1.5; ///< For cones and conical frustrums
+const float DEFAULT_SCALE_TOP_RADIUS = 1.0; ///< For conical frustums
+const float DEFAULT_SCALE_BOTTOM_RADIUS = 1.5; ///< For cones and conical frustums
const float DEFAULT_SCALE_HEIGHT = 3.0; ///< For all conics
const float DEFAULT_SCALE_RADIUS = 1.0; ///< For cylinders
const float DEFAULT_BEVEL_PERCENTAGE = 0.0; ///< For bevelled cubes
//Specific shape labels.
const char * const SPHERE_LABEL( "SPHERE" );
const char * const CONE_LABEL( "CONE" );
-const char * const CONICAL_FRUSTRUM_LABEL( "CONICAL_FRUSTRUM" );
+const char * const CONICAL_FRUSTRUM_LABEL( "CONICAL_FRUSTRUM" ); // deprecated
const char * const CYLINDER_LABEL( "CYLINDER" );
const char * const CUBE_LABEL( "CUBE" );
const char * const OCTAHEDRON_LABEL( "OCTAHEDRON" );
const char * const BEVELLED_CUBE_LABEL( "BEVELLED_CUBE" );
+const char * const CONICAL_FRUSTUM_LABEL( "CONICAL_FRUSTUM" );
//Shader properties
const char * const OBJECT_MATRIX_UNIFORM_NAME( "uObjectMatrix" );
varying mediump vec3 vIllumination;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
void main()\n
{\n
- vec4 baseColor = vec4(mixColor, opacity) * uColor;\n
+ vec4 baseColor = vec4(mixColor, 1.0) * uColor;\n
gl_FragColor = vec4( vIllumination.rgb * baseColor.rgb, baseColor.a );\n
}\n
);
CreateConic( vertices, indices, 0, mScaleBottomRadius, mScaleHeight, mSlices );
break;
}
- case Toolkit::PrimitiveVisual::Shape::CONICAL_FRUSTRUM:
+ case Toolkit::PrimitiveVisual::Shape::CONICAL_FRUSTRUM: // deprecated
{
CreateConic( vertices, indices, mScaleTopRadius, mScaleBottomRadius, mScaleHeight, mSlices );
break;
CreateBevelledCube( vertices, indices, mScaleDimensions, mBevelPercentage, mBevelSmoothness );
break;
}
+ case Toolkit::PrimitiveVisual::Shape::CONICAL_FRUSTUM:
+ {
+ CreateConic( vertices, indices, mScaleTopRadius, mScaleBottomRadius, mScaleHeight, mSlices );
+ break;
+ }
}
mGeometry = Geometry::New();
* | %Property Name | Type | Shapes Affected |
* |-------------------|-------------|------------------------------------------|
* | shapeColor | VECTOR4 | all |
- * | slices | INTEGER | sphere, cone, conical frustrum, cylinder |
+ * | slices | INTEGER | sphere, cone, conical frustum, cylinder |
* | stacks | INTEGER | sphere |
- * | scaleTopRadius | FLOAT | conical frustrum |
- * | scaleBottomRadius | FLOAT | cone, conical frustrum |
- * | scaleHeight | FLOAT | cone, conical frustrum, cylinder |
+ * | scaleTopRadius | FLOAT | conical frustum |
+ * | scaleBottomRadius | FLOAT | cone, conical frustum |
+ * | scaleHeight | FLOAT | cone, conical frustum, cylinder |
* | scaleRadius | FLOAT | cylinder |
* | scaleDimensions | VECTOR3 | cube, octahedron, bevelled cube |
* | bevelPercentage | FLOAT | bevelled cube |
// EXTERNAL INCLUDES
#include <dali/public-api/animation/constraints.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/devel-api/text-abstraction/text-abstraction-definitions.h>
// INTERNAL HEADER
const char * const SHADOW_PROPERTY( "shadow" );
const char * const UNDERLINE_PROPERTY( "underline" );
const char * const OUTLINE_PROPERTY( "outline" );
+const char * const BACKGROUND_PROPERTY( "textBackground" );
const Vector4 FULL_TEXTURE_RECT( 0.f, 0.f, 1.f, 1.f );
varying mediump vec2 vTexCoord;\n
uniform sampler2D sTexture;\n
uniform lowp vec4 uTextColorAnimatable;\n
- uniform mediump vec4 uAtlasRect;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
- mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- mediump float textTexture = texture2D( sTexture, texCoord ).r;\n
+ mediump float textTexture = texture2D( sTexture, vTexCoord ).r;\n
// Set the color of the text to what it is animated to.
- gl_FragColor = uTextColorAnimatable * textTexture * uColor * visualMixColor();
+ gl_FragColor = uTextColorAnimatable * textTexture * uColor * vec4( mixColor, 1.0 );
}\n
);
const char* FRAGMENT_SHADER_MULTI_COLOR_TEXT = DALI_COMPOSE_SHADER(
varying mediump vec2 vTexCoord;\n
uniform sampler2D sTexture;\n
- uniform mediump vec4 uAtlasRect;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
- mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- mediump vec4 textTexture = texture2D( sTexture, texCoord );\n
+ mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
textTexture.rgb *= mix( 1.0, textTexture.a, preMultipliedAlpha );\n
- gl_FragColor = textTexture * uColor * visualMixColor();
+ gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 );
}\n
);
uniform sampler2D sTexture;\n
uniform sampler2D sStyle;\n
uniform lowp vec4 uTextColorAnimatable;\n
- uniform mediump vec4 uAtlasRect;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
- mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- mediump float textTexture = texture2D( sTexture, texCoord ).r;\n
- mediump vec4 styleTexture = texture2D( sStyle, texCoord );\n
+ mediump float textTexture = texture2D( sTexture, vTexCoord ).r;\n
+ mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );\n
// Draw the text as overlay above the style
- gl_FragColor = ( uTextColorAnimatable * textTexture + styleTexture * ( 1.0 - textTexture ) ) * uColor * visualMixColor();\n
+ gl_FragColor = ( uTextColorAnimatable * textTexture + styleTexture * ( 1.0 - uTextColorAnimatable.a * textTexture ) ) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
varying mediump vec2 vTexCoord;\n
uniform sampler2D sTexture;\n
uniform sampler2D sStyle;\n
- uniform mediump vec4 uAtlasRect;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
- mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- mediump vec4 textTexture = texture2D( sTexture, texCoord );\n
- mediump vec4 styleTexture = texture2D( sStyle, texCoord );\n
+ mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
+ mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );\n
textTexture.rgb *= mix( 1.0, textTexture.a, preMultipliedAlpha );\n
// Draw the text as overlay above the style
- gl_FragColor = ( textTexture + styleTexture * ( 1.0 - textTexture.a ) ) * uColor * visualMixColor();\n
+ gl_FragColor = ( textTexture + styleTexture * ( 1.0 - textTexture.a ) ) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
uniform sampler2D sTexture;\n
uniform sampler2D sMask;\n
uniform lowp vec4 uTextColorAnimatable;\n
- uniform mediump vec4 uAtlasRect;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
- mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- mediump vec4 textTexture = texture2D( sTexture, texCoord );\n
- mediump float maskTexture = texture2D( sMask, texCoord ).r;\n
+ mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
+ mediump float maskTexture = texture2D( sMask, vTexCoord ).r;\n
// Set the color of non-transparent pixel in text to what it is animated to.
// Markup text with multiple text colors are not animated (but can be supported later on if required).
textTexture.rgb = mix( textTexture.rgb, uTextColorAnimatable.rgb, vstep * maskTexture ) * mix( 1.0, textTexture.a, preMultipliedAlpha );\n
// Draw the text as overlay above the style
- gl_FragColor = textTexture * uColor * visualMixColor();\n
+ gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 );\n
}\n
);
uniform sampler2D sMask;\n
uniform lowp float uHasMultipleTextColors;\n
uniform lowp vec4 uTextColorAnimatable;\n
- uniform mediump vec4 uAtlasRect;\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
uniform lowp float preMultipliedAlpha;\n
\n
- lowp vec4 visualMixColor()\n
- {\n
- return vec4( mixColor * mix( 1.0, opacity, preMultipliedAlpha ), opacity );\n
- }\n
- \n
void main()\n
{\n
- mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );\n
- mediump vec4 textTexture = texture2D( sTexture, texCoord );\n
- mediump vec4 styleTexture = texture2D( sStyle, texCoord );\n
- mediump float maskTexture = texture2D( sMask, texCoord ).r;\n
+ mediump vec4 textTexture = texture2D( sTexture, vTexCoord );\n
+ mediump vec4 styleTexture = texture2D( sStyle, vTexCoord );\n
+ mediump float maskTexture = texture2D( sMask, vTexCoord ).r;\n
// Set the color of non-transparent pixel in text to what it is animated to.
// Markup text with multiple text colors are not animated (but can be supported later on if required).
textTexture.rgb = mix( textTexture.rgb, uTextColorAnimatable.rgb, vstep * maskTexture * ( 1.0 - uHasMultipleTextColors ) ) * mix( 1.0, textTexture.a, preMultipliedAlpha );\n
// Draw the text as overlay above the style
- gl_FragColor = ( textTexture + styleTexture * ( 1.0 - textTexture.a ) ) * uColor * visualMixColor();\n
+ gl_FragColor = ( textTexture + styleTexture * ( 1.0 - textTexture.a ) ) * uColor * vec4( mixColor, 1.0 );\n
}\n
);
{
result = Toolkit::DevelTextVisual::Property::OUTLINE;
}
+ else if( stringKey == BACKGROUND_PROPERTY )
+ {
+ result = Toolkit::DevelTextVisual::Property::BACKGROUND;
+ }
return result;
}
+void TextColorConstraint( Vector4& current, const PropertyInputContainer& inputs )
+{
+ Vector4 color = inputs[0]->GetVector4();
+ current.r = color.r * color.a;
+ current.g = color.g * color.a;
+ current.b = color.b * color.a;
+ current.a = color.a;
+}
+
+void OpacityConstraint( float& current, const PropertyInputContainer& inputs )
+{
+ current = inputs[0]->GetVector4().a;
+}
+
} // unnamed namespace
TextVisualPtr TextVisual::New( VisualFactoryCache& factoryCache, const Property::Map& properties )
GetOutlineProperties( mController, value, Text::EffectStyle::DEFAULT );
map.Insert( Toolkit::DevelTextVisual::Property::OUTLINE, value );
+
+ GetBackgroundProperties( mController, value, Text::EffectStyle::DEFAULT );
+ map.Insert( Toolkit::DevelTextVisual::Property::BACKGROUND, value );
}
void TextVisual::DoCreateInstancePropertyMap( Property::Map& map ) const
// Create constraint for the animatable text's color Property with uTextColorAnimatable in the renderer.
if( shaderTextColorIndex != Property::INVALID_INDEX )
{
- Constraint constraint = Constraint::New<Vector4>( mImpl->mRenderer, shaderTextColorIndex, EqualToConstraint() );
- constraint.AddSource( Source( actor, mAnimatableTextColorPropertyIndex ) );
- constraint.Apply();
+ Constraint colorConstraint = Constraint::New<Vector4>( mImpl->mRenderer, shaderTextColorIndex, TextColorConstraint );
+ colorConstraint.AddSource( Source( actor, mAnimatableTextColorPropertyIndex ) );
+ colorConstraint.Apply();
+
+ Constraint opacityConstraint = Constraint::New< float >( mImpl->mRenderer, Dali::DevelRenderer::Property::OPACITY, OpacityConstraint );
+ opacityConstraint.AddSource( Source( actor, mAnimatableTextColorPropertyIndex ) );
+ opacityConstraint.Apply();
}
}
SetOutlineProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
break;
}
+ case Toolkit::DevelTextVisual::Property::BACKGROUND:
+ {
+ SetBackgroundProperties( mController, propertyValue, Text::EffectStyle::DEFAULT );
+ break;
+ }
}
}
const Vector4* const colorsBuffer = mController->GetTextModel()->GetColors();
bool hasMultipleTextColors = ( NULL != colorsBuffer );
- // Check whether the text contains any emoji
- bool containsEmoji = false;
+ // Check whether the text contains any color glyph
+ bool containsColorGlyph = false;
- Text::ScriptRunIndex numberOfScripts = mController->GetTextModel()->GetNumberOfScripts();
- const Text::ScriptRun* scripts = mController->GetTextModel()->GetScriptRuns();
- for ( Text::ScriptRunIndex scriptIndex = 0u; scriptIndex < numberOfScripts; scriptIndex++ )
+ TextAbstraction::FontClient fontClient = TextAbstraction::FontClient::Get();
+ const Text::GlyphInfo* const glyphsBuffer = mController->GetTextModel()->GetGlyphs();
+ const Text::Length numberOfGlyphs = mController->GetTextModel()->GetNumberOfGlyphs();
+ for ( Text::Length glyphIndex = 0; glyphIndex < numberOfGlyphs; glyphIndex++ )
{
- const Text::ScriptRun& scriptRun = *( scripts + scriptIndex );
- if( TextAbstraction::EMOJI == scriptRun.script )
+ // Retrieve the glyph's info.
+ const Text::GlyphInfo* const glyphInfo = glyphsBuffer + glyphIndex;
+
+ // Whether the current glyph is a color one.
+ if( fontClient.IsColorGlyph( glyphInfo->fontId, glyphInfo->index ) )
{
- containsEmoji = true;
+ containsColorGlyph = true;
break;
}
}
const bool underlineEnabled = mController->GetTextModel()->IsUnderlineEnabled();
const bool outlineEnabled = ( mController->GetTextModel()->GetOutlineWidth() > Math::MACHINE_EPSILON_1 );
+ const bool backgroundEnabled = mController->GetTextModel()->IsBackgroundEnabled();;
- const bool styleEnabled = ( shadowEnabled || underlineEnabled || outlineEnabled );
+ const bool styleEnabled = ( shadowEnabled || underlineEnabled || outlineEnabled || backgroundEnabled );
- TextureSet textureSet = GetTextTexture( relayoutSize, hasMultipleTextColors, containsEmoji, styleEnabled );
+ TextureSet textureSet = GetTextTexture( relayoutSize, hasMultipleTextColors, containsColorGlyph, styleEnabled );
mImpl->mRenderer.SetTextures( textureSet );
- Shader shader = GetTextShader( mFactoryCache, hasMultipleTextColors, containsEmoji, styleEnabled );
+ Shader shader = GetTextShader( mFactoryCache, hasMultipleTextColors, containsColorGlyph, styleEnabled );
mImpl->mRenderer.SetShader(shader);
mImpl->mFlags &= ~Impl::IS_ATLASING_APPLIED;
- Vector4 atlasRect = FULL_TEXTURE_RECT;
- mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, atlasRect );
mImpl->mRenderer.RegisterProperty( "uHasMultipleTextColors", static_cast<float>( hasMultipleTextColors ) );
mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON);
}
}
-TextureSet TextVisual::GetTextTexture( const Vector2& size, bool hasMultipleTextColors, bool containsEmoji, bool styleEnabled )
+TextureSet TextVisual::GetTextTexture( const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled )
{
// Filter mode needs to be set to linear to produce better quality while scaling.
Sampler sampler = Sampler::New();
TextureSet textureSet = TextureSet::New();
// Create RGBA texture if the text contains emojis or multiple text colors, otherwise L8 texture
- Pixel::Format textPixelFormat = ( containsEmoji || hasMultipleTextColors ) ? Pixel::RGBA8888 : Pixel::L8;
+ Pixel::Format textPixelFormat = ( containsColorGlyph || hasMultipleTextColors ) ? Pixel::RGBA8888 : Pixel::L8;
// Check the text direction
Toolkit::DevelText::TextDirection::Type textDirection = mController->GetTextDirection();
textureSet.SetSampler( 1u, sampler );
}
- if ( containsEmoji && !hasMultipleTextColors )
+ if ( containsColorGlyph && !hasMultipleTextColors )
{
// Create a L8 texture as a mask to avoid color glyphs (e.g. emojis) to be affected by text color animation
PixelData maskData = mTypesetter->Render( size, textDirection, Text::Typesetter::RENDER_MASK, false, Pixel::L8 );
return textureSet;
}
-Shader TextVisual::GetTextShader( VisualFactoryCache& factoryCache, bool hasMultipleTextColors, bool containsEmoji, bool styleEnabled )
+Shader TextVisual::GetTextShader( VisualFactoryCache& factoryCache, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled )
{
Shader shader;
factoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER_MULTI_COLOR_TEXT_WITH_STYLE, shader );
}
}
- else if( !hasMultipleTextColors && !containsEmoji && !styleEnabled )
+ else if( !hasMultipleTextColors && !containsColorGlyph && !styleEnabled )
{
shader = factoryCache.GetShader( VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT );
if( !shader )
factoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT, shader );
}
}
- else if( !hasMultipleTextColors && !containsEmoji && styleEnabled )
+ else if( !hasMultipleTextColors && !containsColorGlyph && styleEnabled )
{
shader = factoryCache.GetShader( VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE );
if( !shader )
factoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE, shader );
}
}
- else if( !hasMultipleTextColors && containsEmoji && !styleEnabled )
+ else if( !hasMultipleTextColors && containsColorGlyph && !styleEnabled )
{
shader = factoryCache.GetShader( VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_EMOJI );
if( !shader )
factoryCache.SaveShader( VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_EMOJI, shader );
}
}
- else // if( !hasMultipleTextColors && containsEmoji && styleEnabled )
+ else // if( !hasMultipleTextColors && containsColorGlyph && styleEnabled )
{
shader = factoryCache.GetShader( VisualFactoryCache::TEXT_SHADER_SINGLE_COLOR_TEXT_WITH_STYLE_AND_EMOJI );
if( !shader )
* Get the texture of the text for rendering.
* @param[in] size The texture size.
* @param[in] hasMultipleTextColors Whether the text contains multiple colors.
- * @param[in] containsEmoji Whether the text contains emoji.
+ * @param[in] containsColorGlyph Whether the text contains color glyph.
* @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.).
*/
- TextureSet GetTextTexture( const Vector2& size, bool hasMultipleTextColors, bool containsEmoji, bool styleEnabled );
+ TextureSet GetTextTexture( const Vector2& size, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled );
/**
* Get the text rendering shader.
* @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
* @param[in] hasMultipleTextColors Whether the text contains multiple colors.
- * @param[in] containsEmoji Whether the text contains emoji.
+ * @param[in] containsColorGlyph Whether the text contains color glyph.
* @param[in] styleEnabled Whether the text contains any styles (e.g. shadow, underline, etc.).
*/
- Shader GetTextShader( VisualFactoryCache& factoryCache, bool hasMultipleTextColors, bool containsEmoji, bool styleEnabled );
+ Shader GetTextShader( VisualFactoryCache& factoryCache, bool hasMultipleTextColors, bool containsColorGlyph, bool styleEnabled );
/**
* @brief Retrieve the text's controller.
{
}
+TextureManager::~TextureManager()
+{
+ for( auto iter = mLifecycleObservers.Begin(), endIter = mLifecycleObservers.End(); iter != endIter; ++iter)
+ {
+ (*iter)->TextureManagerDestroyed();
+ }
+}
+
TextureSet TextureManager::LoadTexture(
const VisualUrl& url, Dali::ImageDimensions desiredSize, Dali::FittingMode::Type fittingMode,
Dali::SamplingMode::Type samplingMode, const MaskingDataPointer& maskInfo,
}
}
-const VisualUrl& TextureManager::GetVisualUrl( TextureId textureId )
+VisualUrl TextureManager::GetVisualUrl( TextureId textureId )
{
+ VisualUrl visualUrl("");
int cacheIndex = GetCacheIndexFromId( textureId );
- DALI_ASSERT_DEBUG( cacheIndex != INVALID_CACHE_INDEX && "TextureId out of range");
- TextureInfo& cachedTextureInfo( mTextureInfoContainer[ cacheIndex ] );
- return cachedTextureInfo.url;
+ if( cacheIndex != INVALID_CACHE_INDEX )
+ {
+ DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::GetVisualUrl. Using cached texture id=%d, textureId=%d\n",
+ cacheIndex, textureId );
+
+ TextureInfo& cachedTextureInfo( mTextureInfoContainer[ cacheIndex ] );
+ visualUrl = cachedTextureInfo.url;
+ }
+ return visualUrl;
}
TextureManager::LoadState TextureManager::GetTextureState( TextureId textureId )
return TextureSet();
}
+
+void TextureManager::AddObserver( TextureManager::LifecycleObserver& observer )
+{
+ // make sure an observer doesn't observe the same object twice
+ // otherwise it will get multiple calls to ObjectDestroyed()
+ DALI_ASSERT_DEBUG( mLifecycleObservers.End() == std::find( mLifecycleObservers.Begin(), mLifecycleObservers.End(), &observer));
+ mLifecycleObservers.PushBack( &observer );
+}
+
+void TextureManager::RemoveObserver( TextureManager::LifecycleObserver& observer)
+{
+ // Find the observer...
+ auto endIter = mLifecycleObservers.End();
+ for( auto iter = mLifecycleObservers.Begin(); iter != endIter; ++iter)
+ {
+ if( (*iter) == &observer)
+ {
+ mLifecycleObservers.Erase( iter );
+ break;
+ }
+ }
+ DALI_ASSERT_DEBUG(endIter != mLifecycleObservers.End());
+}
+
+
bool TextureManager::LoadTexture( TextureInfo& textureInfo )
{
bool success = true;
float contentScale, bool cropToMask )
{
int maskCacheIndex = GetCacheIndexFromId( maskTextureId );
- Devel::PixelBuffer maskPixelBuffer = mTextureInfoContainer[maskCacheIndex].pixelBuffer;
- pixelBuffer.ApplyMask( maskPixelBuffer, contentScale, cropToMask );
+ if( maskCacheIndex != INVALID_CACHE_INDEX )
+ {
+ Devel::PixelBuffer maskPixelBuffer = mTextureInfoContainer[maskCacheIndex].pixelBuffer;
+ pixelBuffer.ApplyMask( maskPixelBuffer, contentScale, cropToMask );
+ }
}
};
using MaskingDataPointer = std::unique_ptr<MaskingData>;
+
+ /**
+ * Class to provide lifecycle event on destruction of texture manager.
+ */
+ struct LifecycleObserver
+ {
+ /**
+ * Called shortly before the texture manager is destroyed.
+ */
+ virtual void TextureManagerDestroyed() = 0;
+ };
+
/**
* Constructor.
*/
/**
* Destructor.
*/
- ~TextureManager() = default;
-
+ ~TextureManager();
// TextureManager Main API:
void Remove( const TextureManager::TextureId textureId );
/**
- * Get the visualUrl associated with the texture id
+ * @brief Get the visualUrl associated with the texture id.
+ * @param[in] textureId The texture Id to get
+ * @return The visual Url associated with the texture id.
*/
- const VisualUrl& GetVisualUrl( TextureId textureId );
+ VisualUrl GetVisualUrl( TextureId textureId );
/**
* @brief Get the current state of a texture
*/
TextureSet RemoveExternalTexture( const std::string& url );
+ /**
+ * Add an observer to the object.
+ * @param[in] observer The observer to add.
+ */
+ void AddObserver( TextureManager::LifecycleObserver& observer );
+
+ /**
+ * Remove an observer from the object
+ * @pre The observer has already been added.
+ * @param[in] observer The observer to remove.
+ */
+ void RemoveObserver( TextureManager::LifecycleObserver& observer );
+
private:
/**
RoundRobinContainerView< AsyncLoadingHelper > mAsyncLocalLoaders; ///< The Asynchronous image loaders used to provide all local async loads
RoundRobinContainerView< AsyncLoadingHelper > mAsyncRemoteLoaders; ///< The Asynchronous image loaders used to provide all remote async loads
std::vector< ExternalTextureInfo > mExternalTextures; ///< Externally provided textures
+ Dali::Vector<LifecycleObserver*> mLifecycleObservers; ///< Lifecycle observers of texture manager
TextureId mCurrentTextureId; ///< The current value used for the unique Texture Id generation
};
mControlSize( Vector2::ZERO ),
mDepthIndex( 0.0f ),
mMixColorIndex( Property::INVALID_INDEX ),
- mOpacityIndex( Property::INVALID_INDEX ),
mFittingMode( fittingMode ),
mFlags( 0 ),
mResourceStatus( Toolkit::Visual::ResourceStatus::PREPARING )
Size mControlSize;
int mDepthIndex;
Property::Index mMixColorIndex;
- Property::Index mOpacityIndex;
FittingMode mFittingMode; //< How the contents should fit the view
int mFlags;
Toolkit::Visual::ResourceStatus mResourceStatus;
#include <dali/public-api/common/dali-common.h>
#include <dali/devel-api/object/handle-devel.h>
#include <dali/devel-api/scripting/enum-helper.h>
+#include <dali/devel-api/rendering/renderer-devel.h>
#include <dali/integration-api/debug.h>
//INTERNAL HEARDER
{
DoSetOffStage( actor );
mImpl->mMixColorIndex = Property::INVALID_INDEX;
- mImpl->mOpacityIndex = Property::INVALID_INDEX;
mImpl->mFlags &= ~Impl::IS_ON_STAGE;
}
}
mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
}
- if( mImpl->mOpacityIndex == Property::INVALID_INDEX )
- {
- mImpl->mOpacityIndex = DevelHandle::RegisterProperty(
- mImpl->mRenderer,
- Toolkit::Visual::Property::OPACITY,
- OPACITY,
- mImpl->mMixColor.a );
- }
+ mImpl->mRenderer.SetProperty( DevelRenderer::Property::OPACITY, mImpl->mMixColor.a );
float preMultipliedAlpha = 0.0f;
if( IsPreMultipliedAlphaEnabled() )
if( mImpl->mRenderer )
{
mImpl->mRenderer.SetProperty( mImpl->mMixColorIndex, Vector3(color) );
- mImpl->mRenderer.SetProperty( mImpl->mOpacityIndex, color.a );
+ mImpl->mRenderer.SetProperty( DevelRenderer::Property::OPACITY, color.a );
if( color.a < 1.f )
{
mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
Dali::Animation& transition,
Internal::TransitionData::Animator& animator )
{
- Property::Index index = mImpl->mOpacityIndex;
-
bool isOpaque = mImpl->mMixColor.a >= 1.0f;
- if( index != Property::INVALID_INDEX )
+ float initialOpacity;
+ if( animator.initialValue.Get( initialOpacity ) )
{
- float initialOpacity;
- if( animator.initialValue.Get( initialOpacity ) )
- {
- isOpaque = (initialOpacity >= 1.0f);
- }
-
- float targetOpacity;
- if( animator.targetValue.Get( targetOpacity ) )
- {
- mImpl->mMixColor.a = targetOpacity;
- }
+ isOpaque = (initialOpacity >= 1.0f);
+ }
- SetupTransition( transition, animator, index, animator.initialValue, animator.targetValue );
- SetupBlendMode( transition, isOpaque, animator.animate );
+ float targetOpacity;
+ if( animator.targetValue.Get( targetOpacity ) )
+ {
+ mImpl->mMixColor.a = targetOpacity;
}
+
+ SetupTransition( transition, animator, DevelRenderer::Property::OPACITY, animator.initialValue, animator.targetValue );
+ SetupBlendMode( transition, isOpaque, animator.animate );
}
void Visual::Base::AnimateRendererProperty(
SetupTransition( transition, animator, index, initialMixColor, targetMixColor );
if( animateOpacity )
{
- SetupTransition( transition, animator, mImpl->mOpacityIndex, initialOpacity, targetOpacity );
+ SetupTransition( transition, animator, DevelRenderer::Property::OPACITY, initialOpacity, targetOpacity );
SetupBlendMode( transition, isOpaque, animator.animate );
}
}
} // namespace
VisualFactory::VisualFactory( bool debugEnabled )
-: mDebugEnabled( debugEnabled ),
+: mFactoryCache(),
+ mDebugEnabled( debugEnabled ),
mPreMultiplyOnLoad( true )
{
}
const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(\n
uniform lowp vec4 uColor;\n
uniform lowp vec3 mixColor;\n
- uniform lowp float opacity;\n
\n
void main()\n
{\n
- gl_FragColor = uColor * vec4( mixColor, opacity );\n
+ gl_FragColor = uColor * vec4( mixColor, 1.0 );\n
}\n
);
/**
* @brief This is emitted when accessibility action is received to focus and read from the
- * first item on the top continously (by three fingers single tap).
+ * first item on the top continuously (by three fingers single tap).
*
* A callback of the following type may be connected:
* @code
/**
* @brief This is emitted when accessibility action is received to move the focus to and
- * read from the next item continously (by three fingers double tap).
+ * read from the next item continuously (by three fingers double tap).
*
* A callback of the following type may be connected:
* @code
{
// Event side child properties
FLEX = CHILD_PROPERTY_START_INDEX, ///< name "flex", The proportion of the free space in the container the flex item will receive. If all items in the container set this property, their sizes will be proportional to the specified flex factor, type FLOAT @SINCE_1_1.35
- ALIGN_SELF, ///< name "alignSelf", The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container, @see FlexContainer::Alignment, type INTEGER @SINCE_1_1.35
+ ALIGN_SELF, ///< name "alignSelf", The alignment of the flex item along the cross axis, which, if set, overrides the default alignment for all items in the container, @see FlexContainer::Alignment, type INTEGER @SINCE_1_1.35
FLEX_MARGIN ///< name "flexMargin", The space around the flex item, type VECTOR4 @SINCE_1_1.35
};
};
return videoView;
}
+VideoView VideoView::New( bool swCodec )
+{
+ VideoView videoView = Internal::VideoView::New();
+ Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
+ return videoView;
+}
+
+VideoView VideoView::New( const std::string& url, bool swCodec )
+{
+ VideoView videoView = Internal::VideoView::New();
+ Dali::Toolkit::GetImpl( videoView ).SetUrl( url );
+ Dali::Toolkit::GetImpl( videoView ).SetSWCodec( swCodec );
+ return videoView;
+}
+
VideoView VideoView::DownCast( BaseHandle handle )
{
return Control::DownCast< VideoView, Internal::VideoView >( handle );
/**
* @brief name "video", video file url as string type or Property::Map.
* @SINCE_1_1.38
+ * @REMARK_INTERNET
+ * @REMARK_STORAGE
*/
VIDEO = PROPERTY_START_INDEX,
* @SINCE_1_2.62
* @REMARK_RAWVIDEO
*/
- UNDERLAY
+ UNDERLAY,
+
+ /**
+ * @brief The play position (millisecond) of the video.
+ * @details Name "playPosition", type Property::INTEGER
+ * @SINCE_1_3_9
+ */
+ PLAY_POSITION,
+
+ /**
+ * @brief The display mode of the video.
+ * @SINCE_1_3_15
+ */
+ DISPLAY_MODE
+ };
+ };
+
+ /**
+ * @brief The values of this enum determine how the video should be display mode to the view
+ * @SINCE_1_3_15
+ */
+ struct DisplayMode
+ {
+ enum Type
+ {
+ /**
+ * @brief Letter box
+ * @SINCE_1_3_15
+ */
+ LETTER_BOX = 0,
+ /**
+ * @brief Origin size
+ * @SINCE_1_3_15
+ */
+ ORIGIN_SIZE,
+ /**
+ * @brief Full-screen
+ * @SINCE_1_3_15
+ */
+ FULL_SCREEN,
+ /**
+ * @brief Cropped full-screen
+ * @SINCE_1_3_15
+ */
+ CROPPED_FULL,
+ /**
+ * @brief Origin size (if surface size is larger than video size(width/height)) or Letter box (if video size(width/height) is larger than surface size)
+ * @SINCE_1_3_15
+ */
+ ORIGIN_OR_LETTER,
+ /**
+ * @brief Region of Interest
+ * @SINCE_1_3_15
+ */
+ DST_ROI
};
};
* @SINCE_1_1.38
* @return A handle to a newly allocated Dali ImageView
*
- * @note VideoView will not display anything
*/
static VideoView New();
static VideoView New( const std::string& url );
/**
+ * @brief Creates an initialized VideoView.
+ * @SINCE_1_3_9
+ * @param[in] swCodec Video rendering by H/W codec if false
+ * @return A handle to a newly allocated Dali ImageView
+ *
+ * @note If platform or target does not support sw codec, video-view shows an error message and video by default codec type
+ */
+ static VideoView New( bool swCodec );
+
+ /**
+ * @brief Creates an initialized VideoView.
+ * If the string is empty, VideoView will not display anything.
+ *
+ * @SINCE_1_3_9
+ * @REMARK_INTERNET
+ * @REMARK_STORAGE
+ * @param[in] url The url of the video resource to display
+ * @param[in] swCodec Video rendering by H/W codec if false
+ * @return A handle to a newly allocated Dali VideoView
+ *
+ * @note If platform or target does not support sw codec, video-view shows an error message and video by default codec type
+ */
+ static VideoView New( const std::string& url, bool swCodec );
+
+ /**
* @brief Creates an uninitialized VideoView.
* @SINCE_1_1.38
*/
const unsigned int TOOLKIT_MAJOR_VERSION = 1;
const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 9;
+const unsigned int TOOLKIT_MICRO_VERSION = 17;
const char * const TOOLKIT_BUILD_DATE = __DATE__ " " __TIME__;
#ifdef DEBUG_ENABLED
/**
* @brief The number of slices as you go around the shape.
* @details Name "slices", type Property::INTEGER.
- * For spheres and conical frustrums, this determines how many divisions there are as you go around the object.
+ * For spheres and conical frustums, this determines how many divisions there are as you go around the object.
* @SINCE_1_1.45
* @note Optional. If not specified, the default is 128.
* @note Applies to:
* - Shape::SPHERE
- * - Shape::CONICAL_FRUSTRUM
+ * - Shape::CONICAL_FRUSTUM
* - Shape::CONE
* - Shape::CYLINDER
* @note The range is from 1 to 255.
STACKS,
/**
- * @brief The scale of the radius of the top circle of a conical frustrum.
+ * @brief The scale of the radius of the top circle of a conical frustum.
* @details Name "scaleTopRadius", type Property::FLOAT.
* @SINCE_1_1.45
* @note Optional. If not specified, the default is 1.0f.
* @note Applies to:
- * - Shape::CONICAL_FRUSTRUM
+ * - Shape::CONICAL_FRUSTUM
* @note Only values greater than or equal to 0.0f are accepted.
*/
SCALE_TOP_RADIUS,
/**
- * @brief The scale of the radius of the bottom circle of a conical frustrum.
+ * @brief The scale of the radius of the bottom circle of a conical frustum.
* @details Name "scaleBottomRadius", type Property::FLOAT.
* @SINCE_1_1.45
* @note Optional. If not specified, the default is 1.5f.
* @note Applies to:
- * - Shape::CONICAL_FRUSTRUM
+ * - Shape::CONICAL_FRUSTUM
* - Shape::CONE
* @note Only values greater than or equal to 0.0f are accepted.
*/
* @SINCE_1_1.45
* @note Optional. If not specified, the default is 3.0f.
* @note Applies to:
- * - Shape::CONICAL_FRUSTRUM
+ * - Shape::CONICAL_FRUSTUM
* - Shape::CONE
* - Shape::CYLINDER
* @note Only values greater than or equal to 0.0f are accepted.
enum Type
{
SPHERE, ///< A perfectly round geometrical object in three-dimensional space. @SINCE_1_1.45
- CONICAL_FRUSTRUM, ///< The area bound between two circles, i.e. a cone with the tip removed. @SINCE_1_1.45
- CONE, ///< Equivalent to a conical frustrum with top radius of zero. @SINCE_1_1.45
- CYLINDER, ///< Equivalent to a conical frustrum with equal radii for the top and bottom circles. @SINCE_1_1.45
+ CONICAL_FRUSTRUM, ///< @DEPRECATED_1_3.15, use CONICAL_FRUSTUM instead. The area bound between two circles, i.e. a cone with the tip removed. @SINCE_1_1.45
+ CONE, ///< Equivalent to a conical frustum with top radius of zero. @SINCE_1_1.45
+ CYLINDER, ///< Equivalent to a conical frustum with equal radii for the top and bottom circles. @SINCE_1_1.45
CUBE, ///< Equivalent to a bevelled cube with a bevel percentage of zero. @SINCE_1_1.45
OCTAHEDRON, ///< Equivalent to a bevelled cube with a bevel percentage of one. @SINCE_1_1.45
BEVELLED_CUBE, ///< A cube/cuboid with all edges flattened to some degree. @SINCE_1_1.45
+ CONICAL_FRUSTUM ///< The area bound between two circles, i.e. a cone with the tip removed. @SINCE_1_3.15
};
}
NSVGimage* nsvgParseFromFile(const char* filename, const char* units, float dpi)
{
FILE* fp = NULL;
- size_t size;
+ size_t size = 0;
+ long value = 0;
char* data = NULL;
NSVGimage* image = NULL;
fp = fopen(filename, "rb");
if (!fp) goto error;
fseek(fp, 0, SEEK_END);
- size = ftell(fp);
+ value = ftell(fp);
+ /**
+ * In the original file, unsigned long type 'size' gets a return value. But, the return value of 'ftell()' is
+ * signed long type. To prevent interpreting an unexpected large value, we put the comparitive condition here.
+ */
+ if( value < 0 ) goto error;
+ size = value;
fseek(fp, 0, SEEK_SET);
data = (char*)malloc(size+1);
if (data == NULL) goto error;
* </tr>
* <tr>
* <td style="padding-left:1em">@ref dali_toolkit_controls_image_view</td>
- * <td>ImageView is a control displying an image.</td>
+ * <td>ImageView is a control displaying an image.</td>
* </tr>
* <tr>
* <td style="padding-left:1em">@ref dali_toolkit_controls_scroll_bar</td>
* @brief GaussianBlurView provides a render process that blurs an image.
* @defgroup dali_toolkit_controls_image_view Image View
- * @brief ImageView is a control displying an image.
+ * @brief ImageView is a control displaying an image.
* @defgroup dali_toolkit_controls_scroll_bar Scroll Bar
* @brief ScrollBar is a component that can be linked to the scrollable objects.
Name: dali-toolkit
Summary: Dali 3D engine Toolkit
-Version: 1.3.9
+Version: 1.3.17
Release: 1
Group: System/Libraries
License: Apache-2.0 and BSD-3-Clause and MIT