Disabling EmbossFilter now removes all render tasks.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / effects-view / effects-view-impl.cpp
index c302e28..0b207e4 100644 (file)
@@ -137,7 +137,7 @@ Toolkit::EffectsView EffectsView::New()
 }
 
 EffectsView::EffectsView()
-: Control( ControlBehaviour( ACTOR_BEHAVIOUR_NONE ) ),
+: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
   mChildrenRoot(Actor::New()),
   mBackgroundColor( EFFECTS_VIEW_DEFAULT_BACKGROUND_COLOR ),
   mTargetSize( Vector2::ZERO ),
@@ -184,7 +184,8 @@ void EffectsView::SetType( Toolkit::EffectsView::EffectType type )
       }
     }
 
-    Image dummyImage; // Dummy image, force creation of an image visual
+    FrameBufferImage dummyImage = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+
     InitializeVisual( self, mVisualPostFilter, dummyImage );
     Property::Map customShader;
     customShader[ Toolkit::Visual::Shader::Property::VERTEX_SHADER ] = EFFECTS_VIEW_VERTEX_SOURCE;
@@ -213,6 +214,7 @@ void EffectsView::Disable()
   // stop render tasks processing
   // Note: render target resources are automatically freed since we set the Image::Unused flag
   RemoveRenderTasks();
+  mLastSize = Vector2::ZERO; // Ensure resources are reallocated on subsequent enable
   mEnabled = false;
 }