X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fsuper-blur-view%2Fsuper-blur-view-impl.cpp;h=2c93d419e09b73bc4776814e30551879d3c05e69;hp=5544761f299b18a60220db3b7eb5db3be6dac38b;hb=eff9a302f2e5999932743f5d5341e315f627793e;hpb=cc82bd9b187cda8fe2c8336b73fd1fa9376cfebd 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 5544761..2c93d41 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 @@ -20,12 +20,11 @@ // EXTERNAL INCLUDES #include -#include #include #include #include -#include -#include +#include +#include #include namespace //Unnamed namespace @@ -54,20 +53,20 @@ struct ActorOpacityConstraint mRange = Vector2( index*rangeLength, (index+1.f)*rangeLength ); } - float operator()( float current, const PropertyInput& blurProperty ) + void operator()( float& current, const PropertyInputContainer& inputs ) { - float blurStrength = blurProperty.GetFloat(); + float blurStrength = inputs[0]->GetFloat(); if(blurStrength <= mRange.x) { - return 1.f; + current = 1.f; } else if(blurStrength > mRange.y) { - return 0.f; + current = 0.f; } else { - return (mRange.y - blurStrength)/(mRange.y-mRange.x); + current = ( mRange.y - blurStrength) / ( mRange.y - mRange.x ); } } @@ -98,14 +97,14 @@ BaseHandle Create() // Setup properties, signals and actions using the type-registry. DALI_TYPE_REGISTRATION_BEGIN( Toolkit::SuperBlurView, Toolkit::Control, Create ) -DALI_PROPERTY_REGISTRATION( SuperBlurView, "image", MAP, IMAGE ) +DALI_PROPERTY_REGISTRATION( Toolkit, SuperBlurView, "image", MAP, IMAGE ) DALI_TYPE_REGISTRATION_END() } // unnamed namespace SuperBlurView::SuperBlurView( unsigned int blurLevels ) -: Control( CONTROL_BEHAVIOUR_NONE ), +: Control( ControlBehaviour( DISABLE_SIZE_NEGOTIATION ) ), mBlurLevels( blurLevels ), mBlurStrengthPropertyIndex(Property::INVALID_INDEX), mResourcesCleared( true ), @@ -144,6 +143,7 @@ void SuperBlurView::OnInitialize() for(unsigned int i=0; i<=mBlurLevels;i++) { mImageActors[i] = ImageActor::New( ); + mImageActors[i].SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); mImageActors[i].SetParentOrigin( ParentOrigin::CENTER ); mImageActors[i].SetZ(-static_cast(i)*0.01f); mImageActors[i].SetColorMode( USE_OWN_MULTIPLY_PARENT_ALPHA ); @@ -152,7 +152,9 @@ void SuperBlurView::OnInitialize() for(unsigned int i=0; i < mBlurLevels; i++) { - mImageActors[i].ApplyConstraint( Constraint::New( Actor::Property::COLOR_ALPHA, ParentSource( mBlurStrengthPropertyIndex ), ActorOpacityConstraint(mBlurLevels, i) ) ); + Constraint constraint = Constraint::New( mImageActors[i], Actor::Property::COLOR_ALPHA, ActorOpacityConstraint(mBlurLevels, i) ); + constraint.AddSource( ParentSource( mBlurStrengthPropertyIndex ) ); + constraint.Apply(); } Self().SetSize(Stage::GetCurrent().GetSize()); @@ -250,17 +252,7 @@ void SuperBlurView::ClearBlurResource() } } -void SuperBlurView::OnRelayout( const Vector2& size, RelayoutContainer& container ) -{ - unsigned int numChildren = Self().GetChildCount(); - - for( unsigned int i=0; i