[dali_2.1.27] Merge branch 'devel/master' 03/276503/1
authorDavid Steele <david.steele@samsung.com>
Fri, 17 Jun 2022 10:28:33 +0000 (11:28 +0100)
committerDavid Steele <david.steele@samsung.com>
Fri, 17 Jun 2022 10:28:33 +0000 (11:28 +0100)
Change-Id: I170349454b0bca72b65052b0cf35c98e843052b5

automated-tests/src/dali-toolkit-internal/utc-Dali-Accessibility-Controls.cpp
automated-tests/src/dali-toolkit/utc-Dali-AnimatedImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
dali-toolkit/devel-api/focus-manager/focus-finder.cpp
dali-toolkit/internal/controls/text-controls/common-text-utils.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/text/text-controller-relayouter.cpp
dali-toolkit/internal/texture-manager/texture-manager-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index df21268..29aa513 100644 (file)
@@ -598,6 +598,16 @@ int UtcDaliAccessibilityTextField(void)
   DALI_TEST_EQUALS( text->SetRangeOfSelection( 1, 0, 1 ), false, TEST_LOCATION );
   DALI_TEST_EQUALS( text->RemoveSelection( 1 ), false, TEST_LOCATION );
 
+  // Insert into empty field
+  DALI_TEST_EQUALS(editabletext->SetTextContents(""), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(editabletext->InsertText(1, "xyz"), false, TEST_LOCATION);
+  DALI_TEST_EQUALS(editabletext->InsertText(0, "abc"), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(text->GetText(0, 3), "abc", TEST_LOCATION);
+
+  // Append at end
+  DALI_TEST_EQUALS(editabletext->InsertText(3, "xyz"), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(text->GetText(0, 6), "abcxyz", TEST_LOCATION);
+
   DALI_TEST_EQUALS(editabletext->SetTextContents("adef"), true, TEST_LOCATION);
   DALI_TEST_EQUALS(editabletext->InsertText(1, "bc"), true, TEST_LOCATION);
   DALI_TEST_EQUALS(text->GetText(0, 6), "abcdef", TEST_LOCATION);
@@ -699,6 +709,16 @@ int UtcDaliAccessibilityTextEditor(void)
   DALI_TEST_EQUALS( text->SetRangeOfSelection( 1, 0, 1 ), false, TEST_LOCATION );
   DALI_TEST_EQUALS( text->RemoveSelection( 1 ), false, TEST_LOCATION );
 
+  // Insert into empty field
+  DALI_TEST_EQUALS(editabletext->SetTextContents(""), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(editabletext->InsertText(1, "xyz"), false, TEST_LOCATION);
+  DALI_TEST_EQUALS(editabletext->InsertText(0, "abc"), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(text->GetText(0, 3), "abc", TEST_LOCATION);
+
+  // Append at end
+  DALI_TEST_EQUALS(editabletext->InsertText(3, "xyz"), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(text->GetText(0, 6), "abcxyz", TEST_LOCATION);
+
   DALI_TEST_EQUALS(editabletext->SetTextContents("adef"), true, TEST_LOCATION);
   DALI_TEST_EQUALS(editabletext->InsertText(1, "bc"), true, TEST_LOCATION);
   DALI_TEST_EQUALS(text->GetText(0, 6), "abcdef", TEST_LOCATION);
index 80836e3..6e8c9d7 100644 (file)
@@ -927,9 +927,8 @@ int UtcDaliAnimatedImageVisualAnimatedImage01(void)
     // Note that we only re-load 0 frame.
     DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
 
-    // To do: we need to fix caching bug in animated-visual
-    //tet_infoline("Test that we don't try to re-load new image cause it cached");
-    //DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, 1), false, TEST_LOCATION);
+    tet_infoline("Test that we don't try to re-load new image cause it cached");
+    DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, 1), false, TEST_LOCATION);
 
     // Batch 2 frames. Now visual frame 1, 2, 3 cached and visual2 frame 0, 1 cached.
     application.SendNotification();
index 120f570..c8f1422 100644 (file)
@@ -3439,6 +3439,19 @@ void OnResourceReadySignal04(Control control)
   }
 }
 
+void OnResourceReadySignal05(Control control)
+{
+  gResourceReadySignalCounter++;
+
+  // Request load with same image
+  // NOTE : The url must not be same as gImageView1
+  const int viewCount = 4;
+  for(int i = 0; i < viewCount; ++i)
+  {
+    gImageView1.Add(ImageView::New("invalid2.jpg"));
+  }
+}
+
 } // namespace
 
 int UtcDaliImageViewSetImageOnResourceReadySignal01(void)
@@ -3838,3 +3851,33 @@ int UtcDaliImageViewSetImageOnResourceReadySignal04(void)
 
   END_TEST;
 }
+int UtcDaliImageViewSetImageOnResourceReadySignal05(void)
+{
+  tet_infoline("Test multiple views with same image during ResourceReady load the image only 1 times");
+
+  ToolkitTestApplication application;
+
+  gResourceReadySignalCounter = 0;
+
+  gImageView1 = ImageView::New("invalid.jpg"); // request invalid image, to make loading failed fast.
+  gImageView1.ResourceReadySignal().Connect(&OnResourceReadySignal05);
+  application.GetScene().Add(gImageView1);
+
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Try to load 1 invalid.jpg image");
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(gResourceReadySignalCounter, 1, TEST_LOCATION);
+
+  tet_infoline("Try to load 1 invalid2.jpg image");
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
+
+  tet_infoline("Now we don't have any image to be loaded. Check event thread trigger failed.");
+  DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1, 1), false, TEST_LOCATION);
+
+  gImageView1.Unparent();
+  gImageView1.Reset();
+
+  END_TEST;
+}
index 2fdf285..71934f0 100644 (file)
@@ -152,9 +152,9 @@ static int MinorAxisDistance(Dali::Toolkit::Control::KeyboardFocus::Direction di
  * @param minorAxisDistance The minorAxisDistance\r
  * @return The distance\r
  */\r
-static int GetWeightedDistanceFor(int majorAxisDistance, int minorAxisDistance)\r
+static uint64_t GetWeightedDistanceFor(int majorAxisDistance, int minorAxisDistance)\r
 {\r
-  return 13 * majorAxisDistance * majorAxisDistance + minorAxisDistance * minorAxisDistance;\r
+  return 13 * static_cast<int64_t>(majorAxisDistance) * static_cast<int64_t>(majorAxisDistance) + static_cast<int64_t>(minorAxisDistance) * static_cast<int64_t>(minorAxisDistance);\r
 }\r
 \r
 /**\r
index c1f4179..646bdbf 100644 (file)
@@ -488,7 +488,7 @@ bool EditableTextControlAccessible::InsertText(std::size_t startPosition, std::s
 {
   auto text = GetWholeText();
 
-  if(!ValidateRange(text, startPosition, startPosition + 1))
+  if(!ValidateRange(text, startPosition, startPosition + 1) && !(startPosition == text.size()))
   {
     return false;
   }
index 20186ef..3df6d4b 100644 (file)
@@ -246,14 +246,6 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor)
       actor.Add(GetFocusIndicatorActor());
     }
 
-    Toolkit::Control currentlyFocusedControl = Toolkit::Control::DownCast(currentFocusedActor);
-    if(currentlyFocusedControl)
-    {
-      // Do we need it to remember if it was previously DISABLED?
-      currentlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::NORMAL);
-      currentlyFocusedControl.ClearKeyInputFocus();
-    }
-
     // Save the current focused actor
     mCurrentFocusActor = actor;
 
@@ -279,6 +271,14 @@ bool KeyboardFocusManager::DoSetCurrentFocusActor(Actor actor)
       mFocusChangedSignal.Emit(currentFocusedActor, actor);
     }
 
+    Toolkit::Control currentlyFocusedControl = Toolkit::Control::DownCast(currentFocusedActor);
+    if(currentlyFocusedControl)
+    {
+      // Do we need it to remember if it was previously DISABLED?
+      currentlyFocusedControl.SetProperty(DevelControl::Property::STATE, DevelControl::NORMAL);
+      currentlyFocusedControl.ClearKeyInputFocus();
+    }
+
     Toolkit::Control newlyFocusedControl = Toolkit::Control::DownCast(actor);
     if(newlyFocusedControl)
     {
index b9b4f56..527bb99 100644 (file)
@@ -93,11 +93,8 @@ Size Controller::Relayouter::CalculateLayoutSizeOnRequiredControllerSize(Control
   {
     impl.UpdateModel(onlyOnceOperations);
 
-    if(impl.mIsAutoScrollEnabled)
-    {
-      // Layout the text for the new width.
-      operationsPending = static_cast<OperationsMask>(operationsPending | requestedOperationsMask);
-    }
+    // Layout the text for the new width.
+    operationsPending = static_cast<OperationsMask>(operationsPending | requestedOperationsMask);
 
     DoRelayout(impl,
                requestedControllerSize,
index 445ad65..92031ae 100644 (file)
@@ -121,10 +121,8 @@ TextureManager::MaskingData::MaskingData()
 
 TextureManager::TextureManager()
 : mTextureCacheManager(),
-  mAsyncLocalLoaders(GetNumberOfLocalLoaderThreads(), [&]()
-                     { return TextureAsyncLoadingHelper(*this); }),
-  mAsyncRemoteLoaders(GetNumberOfRemoteLoaderThreads(), [&]()
-                      { return TextureAsyncLoadingHelper(*this); }),
+  mAsyncLocalLoaders(GetNumberOfLocalLoaderThreads(), [&]() { return TextureAsyncLoadingHelper(*this); }),
+  mAsyncRemoteLoaders(GetNumberOfRemoteLoaderThreads(), [&]() { return TextureAsyncLoadingHelper(*this); }),
   mLifecycleObservers(),
   mLoadQueue(),
   mRemoveQueue(),
@@ -533,7 +531,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
 {
   TextureHash       textureHash = INITIAL_HASH_NUMBER;
   TextureCacheIndex cacheIndex  = INVALID_CACHE_INDEX;
-  if(storageType != StorageType::RETURN_PIXEL_BUFFER && frameIndex == 0)
+  if(storageType != StorageType::RETURN_PIXEL_BUFFER)
   {
     textureHash = mTextureCacheManager.GenerateHash(url, desiredSize, fittingMode, samplingMode, useAtlas, maskTextureId, cropToMask, frameIndex);
 
@@ -568,7 +566,7 @@ TextureManager::TextureId TextureManager::RequestLoadInternal(
     // Cache new texutre, and get cacheIndex.
     cacheIndex = mTextureCacheManager.AppendCache(TextureInfo(textureId, maskTextureId, url, desiredSize, contentScale, fittingMode, samplingMode, false, cropToMask, useAtlas, textureHash, orientationCorrection, preMultiply, animatedImageLoading, frameIndex));
 
-    DALI_LOG_INFO(gTextureManagerLogFilter, Debug::General, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d, frameindex=%d\n", url.GetUrl().c_str(), observer, cacheIndex.GetIndex(), textureId, frameIndex);
+    DALI_LOG_INFO(gTextureManagerLogFilter, Debug::General, "TextureManager::RequestLoad( url=%s observer=%p ) New texture, cacheIndex:%d, textureId=%d, frameindex=%d premultiply=%d\n", url.GetUrl().c_str(), observer, cacheIndex.GetIndex(), textureId, frameIndex, preMultiply);
   }
 
   // The below code path is common whether we are using the cache or not.
@@ -878,6 +876,12 @@ void TextureManager::ProcessLoadQueue()
       {
         EmitLoadComplete(element.mObserver, textureInfo, true);
       }
+      else if(textureInfo.loadState == LoadState::LOADING)
+      {
+        // Note : LOADING state texture cannot be queue.
+        // This case be occured when same texture id are queue in mLoadQueue.
+        ObserveTexture(textureInfo, element.mObserver);
+      }
       else
       {
         LoadTexture(textureInfo, element.mObserver);
index d97fd48..1a14e47 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 26;
+const unsigned int TOOLKIT_MICRO_VERSION = 27;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 771452a..c4436de 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.1.26
+Version:    2.1.27
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT