From: Xiangyin Ma Date: Thu, 22 Dec 2016 15:50:47 +0000 (+0000) Subject: SuperBlurView bug fix: alpha uniform gets wrong value from constraint X-Git-Tag: dali_1.2.20~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=22b6cdee7ed55d63eac35b64b304fc771052fcee SuperBlurView bug fix: alpha uniform gets wrong value from constraint Change-Id: I4a0168b9c942e5a9d8b5d9b751ac29b4364f62ce --- 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 3141edc..4e74276 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 @@ -162,20 +162,20 @@ void SuperBlurView::OnInitialize() void SuperBlurView::SetImage(Image inputImage) { - if( mTargetSize == Vector2::ZERO || mInputImage == inputImage) + mInputImage = inputImage; + if( mTargetSize == Vector2::ZERO ) { return; } ClearBlurResource(); - mInputImage = inputImage; Actor self( Self() ); 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] ); + // custom shader is not applied on the original image. BlurImage( 0, inputImage); for(unsigned int i=1; i( renderer, index, ActorOpacityConstraint(mBlurLevels, i-1) ); - constraint.AddSource( Source( self, mBlurStrengthPropertyIndex ) ); - constraint.Apply(); + int depthIndex = renderer.GetProperty(Renderer::Property::DEPTH_INDEX); + if( depthIndex > 0 ) + { + Property::Index index = renderer.RegisterProperty( ALPHA_UNIFORM_NAME, 0.f ); + Constraint constraint = Constraint::New( renderer, index, ActorOpacityConstraint(mBlurLevels, depthIndex-1) ); + constraint.AddSource( Source( self, mBlurStrengthPropertyIndex ) ); + constraint.Apply(); + } } }