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=9721dcfead357cd02cf989d5b1fbf1f8fdf72e05;hb=b97b29c76acefabbae2c0a4e9ecc261bf9dd8036;hp=3141edc67a4832dcbe1e7b9f35fc31342c86130e;hpb=ccd53048e482f41b00ad1daa7664b3781d6b7626;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 3141edc..9721dcf 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 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ #include // INTERNAL_INCLUDES +#include #include #include @@ -162,20 +163,19 @@ 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] ); + DevelControl::RegisterVisual( *this, 0, mVisuals[0], 0 ); // Will clean up previously registered visuals for this index. + // 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(); + } } } -void SuperBlurView::OnStageDisconnection( ) -{ - Control::OnStageDisconnection(); -} - Vector3 SuperBlurView::GetNaturalSize() { if( mInputImage )