+
+ Control::OnSizeSet( targetSize );
+}
+
+void SuperBlurView::OnStageConnection( int depth )
+{
+ if( mTargetSize == Vector2::ZERO )
+ {
+ return;
+ }
+
+ // Exception to the rule, chaining up first ensures visuals have SetOnStage called to create their renderers
+ Control::OnStageConnection( depth );
+
+ Actor self = Self();
+
+ for(unsigned int i=0; i<mBlurLevels+1;i++)
+ {
+ mRenderers[i] = CreateRenderer( BASIC_VERTEX_SOURCE, FRAGMENT_SHADER );
+ mRenderers[i].SetProperty( Dali::Renderer::Property::DEPTH_INDEX, (int)i );
+ self.AddRenderer( mRenderers[i] );
+
+ if( i > 0 )
+ {
+ Renderer renderer = mRenderers[i];
+ Property::Index index = renderer.RegisterProperty( ALPHA_UNIFORM_NAME, 0.f );
+ Constraint constraint = Constraint::New<float>( renderer, index, ActorOpacityConstraint(mBlurLevels, i-1) );
+ constraint.AddSource( Source( self, mBlurStrengthPropertyIndex ) );
+ constraint.Apply();
+ }
+ }
+
+ if( mInputTexture )
+ {
+ SetRendererTexture( mRenderers[0], mInputTexture );
+ unsigned int i = 1;
+ for(; i<mBlurLevels; i++)
+ {
+ SetRendererTexture( mRenderers[i], mBlurredImage[i-1] );
+ }
+ SetRendererTexture( mRenderers[i], mBlurredImage[i-1] );
+ }
+}
+
+void SuperBlurView::OnStageDisconnection()
+{
+ for(unsigned int i=0; i<mBlurLevels+1;i++)
+ {
+ Self().RemoveRenderer( mRenderers[i] );
+ mRenderers[i].Reset();
+ }
+
+ Control::OnStageDisconnection();
+}
+
+Vector3 SuperBlurView::GetNaturalSize()
+{
+ if( mInputTexture )
+ {
+ return Vector3( mInputTexture.GetWidth(), mInputTexture.GetHeight(), 0.f );
+ }
+ return Vector3::ZERO;