X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Feffects-view%2Feffects-view-impl.cpp;h=44bc39bda77a5fe9bd6c7c02eeda032d4754c707;hb=518c9e7b5de69ff2401dffa6235a88e2dcf2bb72;hp=24f82bc5c11112eefb475b068979b9bf9538a732;hpb=831bd867847c32ac74b56c08757b0bed74f73238;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp index 24f82bc..44bc39b 100644 --- a/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp +++ b/dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,7 @@ #include #include #include +#include namespace Dali { @@ -66,6 +68,10 @@ const float ARBITRARY_FIELD_OF_VIEW = Math::PI / 4.0f; const Vector4 EFFECTS_VIEW_DEFAULT_BACKGROUND_COLOR( 1.0f, 1.0f, 1.0f, 0.0 ); const bool EFFECTS_VIEW_REFRESH_ON_DEMAND(false); +// Visuals are not stylable or public +const Property::Index CHILD_VISUAL( Toolkit::EffectsView::ANIMATABLE_PROPERTY_START_INDEX - 1); +const Property::Index POST_FILTER_VISUAL( CHILD_VISUAL-1 ); + #define DALI_COMPOSE_SHADER(STR) #STR const char* EFFECTS_VIEW_VERTEX_SOURCE = DALI_COMPOSE_SHADER( @@ -186,7 +192,9 @@ void EffectsView::SetType( Toolkit::EffectsView::EffectType type ) FrameBufferImage dummyImage = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat ); - InitializeVisual( self, mVisualPostFilter, dummyImage ); + Internal::InitializeVisual( self, mVisualPostFilter, dummyImage ); + RegisterVisual( POST_FILTER_VISUAL, mVisualPostFilter ); + Property::Map customShader; customShader[ Toolkit::Visual::Shader::Property::VERTEX_SHADER ] = EFFECTS_VIEW_VERTEX_SOURCE; customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = EFFECTS_VIEW_FRAGMENT_SOURCE; @@ -214,6 +222,7 @@ void EffectsView::Disable() // stop render tasks processing // Note: render target resources are automatically freed since we set the Image::Unused flag RemoveRenderTasks(); + mLastSize = Vector2::ZERO; // Ensure resources are reallocated on subsequent enable mEnabled = false; } @@ -302,16 +311,6 @@ void EffectsView::OnStageConnection( int depth ) Control::OnStageConnection( depth ); Enable(); - - Actor self = Self(); - if( mVisualPostFilter ) - { - mVisualPostFilter.SetOnStage( self ); - } - if( mVisualForChildren ) - { - mVisualForChildren.SetOnStage( self ); - } } void EffectsView::OnStageDisconnection() @@ -324,16 +323,6 @@ void EffectsView::OnStageDisconnection() mFilters[i]->Disable(); } - Actor self = Self(); - if( mVisualPostFilter ) - { - mVisualPostFilter.SetOffStage( self ); - } - if( mVisualForChildren ) - { - mVisualForChildren.SetOffStage( self ); - } - Control::OnStageDisconnection(); } @@ -437,7 +426,8 @@ void EffectsView::AllocateResources() Actor self( Self() ); mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat ); - InitializeVisual( self, mVisualForChildren, mImageForChildren ); + Internal::InitializeVisual( self, mVisualForChildren, mImageForChildren ); + RegisterVisual( CHILD_VISUAL, mVisualForChildren ); mVisualForChildren.SetDepthIndex( DepthIndex::CONTENT+1 ); mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );