X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-gradient%2Fanimated-gradient-visual.cpp;h=5ef6044534a0367fa6e92c865f918b4c477d9719;hp=9b4bc8c4f2ccc54d42834770f14569e7b76de2a5;hb=ab447436de92a2e8bc8cd1393f4807f19ef6b316;hpb=893ca7b6b58b59ed4671daf867c4a319d8c9a770 diff --git a/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp b/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp index 9b4bc8c..5ef6044 100755 --- a/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-gradient/animated-gradient-visual.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -130,6 +130,7 @@ AnimatedGradientVisualPtr AnimatedGradientVisual::New( VisualFactoryCache& facto { AnimatedGradientVisualPtr animatedGradientVisualPtr( new AnimatedGradientVisual( factoryCache ) ); animatedGradientVisualPtr->SetProperties( properties ); + animatedGradientVisualPtr->Initialize(); return animatedGradientVisualPtr; } @@ -474,7 +475,6 @@ void AnimatedGradientVisual::OnSetTransform() void AnimatedGradientVisual::DoSetOnScene( Actor& actor ) { - InitializeRenderer(); actor.AddRenderer( mImpl->mRenderer ); SetupAnimation(); PlayAnimation(); @@ -488,7 +488,6 @@ void AnimatedGradientVisual::DoSetOffScene( Actor& actor ) StopAnimation(); actor.RemoveRenderer( mImpl->mRenderer ); - mImpl->mRenderer.Reset(); } void AnimatedGradientVisual::DoCreatePropertyMap( Property::Map& map ) const @@ -664,7 +663,7 @@ Shader AnimatedGradientVisual::CreateShader() return shader; } -void AnimatedGradientVisual::InitializeRenderer() +void AnimatedGradientVisual::OnInitialize() { Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY ); VisualFactoryCache::ShaderType shaderType = GetShaderType( mGradientType, mUnitType, mSpreadType );