X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fshadow-view%2Fshadow-view-impl.cpp;h=7ae8fa413a9a5dee46b70b609dbcaa958ea1e09b;hp=80682f1671b5b5bebeadc0e0881cbec8d3eca5e2;hb=e9d852fcdacc5788785bfe0b617bd757794e8208;hpb=2da985674b8a2344bc07ea3cf02f05d86d512249 diff --git a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp index 80682f1..7ae8fa4 100644 --- a/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp +++ b/dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp @@ -36,7 +36,6 @@ // pixel format / size - set from JSON // aspect ratio property needs to be able to be constrained also for cameras. (now do-able) // default near clip value -// mChildrenRoot Add()/Remove() overloads - better solution ///////////////////////////////////////////////////////// @@ -148,19 +147,6 @@ Toolkit::ShadowView ShadowView::New(float downsampleWidthScale, float downsample return handle; } -///////////////////////////////////////////////////////////// -// for creating a subtree for all user added child actors. -// TODO: 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 ShadowView::Add(Actor child) -{ - mChildrenRoot.Add(child); -} - -void ShadowView::Remove(Actor child) -{ - mChildrenRoot.Remove(child); -} - void ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground) { mShadowPlaneBg = shadowPlaneBackground; @@ -241,7 +227,7 @@ void ShadowView::Deactivate() void ShadowView::OnInitialize() { // root actor to parent all user added actors. Used as source actor for shadow render task. - mChildrenRoot.SetPositionInheritanceMode( Dali::USE_PARENT_POSITION ); + mChildrenRoot.SetParentOrigin( ParentOrigin::CENTER ); mChildrenRoot.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS ); Vector2 stageSize = Stage::GetCurrent().GetSize(); @@ -257,13 +243,13 @@ void ShadowView::OnInitialize() Property::Map customShader; - customShader[ "vertex-shader" ] = RENDER_SHADOW_VERTEX_SOURCE; - customShader[ "fragment-shader" ] = RENDER_SHADOW_FRAGMENT_SOURCE; + customShader[ "vertexShader" ] = RENDER_SHADOW_VERTEX_SOURCE; + customShader[ "fragmentShader" ] = RENDER_SHADOW_FRAGMENT_SOURCE; - customShader[ "subdivide-grid-x" ] = 20; - customShader[ "subdivide-grid-y" ] = 20; + customShader[ "subdivideGridX" ] = 20; + customShader[ "subdivideGridY" ] = 20; - customShader[ "hints" ] = "output-is-transparent"; + customShader[ "hints" ] = "outputIsTransparent"; mShadowRenderShader[ "shader" ] = customShader; @@ -288,7 +274,7 @@ void ShadowView::OnInitialize() mBlurRootActor.SetName( "BLUR_ROOT_ACTOR" ); // Turn off inheritance to ensure filter renders properly - mBlurRootActor.SetPositionInheritanceMode(USE_PARENT_POSITION); + mBlurRootActor.SetParentOrigin( ParentOrigin::CENTER ); mBlurRootActor.SetInheritOrientation(false); mBlurRootActor.SetInheritScale(false); mBlurRootActor.SetColorMode(USE_OWN_COLOR); @@ -307,8 +293,21 @@ void ShadowView::OnInitialize() blurStrengthConstraint.Apply(); } -void ShadowView::OnSizeSet(const Vector3& targetSize) +void ShadowView::OnChildAdd( Actor& child ) { + Control::OnChildAdd( child ); + + if( child != mChildrenRoot && child != mBlurRootActor) + { + mChildrenRoot.Add( child ); + } +} + +void ShadowView::OnChildRemove( Actor& child ) +{ + mChildrenRoot.Remove( child ); + + Control::OnChildRemove( child ); } void ShadowView::ConstrainCamera()