X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fanimated-image%2Fanimated-image-visual.cpp;h=d8d61d3136146bd34c45306fe2124e57824d5105;hp=c9623a6f42534e444c03bae22d3bc7de3341d9bf;hb=d2a6f4d721fbc03b51d4f1328a58b1fa65f90d43;hpb=d74d70d51ed70b00e29a2b6feac5419124fffc49 diff --git a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp index c9623a6..d8d61d3 100644 --- a/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp +++ b/dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp @@ -187,9 +187,9 @@ AnimatedImageVisual::AnimatedImageVisual(VisualFactoryCache& factoryCache, Image mUrlIndex(0), mFrameCount(0), mImageSize(), + mActionStatus(DevelAnimatedImageVisual::Action::PLAY), mWrapModeU(WrapMode::DEFAULT), mWrapModeV(WrapMode::DEFAULT), - mActionStatus(DevelAnimatedImageVisual::Action::PLAY), mStopBehavior(DevelImageVisual::StopBehavior::CURRENT_FRAME), mStartFirstFrame(false), mIsJumpTo(false) @@ -535,11 +535,19 @@ void AnimatedImageVisual::OnSetTransform() } } +void AnimatedImageVisual::UpdateShader() +{ + if(mImpl->mRenderer) + { + Shader shader = GenerateShader(); + mImpl->mRenderer.SetShader(shader); + } +} + void AnimatedImageVisual::OnInitialize() { bool defaultWrapMode = mWrapModeU <= WrapMode::CLAMP_TO_EDGE && mWrapModeV <= WrapMode::CLAMP_TO_EDGE; - bool atlasing = false; - Shader shader = mImageVisualShaderFactory.GetShader(mFactoryCache, atlasing, defaultWrapMode, IsRoundedCornerRequired()); + Shader shader = GenerateShader(); Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY); @@ -799,9 +807,14 @@ TextureSet AnimatedImageVisual::SetLoadingFailed() DALI_LOG_INFO(gAnimImgLogFilter, Debug::Concise, "ResourceReady(ResourceStatus::FAILED)\n"); ResourceReady(Toolkit::Visual::ResourceStatus::FAILED); - TextureSet textureSet = TextureSet::New(); - Texture brokenImage = mFactoryCache.GetBrokenVisualImage(); - textureSet.SetTexture(0u, brokenImage); + Actor actor = mPlacementActor.GetHandle(); + Vector2 imageSize = Vector2::ZERO; + if(actor) + { + imageSize = actor.GetProperty(Actor::Property::SIZE).Get(); + } + mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize); + TextureSet textureSet = mImpl->mRenderer.GetTextures(); if(mFrameDelayTimer) { @@ -814,6 +827,19 @@ TextureSet AnimatedImageVisual::SetLoadingFailed() return textureSet; } +Shader AnimatedImageVisual::GenerateShader() const +{ + bool defaultWrapMode = mWrapModeU <= WrapMode::CLAMP_TO_EDGE && mWrapModeV <= WrapMode::CLAMP_TO_EDGE; + Shader shader; + shader = mImageVisualShaderFactory.GetShader( + mFactoryCache, + TextureAtlas::DISABLED, + defaultWrapMode ? DefaultTextureWrapMode::APPLY : DefaultTextureWrapMode::DO_NOT_APPLY, + IsRoundedCornerRequired() ? RoundedCorner::ENABLED : RoundedCorner::DISABLED, + IsBorderlineRequired() ? Borderline::ENABLED : Borderline::DISABLED); + return shader; +} + } // namespace Internal } // namespace Toolkit