[dali_1.4.6] Merge branch 'devel/master' 29/199329/1
authorAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 8 Feb 2019 12:15:47 +0000 (12:15 +0000)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Fri, 8 Feb 2019 12:15:47 +0000 (12:15 +0000)
Change-Id: Ibb1ecafc1a8d164c431cc90f463e0c909d28a876

22 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/utc-Dali-DebugRendering.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Controller.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-ViewModel.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp
automated-tests/src/dali-toolkit-styling/CMakeLists.txt
automated-tests/src/dali-toolkit-third-party/CMakeLists.txt
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextureManager.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/texture-manager-impl.cpp
dali-toolkit/internal/visuals/texture-manager-impl.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 7a71661..746299b 100755 (executable)
@@ -49,6 +49,7 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
    ../dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
index 71641fb..80f2113 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -190,7 +190,7 @@ int UtcDaliDebugRenderingGetVisual1(void)
   DALI_TEST_EQUALS( naturalSize, Vector2( 80.f, 20.f ), Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   const float height = textVisual.GetHeightForWidth( 40.f );
-  DALI_TEST_EQUALS( height, 40.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
+  DALI_TEST_EQUALS( height, 38.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
 
   // Test that NPatchVisual is replaced with debug visual
   // TEST_NPATCH_FILE_NAME: image_01.9.jpg
index 92be479..4edcaad 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -558,8 +558,8 @@ int UtcDaliTextControllerSetGetLineSpacingProperty(void)
   // single line, line spacing = 0px
   {
     const float EXPECTED_SPACING = 0.0f;
-    const Vector2 EXPECTED_LAYOUT_SIZE( 326.0f, 19.0f);
-    const Vector3 EXPECTED_NATURAL_SIZE( 326.0f, 20.0f, 0.0f );
+    const Vector2 EXPECTED_LAYOUT_SIZE( 343.0f, 19.0f);
+    const Vector3 EXPECTED_NATURAL_SIZE( 344.0f, 20.0f, 0.0f );
 
     controller->SetText(textSingle);
     controller->Relayout(size);
@@ -577,8 +577,8 @@ int UtcDaliTextControllerSetGetLineSpacingProperty(void)
   // single line, line spacing = 20px
   {
     const float EXPECTED_SPACING = 20.0f;
-    const Vector2 EXPECTED_LAYOUT_SIZE( 326.0f, 19.0f );
-    const Vector3 EXPECTED_NATURAL_SIZE( 326.0f, 40.0f, 0.0f );
+    const Vector2 EXPECTED_LAYOUT_SIZE( 343.0f, 19.0f );
+    const Vector3 EXPECTED_NATURAL_SIZE( 344.0f, 40.0f, 0.0f );
 
     controller->SetText(textSingle);
     controller->Relayout(size);
@@ -597,8 +597,8 @@ int UtcDaliTextControllerSetGetLineSpacingProperty(void)
   // multi-line, line spacing = 0px
   {
     const float EXPECTED_SPACING = 0.0f;
-    const Vector2 EXPECTED_LAYOUT_SIZE( 318.0f, 39.0f );
-    const Vector3 EXPECTED_NATURAL_SIZE( 116.0f, 58.0f, 0.0f );
+    const Vector2 EXPECTED_LAYOUT_SIZE( 333.0f, 39.0f );
+    const Vector3 EXPECTED_NATURAL_SIZE( 120.0f, 58.0f, 0.0f );
 
     controller->SetText(textMulti);
     controller->Relayout(size);
@@ -617,8 +617,8 @@ int UtcDaliTextControllerSetGetLineSpacingProperty(void)
   // multi-line, line spacing = 20px
   {
     const float EXPECTED_SPACING = 20.0f;
-    const Vector2 EXPECTED_LAYOUT_SIZE( 115.0f, 57.0f );
-    const Vector3 EXPECTED_NATURAL_SIZE( 116.0f, 118.0f, 0.0f );
+    const Vector2 EXPECTED_LAYOUT_SIZE( 119.0f, 57.0f );
+    const Vector3 EXPECTED_NATURAL_SIZE( 120.0f, 118.0f, 0.0f );
 
     controller->SetText(textMulti);
     controller->Relayout(size);
@@ -637,8 +637,8 @@ int UtcDaliTextControllerSetGetLineSpacingProperty(void)
   // multi-line, line spacing = 30px
   {
     const float EXPECTED_SPACING = 30.0f;
-    const Vector2 EXPECTED_LAYOUT_SIZE( 115.0f, 117.0f );
-    const Vector3 EXPECTED_NATURAL_SIZE( 116.0f, 148.0f, 0.0f );
+    const Vector2 EXPECTED_LAYOUT_SIZE( 119.0f, 117.0f );
+    const Vector3 EXPECTED_NATURAL_SIZE( 120.0f, 148.0f, 0.0f );
 
     controller->SetText(textMulti);
     controller->Relayout(size);
index 8b9bffd..249c728 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -717,7 +717,7 @@ int UtcDaliTextLayoutSmallTextArea02(void)
   Vector<FontDescriptionRun> fontDescriptionRuns;
   fontDescriptionRuns.PushBack( fontDescriptionRun );
   Size textArea(1.f, 1.f);
-  Size layoutSize(80.f, 20.f);
+  Size layoutSize(80.f, 19.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 =
   {
@@ -725,7 +725,7 @@ int UtcDaliTextLayoutSmallTextArea02(void)
     { 0u, 11u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -801,7 +801,7 @@ int UtcDaliTextLayoutMultilineText01(void)
   fontDescriptionRuns.PushBack( fontDescriptionRun1 );
   fontDescriptionRuns.PushBack( fontDescriptionRun2 );
   Size textArea(100.f, 300.f);
-  Size layoutSize(95.f, 97.f);
+  Size layoutSize(95.f, 95.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, 79.f, -0.f,
@@ -816,7 +816,7 @@ int UtcDaliTextLayoutMultilineText01(void)
     { 0u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -829,7 +829,7 @@ int UtcDaliTextLayoutMultilineText01(void)
     { 12u, 6u },
     43.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1000,7 +1000,7 @@ int UtcDaliTextLayoutMultilineText02(void)
   fontDescriptionRuns.PushBack( fontDescriptionRun4 );
   fontDescriptionRuns.PushBack( fontDescriptionRun5 );
   Size textArea(100.f, 300.f);
-  Size layoutSize(80.f, 120.f);
+  Size layoutSize(80.f, 114.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, 79.f, -0.f,
@@ -1016,7 +1016,7 @@ int UtcDaliTextLayoutMultilineText02(void)
     { 0u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1029,7 +1029,7 @@ int UtcDaliTextLayoutMultilineText02(void)
     { 12u, 10u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1042,7 +1042,7 @@ int UtcDaliTextLayoutMultilineText02(void)
     { 22u, 6u },
     34.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1055,7 +1055,7 @@ int UtcDaliTextLayoutMultilineText02(void)
     { 28u, 10u },
     67.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1068,7 +1068,7 @@ int UtcDaliTextLayoutMultilineText02(void)
     { 38u, 12u },
     78.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1081,7 +1081,7 @@ int UtcDaliTextLayoutMultilineText02(void)
     { 50u, 5u },
     43.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1150,7 +1150,7 @@ int UtcDaliTextLayoutMultilineText03(void)
   Vector<FontDescriptionRun> fontDescriptionRuns;
   fontDescriptionRuns.PushBack( fontDescriptionRun );
   Size textArea(100.f, 300.f);
-  Size layoutSize(96.f, 60.f);
+  Size layoutSize(96.f, 57.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,  -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,
@@ -1163,7 +1163,7 @@ int UtcDaliTextLayoutMultilineText03(void)
     { 0u, 12u },
     93.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1176,7 +1176,7 @@ int UtcDaliTextLayoutMultilineText03(void)
     { 12u, 12u },
     96.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1189,7 +1189,7 @@ int UtcDaliTextLayoutMultilineText03(void)
     { 24u, 5u },
     43.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1254,7 +1254,7 @@ int UtcDaliTextLayoutMultilineText04(void)
   Vector<FontDescriptionRun> fontDescriptionRuns;
   fontDescriptionRuns.PushBack( fontDescriptionRun );
   Size textArea(100.f, 300.f);
-  Size layoutSize(83.f, 40.f);
+  Size layoutSize(83.f, 38.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, 79.f, -2.f, 82.f, -12.f
@@ -1265,7 +1265,7 @@ int UtcDaliTextLayoutMultilineText04(void)
     { 0u, 13u },
     83.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     false,
@@ -1277,7 +1277,7 @@ int UtcDaliTextLayoutMultilineText04(void)
     { 13u, 0u },
     0.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1368,19 +1368,19 @@ int UtcDaliTextLayoutMultilineText05(void)
   fontDescriptionRuns.PushBack( fontDescriptionRun2 );
   fontDescriptionRuns.PushBack( fontDescriptionRun3 );
   Size textArea(100.f, 300.f);
-  Size layoutSize(88.f, 53.f);
+  Size layoutSize(89.f, 51.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, -14.f, 59.f, -9.f, 69.f, -9.f, 75.f, -13.f, 78.f, -13.f, 87.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, -14.f, 60.f, -9.f, 70.f, -9.f, 76.f, -13.f, 79.f, -13.f, 88.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 },
-    88.f,
+    89.f,
     25.f,
-    -8.f,
+    -7.f,
     4.f,
     0.f,
     0.f,
@@ -1393,7 +1393,7 @@ int UtcDaliTextLayoutMultilineText05(void)
     { 12u, 5u },
     43.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1683,7 +1683,7 @@ int UtcDaliTextUpdateLayout01(void)
   fontDescriptionRuns.PushBack( fontDescriptionRun16 );
   fontDescriptionRuns.PushBack( fontDescriptionRun17 );
   Size textArea(100.f, 300.f);
-  Size layoutSize(92.f, 380.f);
+  Size layoutSize(92.f, 361.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, 79.f, -0.f,
@@ -1712,7 +1712,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 0u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1725,7 +1725,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 12u, 10u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1738,7 +1738,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 22u, 6u },
     34.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1751,7 +1751,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 28u, 20u },
     92.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1764,7 +1764,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 48u, 11u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1777,7 +1777,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 59u, 5u },
     31.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1790,7 +1790,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 64u, 10u },
     67.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1803,7 +1803,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 74u, 12u },
     78.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     1.f,
     0.f,
@@ -1816,7 +1816,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 86u, 6u },
     43.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1829,7 +1829,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 92u, 12u },
     78.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1842,7 +1842,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 104u, 19u },
     90.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1855,7 +1855,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 123u, 5u },
     31.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1868,7 +1868,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 128u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1881,7 +1881,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 140u, 10u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1894,7 +1894,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 150u, 6u },
     34.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1907,7 +1907,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 156u, 10u },
     67.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1920,7 +1920,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 166u, 12u },
     79.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -1933,7 +1933,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 178u, 14u },
     55.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -1946,7 +1946,7 @@ int UtcDaliTextUpdateLayout01(void)
     { 192u, 0u },
     0.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2258,7 +2258,7 @@ int UtcDaliTextUpdateLayout02(void)
   fontDescriptionRuns.PushBack( fontDescriptionRun16 );
   fontDescriptionRuns.PushBack( fontDescriptionRun17 );
   Size textArea(100.f, 300.f);
-  Size layoutSize(92.f, 380.f);
+  Size layoutSize(92.f, 361.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, 79.f, -0.f,
@@ -2287,7 +2287,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 0u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2300,7 +2300,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 12u, 10u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2313,7 +2313,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 22u, 6u },
     34.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2326,7 +2326,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 28u, 20u },
     92.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2339,7 +2339,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 48u, 11u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2352,7 +2352,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 59u, 5u },
     31.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2365,7 +2365,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 64u, 10u },
     67.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2378,7 +2378,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 74u, 12u },
     78.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     1.f,
     0.f,
@@ -2391,7 +2391,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 86u, 6u },
     43.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2404,7 +2404,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 92u, 12u },
     78.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2417,7 +2417,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 104u, 19u },
     90.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2430,7 +2430,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 123u, 5u },
     31.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2443,7 +2443,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 128u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2456,7 +2456,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 140u, 10u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2469,7 +2469,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 150u, 6u },
     34.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2482,7 +2482,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 156u, 10u },
     67.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2495,7 +2495,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 166u, 12u },
     79.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2508,7 +2508,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 178u, 14u },
     55.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2521,7 +2521,7 @@ int UtcDaliTextUpdateLayout02(void)
     { 192u, 0u },
     0.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2833,7 +2833,7 @@ int UtcDaliTextUpdateLayout03(void)
   fontDescriptionRuns.PushBack( fontDescriptionRun16 );
   fontDescriptionRuns.PushBack( fontDescriptionRun17 );
   Size textArea(100.f, 300.f);
-  Size layoutSize(92.f, 380.f);
+  Size layoutSize(92.f, 361.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, 79.f, -0.f,
@@ -2862,7 +2862,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 0u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2875,7 +2875,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 12u, 10u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2888,7 +2888,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 22u, 6u },
     34.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2901,7 +2901,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 28u, 20u },
     92.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2914,7 +2914,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 48u, 11u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2927,7 +2927,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 59u, 5u },
     31.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2940,7 +2940,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 64u, 10u },
     67.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2953,7 +2953,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 74u, 12u },
     78.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     1.f,
     0.f,
@@ -2966,7 +2966,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 86u, 6u },
     43.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -2979,7 +2979,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 92u, 12u },
     78.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -2992,7 +2992,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 104u, 19u },
     90.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -3005,7 +3005,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 123u, 5u },
     31.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -3018,7 +3018,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 128u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -3031,7 +3031,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 140u, 10u },
     76.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -3044,7 +3044,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 150u, 6u },
     34.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -3057,7 +3057,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 156u, 10u },
     67.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -3070,7 +3070,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 166u, 12u },
     79.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -3083,7 +3083,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 178u, 14u },
     55.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -3096,7 +3096,7 @@ int UtcDaliTextUpdateLayout03(void)
     { 192u, 0u },
     0.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -3188,7 +3188,7 @@ int UtcDaliTextLayoutEllipsis01(void)
     { 0u, 13u },
     93.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -3204,7 +3204,7 @@ int UtcDaliTextLayoutEllipsis01(void)
   };
 
   Size textArea( 100.f, 50.f );
-  Size layoutSize( 100.f, 20.f );
+  Size layoutSize( 100.f, 19.f );
 
   LayoutTextData data =
   {
@@ -3265,7 +3265,7 @@ int UtcDaliTextLayoutEllipsis02(void)
     { 0u, 12u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -3278,7 +3278,7 @@ int UtcDaliTextLayoutEllipsis02(void)
     { 12u, 12u },
     93.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -3296,7 +3296,7 @@ int UtcDaliTextLayoutEllipsis02(void)
   };
 
   Size textArea( 100.f, 50.f );
-  Size layoutSize( 100.f, 40.f );
+  Size layoutSize( 100.f, 38.f );
 
   LayoutTextData data =
   {
@@ -3423,7 +3423,7 @@ int UtcDaliTextLayoutEllipsis03(void)
     { 0u, 16u },
     95.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
@@ -3439,7 +3439,7 @@ int UtcDaliTextLayoutEllipsis03(void)
   };
 
   Size textArea( 100.f, 50.f );
-  Size layoutSize( 100.f, 20.f );
+  Size layoutSize( 100.f, 19.f );
 
   LayoutTextData data =
   {
@@ -3566,7 +3566,7 @@ int UtcDaliTextLayoutEllipsis04(void)
     { 0u, 16u },
     96.f,
     15.f,
-    -5.f,
+    -4.f,
     3.f,
     0.f,
     0.f,
@@ -3579,7 +3579,7 @@ int UtcDaliTextLayoutEllipsis04(void)
     { 16u, 18u },
     97.f,
     15.f,
-    -5.f,
+    -4.f,
     4.f,
     0.f,
     0.f,
@@ -3597,7 +3597,7 @@ int UtcDaliTextLayoutEllipsis04(void)
   };
 
   Size textArea( 100.f, 50.f );
-  Size layoutSize( 100.f, 40.f );
+  Size layoutSize( 100.f, 38.f );
 
   LayoutTextData data =
   {
@@ -3656,12 +3656,12 @@ int UtcDaliTextLayoutEllipsis05(void)
     { 0u, 11u },
     80.f,
     15.f,
-    -5.f,
+    -4.f,
     0.f,
     0.f,
     0.f,
     false,
-    true
+    false
   };
   Vector<LineRun> lines;
   lines.PushBack( line01 );
@@ -3672,7 +3672,7 @@ int UtcDaliTextLayoutEllipsis05(void)
   };
 
   Size textArea( 100.f, 19.f );
-  Size layoutSize( 100.f, 20.f );
+  Size layoutSize( 80.f, 19.f );
 
   LayoutTextData data =
   {
index b5bf653..65a56da 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -328,18 +328,18 @@ int UtcDaliTextShape(void)
 
   struct GlyphInfoData glyphs04[] =
   {
-    { 2u, 160u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
-    { 2u, 123u, 0.f, 0.f, 0.f, 0.f,  9.f, 0.f },
-    { 2u, 153u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
-    { 2u, 160u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
-    { 2u, 150u, 0.f, 0.f, 0.f, 0.f, 14.f, 0.f },
-    { 2u, 153u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
-    { 2u, 160u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
-    { 2u, 151u, 0.f, 0.f, 0.f, 0.f, 12.f, 0.f },
-    { 2u, 153u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
-    { 2u, 160u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
-    { 2u, 147u, 0.f, 0.f, 0.f, 0.f,  9.f, 0.f },
-    { 2u, 153u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
+    { 2u, 1733u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
+    { 2u, 1693u, 0.f, 0.f, 0.f, 0.f, 13.f, 0.f },
+    { 2u, 1725u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
+    { 2u, 1733u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
+    { 2u, 1721u, 0.f, 0.f, 0.f, 0.f, 20.f, 0.f },
+    { 2u, 1725u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
+    { 2u, 1733u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
+    { 2u, 1722u, 0.f, 0.f, 0.f, 0.f, 18.f, 0.f },
+    { 2u, 1725u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
+    { 2u, 1733u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
+    { 2u, 1718u, 0.f, 0.f, 0.f, 0.f, 14.f, 0.f },
+    { 2u, 1725u, 0.f, 0.f, 0.f, 0.f,  8.f, 0.f },
   };
 
   CharacterIndex characterIndices04[] = { 0u, 0u, 0u, 2u, 2u, 2u, 4u, 4u, 4u, 6u, 6u, 6u };
@@ -382,7 +382,7 @@ int UtcDaliTextShape(void)
     { 1u,  3u, 0.f, 0.f, 0.f, 0.f,  5.f, 0.f },
     { 1u, 71u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f },
     { 1u, 72u, 0.f, 0.f, 0.f, 0.f,  9.f, 0.f },
-    { 1u, 5034u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f },
+    { 1u, 5039u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f },
     { 1u, 81u, 0.f, 0.f, 0.f, 0.f, 10.f, 0.f },
     { 1u, 76u, 0.f, 0.f, 0.f, 0.f,  4.f, 0.f },
     { 1u, 72u, 0.f, 0.f, 0.f, 0.f,  9.f, 0.f },
@@ -551,15 +551,15 @@ int UtcDaliTextSoftwareStyling(void)
 
   struct GlyphInfoData glyphs01[] =
   {
-    { 2u, 14750u, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, true, true },
-    { 2u, 9802u, 0.f, 0.f, 0.f, 0.f,  16.f, 0.f, true, true },
-    { 2u, 12811u, 0.f, 0.f, 0.f, 0.f,  16.f, 0.f, true, true },
+    { 2u, 4857u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true, false },
+    { 2u, 7316u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true, false },
+    { 2u, 4364u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true, false },
   };
   struct GlyphInfoData glyphs02[] =
   {
-    { 2u, 14750u, 0.f, 0.f, 0.f, 0.f, 16.f, 0.f, false, false },
-    { 2u, 9802u, 0.f, 0.f, 0.f, 0.f,  16.f, 0.f, false, true },
-    { 2u, 12811u, 0.f, 0.f, 0.f, 0.f,  16.f, 0.f, true, false },
+    { 2u, 4857u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, false, false },
+    { 2u, 7316u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, false, false },
+    { 2u, 4364u, 0.f, 0.f, 0.f, 0.f, 15.f, 0.f, true,  false },
   };
 
   CharacterIndex characterIndices[] = { 0u, 1u, 2u };
@@ -691,4 +691,4 @@ int UtcDaliTextSoftwareStyling(void)
 
   tet_result(TET_PASS);
   END_TEST;
-}
\ No newline at end of file
+}
index 49d36e0..35105d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -49,14 +49,14 @@ const char* LOREM_IPSUM = "Lorem ipsum dolor sit amet, aeque definiebas ea mei,
   "Aliquip sanctůs delicáta quí ěá, et natum aliquam est?\n"
   "Asšúm sapěret usu ůť.\n"
   "Síť ut apeirián laboramúš percipitur, sůas hařum ín éos?\n";
-const Vector2 LOREM_SCROLL_POSITION( 0.f, -208.f );
-const Length LOREM_NUMBER_OF_LINES = 32u;
+const Vector2 LOREM_SCROLL_POSITION( 0.f, -265.f );
+const Length LOREM_NUMBER_OF_LINES = 35u;
 const Length LOREM_NUMBER_OF_LINES_ELIDED = 21u;
 const Length LOREM_NUMBER_OF_GLYPHS = 632;
-const Length LOREM_NUMBER_OF_GLYPHS_ELIDED = 397u;
+const Length LOREM_NUMBER_OF_GLYPHS_ELIDED = 395u;
 
 // The expected layout size for UtcDaliTextViewModelGetLayoutSize
-const Size LAYOUT_SIZE( 190.f, 48.f );
+const Size LAYOUT_SIZE( 197.f, 45.f );
 
 // The expected color indices for UtcDaliTextViewModelGetColors
 const ColorIndex COLOR_INDICES[] = { 0u, 0u, 0u, 0u, 0u, 0u, 1u, 1u, 1u, 2u, 2u, 2u, 2u, 2u, 1u, 1u, 1u, 1u, 1u, 3u, 1u, 1u, 1u, 0u, 0u, 0u, 0u };
@@ -583,13 +583,13 @@ int UtcDaliTextViewModelElideText02(void)
   Size textSize00( 100.f, 100.f );
 
   Size textSize01( 80.f, 100.f );
-  float positions01[] = { 0.f, 9.f, 17.f, 27.f, 35.f, 37.f, 46.f, 56.f };
+  float positions01[] = { 0.f, 8.f, 16.f, 26.f, 33.f, 41.f, 45.f, 54.f, 64.0f };
 
   Size textSize02( 80.f, 100.f );
-  float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 11.f };
+  float positions02[] = { 72.f, 63.f, 54.f, 50.f, 43.f, 38.f, 30.f, 9.0f };
 
   Size textSize03( 80.f, 100.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 };
+  float positions03[] = { 78.f, 73.f, 70.f, 65.f, 57.f, 55.f, 51.f, 50.f, 45.f, 35.f, 32.f, 24.f, 7.f };
 
   Size textSize04( 80.f, 10.f );
   float positions04[] = { 2.f };
@@ -609,7 +609,7 @@ int UtcDaliTextViewModelElideText02(void)
       "<font family='TizenSans'>Lorem ipsum dolor sit amet, aeque definiebas ea mei, posse iracundia ne cum.</font>",
       textSize01,
       5u,
-      42u,
+      37u,
       positions01
     },
     {
@@ -625,7 +625,7 @@ int UtcDaliTextViewModelElideText02(void)
       "<font family='TizenSansArabic'>عل النفط ديسمبر الإمداد بال, بين وترك شعار هو. لمّ من المبرمة النفط بالسيطرة, أم يتم تحرّك وبغطاء, عدم في لإعادة وإقامة رجوعهم.</font>",
       textSize03,
       5u,
-      79u,
+      74u,
       positions03
     },
     {
index d72bf17..823c7bb 100644 (file)
 
 using namespace Dali::Toolkit::Internal;
 
+
+void utc_dali_toolkit_texture_manager_startup(void)
+{
+  setenv( "LOG_TEXTURE_MANAGER", "3", 1 );
+  test_return_value = TET_UNDEF;
+}
+
+void utc_dali_toolkit_texture_manager_cleanup(void)
+{
+  test_return_value = TET_PASS;
+}
+
 class TestObserver : public Dali::Toolkit::TextureUploadObserver
 {
 public:
index 6b38451..2366711 100644 (file)
@@ -37,6 +37,7 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-virtual-keyboard.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-animation-data.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-button.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-application.cpp
index e9ff79a..a5fde09 100644 (file)
@@ -26,6 +26,7 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
    ../dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
index bd9848f..1ef55f9 100755 (executable)
@@ -104,6 +104,7 @@ LIST(APPEND TC_SOURCES
   dali-toolkit-test-utils/toolkit-web-engine.cpp
   dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp
   dali-toolkit-test-utils/dali-test-suite-utils.cpp
+  dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
   dali-toolkit-test-utils/dummy-control.cpp
   dali-toolkit-test-utils/layout-utils.cpp
   dali-toolkit-test-utils/mesh-builder.cpp
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
new file mode 100644 (file)
index 0000000..94c9530
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dali-toolkit-test-suite-utils.h"
+
+
+std::ostream& operator<<( std::ostream& ostream, Dali::Toolkit::Visual::ResourceStatus status )
+{
+  switch(status)
+  {
+    case Dali::Toolkit::Visual::ResourceStatus::PREPARING:
+    {
+      ostream << "PREPARING";
+      break;
+    }
+    case Dali::Toolkit::Visual::ResourceStatus::READY:
+    {
+      ostream << "READY";
+      break;
+    }
+    case Dali::Toolkit::Visual::ResourceStatus::FAILED:
+    {
+      ostream << "FAILED";
+      break;
+    }
+  }
+  return ostream;
+}
index 32dac4b..013d2c6 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TOOLKIT_TEST_SUITE_UTILS_H__
 
 /*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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 <iostream>
+#include <dali-toolkit/public-api/visuals/visual-properties.h>
+
+// Put any toolkit specific operators for DALI_TEST_CHECK template here, before dali-test-suite-utils.h.
+
+std::ostream& operator<<( std::ostream& ostream, Dali::Toolkit::Visual::ResourceStatus status );
+
 // INTERNAL INCLUDES
 
 #include <dali-test-suite-utils.h>
index 5b8a324..02f3d8f 100644 (file)
@@ -77,7 +77,7 @@ bool EventThreadCallback::WaitingForTrigger()
   struct timespec now;
   clock_gettime( CLOCK_REALTIME, &now );
   if( now.tv_nsec < 999900000 ) // 999, 900, 000
-    now.tv_nsec += 100000;
+    now.tv_nsec += 1000;
   else
   {
     now.tv_sec += 1;
@@ -124,6 +124,10 @@ bool WaitForEventThreadTrigger( int triggerCount, int timeoutInSeconds )
           Dali::CallbackBase::Execute( *callback );
           triggerCount--;
         }
+        if( triggerCount <= 0 )
+        {
+          break;
+        }
       }
     }
     clock_gettime( CLOCK_REALTIME, &now );
index 29370b7..7d1ea16 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -1841,6 +1841,8 @@ int UtcDaliImageViewCustomShader(void)
     application.SendNotification();
     application.Render();
 
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
     Renderer renderer = imageView.GetRendererAt( 0 );
     Shader shader2 = renderer.GetShader();
     Property::Value value = shader2.GetProperty( Shader::Property::PROGRAM );
@@ -1873,6 +1875,7 @@ int UtcDaliImageViewCustomShader(void)
 
     application.SendNotification();
     application.Render();
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
     Renderer renderer = imageView.GetRendererAt( 0 );
     Shader shader2 = renderer.GetShader();
@@ -1910,6 +1913,7 @@ int UtcDaliImageViewCustomShader(void)
 
     application.SendNotification();
     application.Render();
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
     Renderer renderer = imageView.GetRendererAt( 0 );
     Shader shader2 = renderer.GetShader();
@@ -1947,6 +1951,7 @@ int UtcDaliImageViewCustomShader(void)
 
     application.SendNotification();
     application.Render();
+    DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
 
     Renderer renderer = imageView.GetRendererAt( 0 );
     Shader shader2 = renderer.GetShader();
@@ -1963,3 +1968,60 @@ int UtcDaliImageViewCustomShader(void)
 
   END_TEST;
 }
+
+
+namespace
+{
+static int gFailCounter = 0;
+const int MAX_RETRIES(3);
+
+void ReloadImage(ImageView imageView)
+{
+  Property::Map imageImmediateLoadingMap;
+  imageImmediateLoadingMap[ ImageVisual::Property::URL ] = "Non-existant-image.jpg";
+  imageImmediateLoadingMap[ ImageVisual::Property::LOAD_POLICY ] =  ImageVisual::LoadPolicy::IMMEDIATE;
+
+  tet_infoline("Immediate load an image");
+  imageView.SetProperty( ImageView::Property::IMAGE, imageImmediateLoadingMap );
+}
+
+void ResourceFailedReload( Control control )
+{
+  gFailCounter++;
+  if( gFailCounter < MAX_RETRIES )
+  {
+    ReloadImage(ImageView::DownCast(control));
+  }
+}
+}
+
+int UtcDaliImageViewReloadFailedOnResourceReadySignal(void)
+{
+  tet_infoline("Test reloading failed image from within signal handler.");
+
+  ToolkitTestApplication application;
+
+  gFailCounter = 0;
+
+  ImageView imageView = ImageView::New();
+  imageView.ResourceReadySignal().Connect( &ResourceFailedReload );
+  DALI_TEST_EQUALS( gFailCounter, 0, TEST_LOCATION );
+  ReloadImage(imageView);
+
+  // loading started, this waits for the loader thread to complete
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  application.SendNotification();
+
+  DALI_TEST_EQUALS( gFailCounter, 1, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  application.SendNotification();
+
+  DALI_TEST_EQUALS( gFailCounter, 2, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  application.SendNotification();
+  DALI_TEST_EQUALS( gFailCounter, 3, TEST_LOCATION );
+
+  END_TEST;
+}
index 90dd9e7..a15ecf6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -16,6 +16,7 @@
 
 #include <iostream>
 #include <stdlib.h>
+#include <vector>
 #include <dali-toolkit-test-suite-utils.h>
 #include <toolkit-timer.h>
 #include <toolkit-event-thread-callback.h>
@@ -43,6 +44,7 @@ void dali_image_visual_cleanup(void)
 namespace
 {
 const char* TEST_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR  "/gallery-small-1.jpg";
+const char* TEST_BROKEN_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR  "/a-random-nonimage.jpg";
 const char* TEST_LARGE_IMAGE_FILE_NAME =  TEST_RESOURCE_DIR "/tbcol.png";
 const char* TEST_SMALL_IMAGE_FILE_NAME = TEST_RESOURCE_DIR "/icon-edit.png";
 const char* TEST_REMOTE_IMAGE_FILE_NAME = "https://www.tizen.org/sites/all/themes/tizen_theme/logo.png";
@@ -53,10 +55,15 @@ const char* TEST_ROTATED_IMAGE =  TEST_RESOURCE_DIR  "/keyboard-Landscape.jpg";
 
 
 bool gResourceReadySignalFired = false;
-
+std::vector<int> gReadyIds = {};
 void ResourceReadySignal( Control control )
 {
   gResourceReadySignalFired = true;
+  gReadyIds.push_back(control.GetId());
+}
+void ClearReadyIds()
+{
+  gReadyIds.clear();
 }
 
 Actor CreateActorWithImageVisual(const Property::Map& map)
@@ -2178,3 +2185,97 @@ int UtcDaliImageVisualCustomShader(void)
 
   END_TEST;
 }
+
+
+void ResourceReadyLoadNext( Control control )
+{
+  static int callNumber = 0;
+
+  gResourceReadySignalFired = true;
+  gReadyIds.push_back(control.GetId());
+
+  if( callNumber == 0 )
+  {
+    DALI_TEST_EQUALS( control.GetVisualResourceStatus(DummyControl::Property::TEST_VISUAL), Toolkit::Visual::ResourceStatus::FAILED, TEST_LOCATION );
+
+    tet_infoline( "Create visual with loaded image from within the signal handler" );
+    VisualFactory factory = VisualFactory::Get();
+    Visual::Base imageVisual = factory.CreateVisual( TEST_IMAGE_FILE_NAME, ImageDimensions{20,30} );
+
+    Impl::DummyControl& controlImpl = static_cast<Impl::DummyControl&>(control.GetImplementation());
+    controlImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual ); // This should trigger another signal.
+    callNumber = 1;
+  }
+  else
+  {
+    tet_infoline( "3rd signal called" );
+    DALI_TEST_CHECK(true);
+  }
+}
+
+int UtcDaliImageVisualLoadReady01(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline( "UtcDaliImageVisualLoadReady01");
+  tet_infoline( "First part:  Load an image visual for one resource, then another image visual for a second resource.");
+  tet_infoline( "Second part, In the ready signal for the second image visual, add a 3rd visual with the first URL" );
+  tet_infoline( "Should get a ready signal for all three visuals");
+
+  ClearReadyIds();
+
+  tet_infoline( "Create a control and connect to resource ready signal" );
+  DummyControl actor = DummyControl::New(true);
+  int actor1Id = actor.GetId();
+  actor.ResourceReadySignal().Connect( &ResourceReadySignal);
+  Impl::DummyControl& dummyImpl = static_cast<Impl::DummyControl&>(actor.GetImplementation());
+  actor.SetSize(200.f, 200.f);
+  Stage::GetCurrent().Add(actor);
+
+  tet_infoline( "Create visual with IMMEDIATE load policy" );
+  Visual::Base imageVisual1 = CreateVisualWithPolicy( TEST_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
+
+  tet_infoline( "Registering visual allows control to get a signal once loaded even if visual not enabled( staged )" );
+  dummyImpl.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual1 );
+
+
+  tet_infoline( "Allow image time to load" );
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline( "Testing texture is loaded and resource ready signal fired" );
+  DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+  DALI_TEST_EQUALS( gReadyIds[0], actor1Id, TEST_LOCATION );
+
+
+  tet_infoline( "Original control correctly signalled, now testing failing image" );
+
+  gResourceReadySignalFired = false; // Reset signal check ready for testing next Control
+  ClearReadyIds();
+
+  Visual::Base imageVisual2 = CreateVisualWithPolicy( TEST_BROKEN_IMAGE_FILE_NAME, ImageVisual::Property::LOAD_POLICY, ImageVisual::LoadPolicy::IMMEDIATE );
+
+  DummyControl actor2 = DummyControl::New(true);
+  int actor2Id = actor2.GetId();
+  Impl::DummyControl& dummyImpl2 = static_cast<Impl::DummyControl&>(actor2.GetImplementation());
+  actor2.ResourceReadySignal().Connect( &ResourceReadyLoadNext);
+
+  tet_infoline( "Registering visual this should trigger the ready signal when the image fails to load" );
+  dummyImpl2.RegisterVisual( DummyControl::Property::TEST_VISUAL, imageVisual2 );
+
+  actor2.SetSize(200.f, 200.f);
+  Stage::GetCurrent().Add(actor2);
+
+  tet_infoline( "Wait for loading thread to finish");
+  DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+  DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
+
+  DALI_TEST_EQUALS( gReadyIds[0], actor2Id, TEST_LOCATION);
+
+  tet_infoline( "Check for 3rd signal");
+  application.SendNotification();
+  DALI_TEST_EQUALS( gReadyIds.size(), 2, TEST_LOCATION );
+  DALI_TEST_EQUALS( gReadyIds[1], actor2Id, TEST_LOCATION);
+
+  END_TEST;
+}
index 89a95ba..72370db 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -26,7 +26,6 @@ using namespace Dali::Toolkit;
 
 namespace
 {
-
 } // namespace
 
 
@@ -152,6 +151,3 @@ int UtcDaliTextureManagerRemoveN(void)
 
   END_TEST;
 }
-
-
-
index 3f4e763..bbef5e4 100644 (file)
@@ -811,6 +811,7 @@ void ImageVisual::DoSetOffStage( Actor& actor )
   if( mReleasePolicy == Toolkit::ImageVisual::ReleasePolicy::DETACHED )
   {
     RemoveTexture(); // If INVALID_TEXTURE_ID then removal will be attempted on atlas
+    mImpl->mResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
   }
 
   if( mImageUrl.IsValid() )
index 1ea95a9..7847924 100644 (file)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -79,6 +79,16 @@ namespace
 
 #ifdef DEBUG_ENABLED
 Debug::Filter* gTextureManagerLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_TEXTURE_MANAGER" );
+
+#define GET_LOAD_STATE_STRING( loadState ) \
+  loadState == TextureManager::NOT_STARTED ? "NOT_STARTED" :             \
+    loadState == TextureManager::LOADING ? "LOADING" :                   \
+    loadState == TextureManager::LOAD_FINISHED ? "LOAD_FINISHED" :       \
+    loadState == TextureManager::WAITING_FOR_MASK ? "WAITING_FOR_MASK" : \
+    loadState == TextureManager::UPLOADED ? "UPLOADED" :                 \
+    loadState == TextureManager::CANCELLED ? "CANCELLED" :               \
+    loadState == TextureManager::LOAD_FAILED ? "LOAD_FAILED" : "Unknown"
+
 #endif
 
 const uint32_t      DEFAULT_ATLAS_SIZE( 1024u );                     ///< This size can fit 8 by 8 images of average size 128 * 128
@@ -117,8 +127,10 @@ TextureManager::TextureManager()
   mAsyncRemoteLoaders( GetNumberOfRemoteLoaderThreads(), [&]() { return AsyncLoadingHelper(*this); } ),
   mExternalTextures(),
   mLifecycleObservers(),
+  mLoadQueue(),
   mBrokenImageUrl(""),
-  mCurrentTextureId( 0 )
+  mCurrentTextureId( 0 ),
+  mQueueLoadFlag(false)
 {
 }
 
@@ -242,13 +254,18 @@ TextureSet TextureManager::LoadTexture(
       }
 
       TextureManager::LoadState loadState = GetTextureStateInternal( textureId );
-      loadingStatus = ( loadState == TextureManager::LOADING );
-
       if( loadState == TextureManager::UPLOADED )
       {
         // UploadComplete has already been called - keep the same texture set
         textureSet = GetTextureSet( textureId );
       }
+
+      // If we are loading the texture, or waiting for the ready signal handler to complete, inform
+      // caller that they need to wait.
+      loadingStatus = ( loadState == TextureManager::LOADING ||
+                        loadState == TextureManager::NOT_STARTED ||
+                        mQueueLoadFlag );
+
     }
     else
     {
@@ -345,7 +362,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
       ++( mTextureInfoContainer[ cacheIndex ].referenceCount );
     }
     textureId = mTextureInfoContainer[ cacheIndex ].textureId;
-    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::RequestLoad( url=%s observer=%p ) Using cached texture id@%d, textureId=%d\n",
+    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, "TextureManager::RequestLoad( url=%s observer=%p ) Using cached texture id@%d, textureId=%d\n",
                    url.GetUrl().c_str(), observer, cacheIndex, textureId );
   }
 
@@ -360,7 +377,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
                                                   preMultiply ) );
     cacheIndex = mTextureInfoContainer.size() - 1u;
 
-    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d\n",
+    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d\n",
                    url.GetUrl().c_str(), observer, cacheIndex, textureId );
   }
 
@@ -372,11 +389,8 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
   textureInfo.storageType = storageType;
   textureInfo.orientationCorrection = orientationCorrection;
 
-  DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureInfo loadState:%s\n",
-                 textureInfo.loadState == TextureManager::NOT_STARTED ? "NOT_STARTED" :
-                 textureInfo.loadState == TextureManager::LOADING ? "LOADING" :
-                 textureInfo.loadState == TextureManager::UPLOADED ? "UPLOADED" :
-                 textureInfo.loadState == TextureManager::CANCELLED ? "CANCELLED" : "Unknown" );
+  DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, "TextureInfo loadState:%s\n",
+                 GET_LOAD_STATE_STRING(textureInfo.loadState ) );
 
   // Force reloading of texture by setting loadState unless already loading or cancelled.
   if ( TextureManager::ReloadPolicy::FORCED == reloadPolicy && TextureManager::LOADING != textureInfo.loadState &&
@@ -394,8 +408,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
     case TextureManager::LOAD_FAILED: // Failed notifies observer which then stops observing.
     case TextureManager::NOT_STARTED:
     {
-      LoadTexture( textureInfo );
-      ObserveTexture( textureInfo, observer );
+      LoadOrQueueTexture( textureInfo, observer ); // If called inside NotifyObservers, queues until afterwards
       break;
     }
     case TextureManager::LOADING:
@@ -407,11 +420,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
     {
       if( observer )
       {
-        // The Texture has already loaded. The other observers have already been notified.
-        // We need to send a "late" loaded notification for this observer.
-        observer->UploadComplete( true, textureInfo.textureId, textureInfo.textureSet,
-                                  textureInfo.useAtlas, textureInfo.atlasRect,
-                                  textureInfo.preMultiplied );
+        LoadOrQueueTexture( textureInfo, observer );
       }
       break;
     }
@@ -440,12 +449,10 @@ void TextureManager::Remove( const TextureManager::TextureId textureId )
   {
     TextureInfo& textureInfo( mTextureInfoContainer[ textureInfoIndex ] );
 
-    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::Remove(%d) cacheIdx:%d loadState:%s\n",
-                   textureId, textureInfoIndex,
-                   textureInfo.loadState == TextureManager::NOT_STARTED ? "NOT_STARTED" :
-                   textureInfo.loadState == TextureManager::LOADING ? "LOADING" :
-                   textureInfo.loadState == TextureManager::UPLOADED ? "UPLOADED" :
-                   textureInfo.loadState == TextureManager::CANCELLED ? "CANCELLED" : "Unknown" );
+    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise,
+                   "TextureManager::Remove(%d) url:%s\n  cacheIdx:%d loadState:%s\n",
+                   textureId, textureInfo.url.GetUrl().c_str(),
+                   textureInfoIndex, GET_LOAD_STATE_STRING( textureInfo.loadState ) );
 
     // Decrement the reference count and check if this is the last user of this Texture.
     if( --textureInfo.referenceCount <= 0 )
@@ -624,32 +631,101 @@ void TextureManager::RemoveObserver( TextureManager::LifecycleObserver& observer
   DALI_ASSERT_DEBUG(endIter != mLifecycleObservers.End());
 }
 
+void TextureManager::LoadOrQueueTexture( TextureInfo& textureInfo, TextureUploadObserver* observer )
+{
+  switch( textureInfo.loadState )
+  {
+    case NOT_STARTED:
+    case LOAD_FAILED:
+    {
+      if( mQueueLoadFlag )
+      {
+        QueueLoadTexture( textureInfo, observer );
+      }
+      else
+      {
+        LoadTexture( textureInfo, observer );
+      }
+      break;
+    }
+    case LOADING:
+    case UPLOADED:
+    {
+      if( mQueueLoadFlag )
+      {
+        QueueLoadTexture( textureInfo, observer );
+      }
+      else
+      {
+        // The Texture has already loaded. The other observers have already been notified.
+        // We need to send a "late" loaded notification for this observer.
+        observer->UploadComplete( true, textureInfo.textureId, textureInfo.textureSet,
+                                  textureInfo.useAtlas, textureInfo.atlasRect,
+                                  textureInfo.preMultiplied );
+      }
+    }
+    case CANCELLED:
+    case LOAD_FINISHED:
+    case WAITING_FOR_MASK:
+    {
+      break;
+    }
+  }
+}
+
+void TextureManager::QueueLoadTexture( TextureInfo& textureInfo, TextureUploadObserver* observer )
+{
+  auto textureId = textureInfo.textureId;
+  mLoadQueue.PushBack( LoadQueueElement( textureId, observer) );
+}
 
-bool TextureManager::LoadTexture( TextureInfo& textureInfo )
+void TextureManager::LoadTexture( TextureInfo& textureInfo, TextureUploadObserver* observer )
 {
-  bool success = true;
+  DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::LoadTexture(): url:%s sync:%s\n",
+                 textureInfo.url.GetUrl().c_str(), textureInfo.loadSynchronously?"T":"F" );
 
-  if( textureInfo.loadState == NOT_STARTED )
+  textureInfo.loadState = LOADING;
+  if( !textureInfo.loadSynchronously )
   {
-    textureInfo.loadState = LOADING;
+    auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
+    auto loadingHelperIt = loadersContainer.GetNext();
+    DALI_ASSERT_ALWAYS(loadingHelperIt != loadersContainer.End());
+    loadingHelperIt->Load(textureInfo.textureId, textureInfo.url,
+                          textureInfo.desiredSize, textureInfo.fittingMode,
+                          textureInfo.samplingMode, textureInfo.orientationCorrection );
+  }
+  ObserveTexture( textureInfo, observer );
+}
 
-    if( !textureInfo.loadSynchronously )
+void TextureManager::ProcessQueuedTextures()
+{
+  for( auto&& element : mLoadQueue )
+  {
+    int cacheIndex = GetCacheIndexFromId( element.mTextureId );
+    if( cacheIndex != INVALID_CACHE_INDEX )
     {
-      auto& loadersContainer = textureInfo.url.IsLocalResource() ? mAsyncLocalLoaders : mAsyncRemoteLoaders;
-      auto loadingHelperIt = loadersContainer.GetNext();
-      DALI_ASSERT_ALWAYS(loadingHelperIt != loadersContainer.End());
-      loadingHelperIt->Load(textureInfo.textureId, textureInfo.url,
-                            textureInfo.desiredSize, textureInfo.fittingMode,
-                            textureInfo.samplingMode, textureInfo.orientationCorrection );
+      TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
+      if( textureInfo.loadState == UPLOADED )
+      {
+        element.mObserver->UploadComplete( true, textureInfo.textureId, textureInfo.textureSet,
+                                           textureInfo.useAtlas, textureInfo.atlasRect,
+                                           textureInfo.preMultiplied );
+      }
+      else
+      {
+        LoadTexture( textureInfo, element.mObserver );
+      }
     }
   }
-
-  return success;
+  mLoadQueue.Clear();
 }
 
 void TextureManager::ObserveTexture( TextureInfo& textureInfo,
                                      TextureUploadObserver* observer )
 {
+  DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "TextureManager::ObserveTexture(): url:%s observer:%p\n",
+                 textureInfo.url.GetUrl().c_str(), observer );
+
   if( observer )
   {
     textureInfo.observerList.PushBack( observer );
@@ -673,7 +749,9 @@ void TextureManager::AsyncLoadComplete( AsyncLoadingInfoContainerType& loadingCo
       {
         TextureInfo& textureInfo( mTextureInfoContainer[cacheIndex] );
 
-        DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "  CacheIndex:%d LoadState: %d\n", cacheIndex, textureInfo.loadState );
+        DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise,
+                       "  textureId:%d Url:%s CacheIndex:%d LoadState: %d\n",
+                       textureInfo.textureId, textureInfo.url.GetUrl().c_str(), cacheIndex, textureInfo.loadState );
 
         if( textureInfo.loadState != CANCELLED )
         {
@@ -788,12 +866,11 @@ void TextureManager::ApplyMask(
   }
 }
 
-
 void TextureManager::UploadTexture( Devel::PixelBuffer& pixelBuffer, TextureInfo& textureInfo )
 {
   if( textureInfo.useAtlas != USE_ATLAS )
   {
-    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "  TextureManager::UploadTexture() New Texture for textureId:%d\n", textureInfo.textureId );
+    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::General, "  TextureManager::UploadTexture() New Texture for textureId:%d\n", textureInfo.textureId );
 
     // If the texture doesn't have an alpha channel, can't pre-multiply it.
     // Ensure that we don't change the load parameter (it's used for hashing), and instead set
@@ -828,53 +905,50 @@ void TextureManager::NotifyObservers( TextureInfo& textureInfo, bool success )
 
   // If there is an observer: Notify the load is complete, whether successful or not,
   // and erase it from the list
-  unsigned int observerCount = textureInfo.observerList.Count();
   TextureInfo* info = &textureInfo;
 
-  while( observerCount )
+  mQueueLoadFlag = true;
+
+  while( info->observerList.Count() )
   {
     TextureUploadObserver* observer = info->observerList[0];
 
     // During UploadComplete() a Control ResourceReady() signal is emitted.
     // During that signal the app may add remove /add Textures (e.g. via
-    // ImageViews).  At this point no more observers can be added to the
-    // observerList, because textureInfo.loadState = UPLOADED. However it is
-    // possible for observers to be removed, hence we check the observer list
-    // count every iteration.
-
-    // The reference to the textureInfo struct can also become invalidated,
-    // because new load requests can modify the mTextureInfoContainer list
-    // (e.g. if more requests are pushed back it can cause the list to be
-    // resized invalidating the reference to the TextureInfo ).
+    // ImageViews).
+    // It is possible for observers to be removed from the observer list,
+    // and it is also possible for the mTextureInfoContainer to be modified,
+    // invalidating the reference to the textureInfo struct.
+    // Texture load requests for the same URL are deferred until the end of this
+    // method.
+    DALI_LOG_INFO( gTextureManagerLogFilter, Debug::Concise, "NotifyObservers() url:%s loadState:%s\n",
+                   textureInfo.url.GetUrl().c_str(), GET_LOAD_STATE_STRING(textureInfo.loadState ) );
+
     observer->UploadComplete( success, info->textureId, info->textureSet, info->useAtlas, info->atlasRect,
                               info->preMultiplied );
     observer->DestructionSignal().Disconnect( this, &TextureManager::ObserverDestroyed );
 
-    // Get the textureInfo from the container again as it may have been
-    // invalidated,
-
+    // Get the textureInfo from the container again as it may have been invalidated.
     int textureInfoIndex = GetCacheIndexFromId( textureId );
     if( textureInfoIndex == INVALID_CACHE_INDEX)
     {
-      return; // texture has been removed - can stop.
+      break; // texture has been removed - can stop.
     }
-
     info = &mTextureInfoContainer[ textureInfoIndex ];
-    observerCount = info->observerList.Count();
-    if ( observerCount > 0 )
+
+    // remove the observer that was just triggered if it's still in the list
+    for( TextureInfo::ObserverListType::Iterator j = info->observerList.Begin(); j != info->observerList.End(); ++j )
     {
-      // remove the observer that was just triggered if it's still in the list
-      for( TextureInfo::ObserverListType::Iterator j = info->observerList.Begin(); j != info->observerList.End(); ++j )
+      if( *j == observer )
       {
-        if( *j == observer )
-        {
-          info->observerList.Erase( j );
-          observerCount--;
-          break;
-        }
+        info->observerList.Erase( j );
+        break;
       }
     }
   }
+
+  mQueueLoadFlag = false;
+  ProcessQueuedTextures();
 }
 
 TextureManager::TextureId TextureManager::GenerateUniqueTextureId()
index 6df17c6..502cf11 100755 (executable)
@@ -424,6 +424,8 @@ private:
 
   typedef size_t TextureHash; ///< The type used to store the hash used for Texture caching.
 
+  // Structs:
+
   /**
    * @brief This struct is used to manage the life-cycle of Texture loading and caching.
    */
@@ -495,7 +497,20 @@ private:
     bool preMultiplied:1;          ///< true if the image's color was multiplied by it's alpha
   };
 
-  // Structs:
+  /**
+   * Structure to hold info about a texture load queued during NotifyObservers
+   */
+  struct LoadQueueElement
+  {
+    LoadQueueElement( TextureId textureId, TextureUploadObserver* observer )
+    : mTextureId( textureId ),
+      mObserver( observer )
+    {
+    }
+
+    TextureId mTextureId; ///< The texture id of the requested load.
+    TextureUploadObserver* mObserver; ///< Observer of texture load.
+  };
 
   /**
    * Struct to hold information about a requested Async load.
@@ -519,16 +534,35 @@ private:
   typedef std::vector<TextureInfo>      TextureInfoContainerType;       ///< The container type used to manage the life-cycle and caching of Textures
 
   /**
+   * @brief Initiate a load or queue load if NotifyObservers is invoking callbacks
+   * @param[in] textureInfo The TextureInfo struct associated with the Texture
+   * @param[in] observer The observer wishing to observe the texture upload
+   */
+  void LoadOrQueueTexture( TextureInfo& textureInfo, TextureUploadObserver* observer );
+
+  /**
+   * @brief Queue a texture load to be subsequently handled by ProcessQueuedTextures.
+   * @param[in] textureInfo The TextureInfo struct associated with the Texture
+   * @param[in] observer The observer wishing to observe the texture upload
+   */
+  void QueueLoadTexture( TextureInfo& textureInfo, TextureUploadObserver* observer );
+
+  /**
    * @brief Used internally to initiate a load.
    * @param[in] textureInfo The TextureInfo struct associated with the Texture
-   * @return                True if the load was initiated
+   * @param[in] observer The observer wishing to observe the texture upload
+   */
+  void LoadTexture( TextureInfo& textureInfo, TextureUploadObserver* observer );
+
+  /**
+   * @brief Initiate load of textures queued whilst NotifyObservers invoking callbacks.
    */
-  bool LoadTexture( TextureInfo& textureInfo );
+  void ProcessQueuedTextures();
 
   /**
    * Add the observer to the observer list
    * @param[in] textureInfo The TextureInfo struct associated with the texture
-   * observer The observer wishing to observe the texture upload
+   * @param[in] observer The observer wishing to observe the texture upload
    */
   void ObserveTexture( TextureInfo & textureInfo, TextureUploadObserver* observer );
 
@@ -747,8 +781,10 @@ private:  // Member Variables:
   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
+  Dali::Vector<LoadQueueElement>                mLoadQueue;            ///< Queue of textures to load after NotifyObservers
   std::string                                   mBrokenImageUrl;       ///< Broken image url
   TextureId                                     mCurrentTextureId;     ///< The current value used for the unique Texture Id generation
+  bool                                          mQueueLoadFlag;        ///< Flag that causes Load Textures to be queued.
 };
 
 
index d30729b..2c8183c 100644 (file)
@@ -60,6 +60,10 @@ namespace Internal
 namespace
 {
 
+#if defined(DEBUG_ENABLED)
+Debug::Filter* gLogFilter = Debug::Filter::New( Debug::NoLogging, false, "LOG_CONTROL_VISUALS");
+#endif
+
 BaseHandle Create()
 {
   BaseHandle handle = Toolkit::VisualFactory::Get();
@@ -273,9 +277,19 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Property::Map& property
     }
   }
 
+  DALI_LOG_INFO( gLogFilter, Debug::Concise, "VisualFactory::CreateVisual( VisualType:%s %s%s)\n",
+                 Scripting::GetEnumerationName<Toolkit::DevelVisual::Type>( visualType,
+                                                                            VISUAL_TYPE_TABLE,
+                                                                            VISUAL_TYPE_TABLE_COUNT ),
+                 visualType==Toolkit::DevelVisual::IMAGE?"url:":"",
+                 visualType==Toolkit::DevelVisual::IMAGE ?
+                 propertyMap.Find( Toolkit::ImageVisual::Property::URL, IMAGE_URL_NAME)->Get<std::string>().c_str()
+                 :"" );
+
+
   if( !visualPtr )
   {
-    DALI_LOG_ERROR( "Renderer type unknown\n" );
+    DALI_LOG_ERROR( "VisualType unknown\n" );
   }
 
   if( mDebugEnabled && visualType !=  Toolkit::DevelVisual::WIREFRAME )
index 0cb665c..d0f8e30 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 4;
-const unsigned int TOOLKIT_MICRO_VERSION = 5;
+const unsigned int TOOLKIT_MICRO_VERSION = 6;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index fabfa6b..ffbc581 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.4.5
+Version:    1.4.6
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT