Unparents internalRoot actor when gaussian-blur-view is deactived. 56/227756/1
authorSeungho, Baek <sbsh.baek@samsung.com>
Mon, 16 Mar 2020 07:33:20 +0000 (16:33 +0900)
committerSeungho, Baek <sbsh.baek@samsung.com>
Mon, 16 Mar 2020 07:33:20 +0000 (16:33 +0900)
 - After gaussian-blur-view is once activated, Renderers of internalRoot actor are remained.
   When the gaussian-blur-view become deactived, internalRoot is still child of the View,
   and, the renderers of internalRoot will be renderered.
 - So, to add the internalRoot to gaussian-blur-view when it is actived and
   to unparent the internalRoot when the view become deactived, make the renderers do not affect rendering results.

Change-Id: If147583d008662335c539b0e016abeb67e0a9679
Signed-off-by: Seungho, Baek <sbsh.baek@samsung.com>
automated-tests/src/dali-toolkit/utc-Dali-GaussianBlurView.cpp
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp

index 4a19b78..531b94c 100644 (file)
@@ -178,11 +178,14 @@ int UtcDaliGaussianBlurActivateDeactivate(void)
 
   RenderTaskList taskList2 = Stage::GetCurrent().GetRenderTaskList();
   DALI_TEST_CHECK( 1u != taskList2.GetTaskCount() );
+  DALI_TEST_CHECK( 2u == view.GetChildCount() );
 
   view.Deactivate();
 
   RenderTaskList taskList3 = Stage::GetCurrent().GetRenderTaskList();
   DALI_TEST_CHECK( 1u == taskList3.GetTaskCount() );
+  DALI_TEST_CHECK( 1u == view.GetChildCount() );
+
   END_TEST;
 }
 
index d83ed24..233a79c 100644 (file)
@@ -330,7 +330,6 @@ void GaussianBlurView::OnInitialize()
   //////////////////////////////////////////////////////
   // Connect to actor tree
   Self().Add( mChildrenRoot );
-  Self().Add( mInternalRoot );
   mInternalRoot.Add( mHorizBlurActor );
   mInternalRoot.Add( mVertBlurActor );
   mInternalRoot.Add( mRenderDownsampledCamera );
@@ -534,6 +533,7 @@ void GaussianBlurView::RemoveRenderTasks()
 void GaussianBlurView::Activate()
 {
   // make sure resources are allocated and start the render tasks processing
+  Self().Add( mInternalRoot );
   AllocateResources();
   CreateRenderTasks();
   mActivated = true;
@@ -550,6 +550,7 @@ void GaussianBlurView::Deactivate()
 {
   // stop render tasks processing
   // Note: render target resources are automatically freed since we set the Image::Unused flag
+  mInternalRoot.Unparent();
   RemoveRenderTasks();
   mRenderTargetForRenderingChildren.Reset();
   mRenderTarget1.Reset();