From: David Steele Date: Thu, 8 Jun 2017 11:15:20 +0000 (+0100) Subject: Fixups following changes to actor traversal X-Git-Tag: dali_1.2.44~1^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=9ef24d9915312eab4d2e28814aab77fe7803d7e8 Fixups following changes to actor traversal Fixed popup (background actor was after content) Fixed text editor/field (highlight was on top of text) Change-Id: I6597989b0f9fc15f4d3a1929bac8c41fba303ffa --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp index 0e19358..f6d34b9 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp @@ -345,7 +345,12 @@ int UtcDaliImageVisualTextureReuse2(void) DALI_TEST_EQUALS( textureTrace.FindMethod("GenTextures"), true, TEST_LOCATION ); DALI_TEST_EQUALS( drawTrace.CountMethod("DrawArrays"), 2, TEST_LOCATION ); - DALI_TEST_EQUALS( textureTrace.CountMethod("BindTexture"), 2, TEST_LOCATION ); + TraceCallStack::NamedParams tex1; + tex1["texture"] = "1"; + TraceCallStack::NamedParams tex2; + tex1["texture"] = "2"; + DALI_TEST_EQUALS( textureTrace.FindMethodAndParams("BindTexture", tex1), true, TEST_LOCATION ); + DALI_TEST_EQUALS( textureTrace.FindMethodAndParams("BindTexture", tex2), true, TEST_LOCATION ); tet_infoline("Test that removing 1 actor deletes it's texture\n"); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp index c143510..40e4ea1 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp @@ -1595,17 +1595,18 @@ int utcDaliTextEditorEvent03(void) // The stencil actor should have two actors: the renderer and the highlight actor. Actor stencil = editor.GetChildAt( 0u ); + // Highlight needs to be drawn before text, so should come first in child order + Renderer highlight = stencil.GetChildAt( 0u ).GetRendererAt( 0u ); + DALI_TEST_CHECK( highlight ); + // The stencil actor has a container with all the actors which contain the text renderers. - Actor container = stencil.GetChildAt( 0u ); + Actor container = stencil.GetChildAt( 1u ); for( unsigned int index = 0; index < container.GetChildCount(); ++index ) { Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u ); DALI_TEST_CHECK( renderer ); } - Renderer highlight = stencil.GetChildAt( 1u ).GetRendererAt( 0u ); - DALI_TEST_CHECK( highlight ); - // Double tap out of bounds application.ProcessEvent( GenerateTap( Gesture::Possible, 2u, 1u, Vector2( 29.f, 25.0f ) ) ); application.ProcessEvent( GenerateTap( Gesture::Started, 2u, 1u, Vector2( 29.f, 25.0f ) ) ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp index b05305b..2c1aa44 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp @@ -1702,17 +1702,18 @@ int utcDaliTextFieldEvent03(void) // The offscreen root actor should have two actors: the renderer and the highlight actor. Actor stencil = field.GetChildAt( 0u ); + // The highlight actor is drawn first, so is the first actor in the list + Renderer highlight = stencil.GetChildAt( 0u ).GetRendererAt( 0u ); + DALI_TEST_CHECK( highlight ); + // The offscreen root actor has a container with all the actors which contain the text renderers. - Actor container = stencil.GetChildAt( 0u ); + Actor container = stencil.GetChildAt( 1u ); for( unsigned int index = 0; index < container.GetChildCount(); ++index ) { Renderer renderer = container.GetChildAt( index ).GetRendererAt( 0u ); DALI_TEST_CHECK( renderer ); } - Renderer highlight = stencil.GetChildAt( 1u ).GetRendererAt( 0u ); - DALI_TEST_CHECK( highlight ); - END_TEST; } diff --git a/dali-toolkit/internal/controls/popup/popup-impl.cpp b/dali-toolkit/internal/controls/popup/popup-impl.cpp index 9794921..7374138 100644 --- a/dali-toolkit/internal/controls/popup/popup-impl.cpp +++ b/dali-toolkit/internal/controls/popup/popup-impl.cpp @@ -30,6 +30,7 @@ #include #include #include +#include #include // INTERNAL INCLUDES @@ -592,6 +593,7 @@ void Popup::SetPopupBackgroundImage( Actor image ) const bool prevAlter = mAlterAddedChild; mAlterAddedChild = false; mPopupContainer.Add( mPopupBackgroundImage ); + DevelActor::LowerToBottom(mPopupBackgroundImage); mAlterAddedChild = prevAlter; if( mTailImage ) diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index 1a918cd..eb2264b 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1290,6 +1291,7 @@ void TextEditor::RenderText( Text::Controller::UpdateTextType updateTextType ) ++it ) { self.Add( *it ); + DevelActor::LowerToBottom( *it ); } mClippingDecorationActors.clear(); diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index c7c9c4b..6083974 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1362,6 +1363,7 @@ void TextField::RenderText( Text::Controller::UpdateTextType updateTextType ) ++it ) { self.Add( *it ); + DevelActor::LowerToBottom(*it); } mClippingDecorationActors.clear();