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);
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);
// 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();
}
}
+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)
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;
+}
* @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
{
auto text = GetWholeText();
- if(!ValidateRange(text, startPosition, startPosition + 1))
+ if(!ValidateRange(text, startPosition, startPosition + 1) && !(startPosition == text.size()))
{
return false;
}
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;
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)
{
{
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,
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(),
{
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);
// 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.
{
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);
{
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
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