X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fgaussian-blur-view%2Fgaussian-blur-view-impl.cpp;h=239d94ef537a9197274cbfae3556068e34eabbb6;hp=5a5e501ed1b79c269a1e6422354c9c6351e55e78;hb=d68f82fcef54dc3099b63f401e95e49abf0483f6;hpb=10d2080e1d25b75347daa2f8c2dcee494fbcb175 diff --git a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp index 5a5e501..239d94e 100644 --- a/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp +++ b/dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp @@ -21,7 +21,6 @@ // EXTERNAL INCLUDES #include #include -#include #include #include #include @@ -139,7 +138,7 @@ GaussianBlurView::GaussianBlurView() GaussianBlurView::GaussianBlurView( const unsigned int numSamples, const float blurBellCurveWidth, const Pixel::Format renderTargetPixelFormat, const float downsampleWidthScale, const float downsampleHeightScale, bool blurUserImage) - : Control( CONTROL_BEHAVIOUR_NONE ) + : Control( NO_SIZE_NEGOTIATION ) , mNumSamples(numSamples) , mBlurBellCurveWidth( 0.001f ) , mPixelFormat(renderTargetPixelFormat) @@ -242,18 +241,6 @@ Vector4 GaussianBlurView::GetBackgroundColor() const // Private methods // -/** - * EqualToConstraintFloat - * - * f(current, property) = property - */ -struct EqualToConstraintFloat -{ - EqualToConstraintFloat(){} - - float operator()(const float current, const PropertyInput& property) {return property.GetFloat();} -}; - void GaussianBlurView::OnInitialize() { // root actor to parent all user added actors, needed to allow us to set that subtree as exclusive for our child render task @@ -279,12 +266,14 @@ void GaussianBlurView::OnInitialize() // Create an ImageActor for performing a horizontal blur on the texture mImageActorHorizBlur = ImageActor::New(); + mImageActorHorizBlur.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mImageActorHorizBlur.SetParentOrigin(ParentOrigin::CENTER); mImageActorHorizBlur.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME mImageActorHorizBlur.SetShaderEffect( mHorizBlurShader ); // Create an ImageActor for performing a vertical blur on the texture mImageActorVertBlur = ImageActor::New(); + mImageActorVertBlur.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mImageActorVertBlur.SetParentOrigin(ParentOrigin::CENTER); mImageActorVertBlur.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME mImageActorVertBlur.SetShaderEffect( mVertBlurShader ); @@ -296,15 +285,18 @@ void GaussianBlurView::OnInitialize() if(!mBlurUserImage) { mImageActorComposite = ImageActor::New(); + mImageActorComposite.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mImageActorComposite.SetParentOrigin(ParentOrigin::CENTER); mImageActorComposite.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME mImageActorComposite.SetOpacity(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value - Constraint blurStrengthConstraint = Constraint::New( Actor::Property::COLOR_ALPHA, ParentSource(mBlurStrengthPropertyIndex), EqualToConstraintFloat()); - mImageActorComposite.ApplyConstraint(blurStrengthConstraint); + Constraint blurStrengthConstraint = Constraint::New( mImageActorComposite, Actor::Property::COLOR_ALPHA, EqualToConstraint()); + blurStrengthConstraint.AddSource( ParentSource(mBlurStrengthPropertyIndex) ); + blurStrengthConstraint.Apply(); // Create an ImageActor for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task mTargetActor = ImageActor::New(); + mTargetActor.SetResizePolicy( FILL_TO_PARENT, ALL_DIMENSIONS ); mTargetActor.SetParentOrigin(ParentOrigin::CENTER); mTargetActor.ScaleBy( Vector3(1.0f, -1.0f, 1.0f) ); // FIXME