+ Actor self = Self();
+ for( unsigned int i = 1; i <= mBlurLevels; i++ )
+ {
+ float exponent = static_cast<float>(i);
+ mBlurredImage[i-1] = FrameBufferImage::New( mTargetSize.width/std::pow(2.f,exponent) , mTargetSize.height/std::pow(2.f,exponent),
+ GAUSSIAN_BLUR_RENDER_TARGET_PIXEL_FORMAT );
+
+ mVisuals[i] = Toolkit::VisualFactory::Get().CreateVisual( mBlurredImage[i - 1] );
+ DevelControl::RegisterVisual( *this, i, mVisuals[i], float( i ) ); // Will clean up existing visual with same index.
+ SetShaderEffect( mVisuals[i] );
+ }
+
+ if( mInputImage )
+ {
+ SetImage( mInputImage );
+ }
+ }
+
+ 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;i++)
+ {
+ // Note that the renderer indices are depending on the order they been added to the actor
+ // which might be different from the blur level of its texture.
+ // We can check the depth index of the renderer to know which blurred image it renders.
+ // All visuals WILL have renderers at this point as we are simply creating visuals with an Image handle.
+ Renderer renderer = self.GetRendererAt( i );
+ int depthIndex = renderer.GetProperty<int>(Renderer::Property::DEPTH_INDEX);
+ if( depthIndex > 0 )