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=7fd6fdf9d04a579eb785c2b812ae861038fd2368;hp=c4d744e2b9b63fed165b4ff96d029cffd0016689;hb=8a647e87a01c5c78451653c1264a9eea81ac9b20;hpb=01e4dc0b7f37621fa7c2798a4001213703a1ec20 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 c4d744e..7fd6fdf 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 @@ -23,11 +23,10 @@ #include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -37,6 +36,7 @@ // INTERNAL INCLUDES #include #include +#include // TODO: // pixel format / size - set from JSON @@ -143,6 +143,10 @@ GaussianBlurView::GaussianBlurView() mActivated( false ) { SetBlurBellCurveWidth(GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_BELL_CURVE_WIDTH); + DevelControl::SetAccessibilityConstructor( Self(), []( Dali::Actor actor ) { + return std::unique_ptr< Dali::Accessibility::Accessible >( + new Control::Impl::AccessibleImpl( actor, Dali::Accessibility::Role::FILLER ) ); + } ); } GaussianBlurView::GaussianBlurView( const unsigned int numSamples, @@ -207,19 +211,6 @@ Toolkit::GaussianBlurView GaussianBlurView::New(const unsigned int numSamples, c return handle; } -///////////////////////////////////////////////////////////// -// for creating a subtree for all user added child actors, so that we can have them exclusive to the mRenderChildrenTask and our other actors exclusive to our other tasks -// DEPRECATED: overloading Actor::Add()/Remove() not nice since breaks polymorphism. Need another method to pass ownership of added child actors to our internal actor root. -void GaussianBlurView::Add(Actor child) -{ - mChildrenRoot.Add(child); -} - -void GaussianBlurView::Remove(Actor child) -{ - mChildrenRoot.Remove(child); -} - void GaussianBlurView::SetUserImageAndOutputRenderTarget(Texture inputImage, FrameBuffer outputRenderTarget) { // can only do this if the GaussianBlurView object was created with this parameter set @@ -295,7 +286,7 @@ void GaussianBlurView::OnInitialize() { mCompositingActor = Actor::New(); mCompositingActor.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER ); - mCompositingActor.SetProperty( DevelActor::Property::OPACITY,GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value + mCompositingActor.SetProperty( Actor::Property::OPACITY,GAUSSIAN_BLUR_VIEW_DEFAULT_BLUR_STRENGTH); // ensure alpha is enabled for this object and set default value renderer = CreateRenderer( BASIC_VERTEX_SOURCE, BASIC_FRAGMENT_SOURCE ); mCompositingActor.AddRenderer( renderer ); @@ -341,19 +332,19 @@ void GaussianBlurView::OnSizeSet(const Vector3& targetSize) { mTargetSize = Vector2(targetSize); - mChildrenRoot.SetSize(targetSize); + mChildrenRoot.SetProperty( Actor::Property::SIZE, targetSize); if( !mBlurUserImage ) { - mCompositingActor.SetSize(targetSize); - mTargetActor.SetSize(targetSize); + mCompositingActor.SetProperty( Actor::Property::SIZE, targetSize); + mTargetActor.SetProperty( Actor::Property::SIZE, targetSize); // Children render camera must move when GaussianBlurView object is resized. This is since we cannot change render target size - so we need to remap the child actors' rendering // accordingly so they still exactly fill the render target. Note that this means the effective resolution of the child render changes as the GaussianBlurView object changes // size, this is the trade off for not being able to modify render target size // Change camera z position based on GaussianBlurView actor height float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f); - mRenderFullSizeCamera.SetZ(mTargetSize.height * cameraPosConstraintScale); + mRenderFullSizeCamera.SetProperty( Actor::Property::POSITION_Z, mTargetSize.height * cameraPosConstraintScale); } @@ -399,7 +390,7 @@ void GaussianBlurView::AllocateResources() mRenderDownsampledCamera.SetAspectRatio(mDownsampledWidth / mDownsampledHeight); mRenderDownsampledCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor - mRenderDownsampledCamera.SetPosition(0.0f, 0.0f, ((mDownsampledHeight * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f))); + mRenderDownsampledCamera.SetProperty( Actor::Property::POSITION, Vector3(0.0f, 0.0f, ((mDownsampledHeight * 0.5f) / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f)))); // setup for normal operation if(!mBlurUserImage) @@ -412,7 +403,7 @@ void GaussianBlurView::AllocateResources() mRenderFullSizeCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor float cameraPosConstraintScale = 0.5f / tanf(ARBITRARY_FIELD_OF_VIEW * 0.5f); - mRenderFullSizeCamera.SetPosition(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale); + mRenderFullSizeCamera.SetProperty( Actor::Property::POSITION, Vector3(0.0f, 0.0f, mTargetSize.height * cameraPosConstraintScale)); // create offscreen buffer of new size to render our child actors to mRenderTargetForRenderingChildren = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE ); @@ -440,10 +431,10 @@ void GaussianBlurView::AllocateResources() mRenderTarget2.AttachColorTexture( texture ); // size needs to match render target - mHorizBlurActor.SetSize(mDownsampledWidth, mDownsampledHeight); + mHorizBlurActor.SetProperty( Actor::Property::SIZE, Vector2(mDownsampledWidth, mDownsampledHeight) ); // size needs to match render target - mVertBlurActor.SetSize(mDownsampledWidth, mDownsampledHeight); + mVertBlurActor.SetProperty( Actor::Property::SIZE, Vector2(mDownsampledWidth, mDownsampledHeight) ); SetRendererTexture( mVertBlurActor.GetRendererAt(0), mRenderTarget2 ); // set gaussian blur up for new sized render targets