X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fsuper-blur-view%2Fsuper-blur-view-impl.cpp;h=3141edc67a4832dcbe1e7b9f35fc31342c86130e;hb=fc829906bc88730e08c8d483a351bd1a1ffc563f;hp=decefaf3fb03fae8b30505422dd899479d2a63b4;hpb=5c871f829de93f200bdcd47c1a80e3eee96b93cc;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp index decefaf..3141edc 100644 --- a/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp @@ -31,6 +31,7 @@ // INTERNAL_INCLUDES #include +#include namespace //Unnamed namespace { @@ -123,7 +124,7 @@ DALI_TYPE_REGISTRATION_END() } // unnamed namespace SuperBlurView::SuperBlurView( unsigned int blurLevels ) -: Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) ), +: Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION | DISABLE_STYLE_CHANGE_SIGNALS ) ), mTargetSize( Vector2::ZERO ), mBlurStrengthPropertyIndex(Property::INVALID_INDEX), mBlurLevels( blurLevels ), @@ -170,13 +171,11 @@ void SuperBlurView::SetImage(Image inputImage) mInputImage = inputImage; Actor self( Self() ); - InitializeVisual( self, mVisuals[0], mInputImage ); + + mVisuals[0] = Toolkit::VisualFactory::Get().CreateVisual( mInputImage ); + RegisterVisual( 0, mVisuals[0] ); // Will clean up previously registered visuals for this index. mVisuals[0].SetDepthIndex(0); SetShaderEffect( mVisuals[0] ); - if( self.OnStage() ) - { - mVisuals[0].SetOnStage( self ); - } BlurImage( 0, inputImage); for(unsigned int i=1; i(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 ); - InitializeVisual( self, mVisuals[i], mBlurredImage[i - 1] ); - mVisuals[ i ].SetDepthIndex( i ); - SetShaderEffect( mVisuals[ i ] ); + + mVisuals[i] = Toolkit::VisualFactory::Get().CreateVisual( mBlurredImage[i - 1] ); + RegisterVisual( i, mVisuals[i] ); // Will clean up existing visual with same index. + mVisuals[i].SetDepthIndex( i ); + SetShaderEffect( mVisuals[i] ); } if( mInputImage ) { SetImage( mInputImage ); } - - if( self.OnStage() ) - { - for( unsigned int i = 1; i <= mBlurLevels; i++ ) - { - mVisuals[i].SetOnStage( self ); - } - } } } void SuperBlurView::OnStageConnection( int depth ) { + // Chaining up first ensures visuals have SetOnStage called to create their renderers Control::OnStageConnection( depth ); if( mTargetSize == Vector2::ZERO ) @@ -311,17 +305,8 @@ void SuperBlurView::OnStageConnection( int depth ) } Actor self = Self(); - if( mVisuals[0] ) - { - mVisuals[0].SetOnStage( self ); - } for(unsigned int i=1; i<=mBlurLevels;i++) { - if( mVisuals[i] ) - { - mVisuals[i].SetOnStage( self ); - } - Renderer renderer = self.GetRendererAt( i ); Property::Index index = renderer.RegisterProperty( ALPHA_UNIFORM_NAME, 0.f ); Constraint constraint = Constraint::New( renderer, index, ActorOpacityConstraint(mBlurLevels, i-1) ); @@ -332,17 +317,6 @@ void SuperBlurView::OnStageConnection( int depth ) void SuperBlurView::OnStageDisconnection( ) { - if( mTargetSize == Vector2::ZERO ) - { - return; - } - - Actor self = Self(); - for(unsigned int i=0; i