2 * Copyright (c) 2022 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
19 #include <dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.h>
22 #include <dali/devel-api/adaptor-framework/window-devel.h>
23 #include <dali/devel-api/common/stage.h>
24 #include <dali/devel-api/rendering/renderer-devel.h>
25 #include <dali/integration-api/debug.h>
26 #include <dali/public-api/rendering/decorated-visual-renderer.h>
29 #include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
30 #include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
31 #include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
32 #include <dali-toolkit/internal/visuals/animated-vector-image/vector-animation-manager.h>
33 #include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
34 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
35 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
36 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
37 #include <dali-toolkit/public-api/visuals/image-visual-properties.h>
38 #include <dali-toolkit/public-api/visuals/visual-properties.h>
48 const int CUSTOM_PROPERTY_COUNT(1); // pixel area,
50 const Dali::Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
53 DALI_ENUM_TO_STRING_TABLE_BEGIN(STOP_BEHAVIOR)
54 DALI_ENUM_TO_STRING_WITH_SCOPE(Dali::Toolkit::DevelImageVisual::StopBehavior, CURRENT_FRAME)
55 DALI_ENUM_TO_STRING_WITH_SCOPE(Dali::Toolkit::DevelImageVisual::StopBehavior, FIRST_FRAME)
56 DALI_ENUM_TO_STRING_WITH_SCOPE(Dali::Toolkit::DevelImageVisual::StopBehavior, LAST_FRAME)
57 DALI_ENUM_TO_STRING_TABLE_END(STOP_BEHAVIOR)
60 DALI_ENUM_TO_STRING_TABLE_BEGIN(LOOPING_MODE)
61 DALI_ENUM_TO_STRING_WITH_SCOPE(Dali::Toolkit::DevelImageVisual::LoopingMode, RESTART)
62 DALI_ENUM_TO_STRING_WITH_SCOPE(Dali::Toolkit::DevelImageVisual::LoopingMode, AUTO_REVERSE)
63 DALI_ENUM_TO_STRING_TABLE_END(LOOPING_MODE)
65 #if defined(DEBUG_ENABLED)
66 Debug::Filter* gVectorAnimationLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_VECTOR_ANIMATION");
69 } // unnamed namespace
71 AnimatedVectorImageVisualPtr AnimatedVectorImageVisual::New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, const Property::Map& properties)
73 AnimatedVectorImageVisualPtr visual(new AnimatedVectorImageVisual(factoryCache, shaderFactory, imageUrl));
74 visual->SetProperties(properties);
79 AnimatedVectorImageVisualPtr AnimatedVectorImageVisual::New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl)
81 AnimatedVectorImageVisualPtr visual(new AnimatedVectorImageVisual(factoryCache, shaderFactory, imageUrl));
86 AnimatedVectorImageVisual::AnimatedVectorImageVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl)
87 : Visual::Base(factoryCache, Visual::FittingMode::FILL, static_cast<Toolkit::Visual::Type>(Toolkit::DevelVisual::ANIMATED_VECTOR_IMAGE)),
90 mVectorAnimationTask(new VectorAnimationTask(factoryCache)),
91 mImageVisualShaderFactory(shaderFactory),
93 mVisualScale(Vector2::ONE),
95 mPlayState(DevelImageVisual::PlayState::STOPPED),
96 mEventCallback(nullptr),
98 mRendererAdded(false),
100 mRedrawInScalingDown(true)
102 // the rasterized image is with pre-multiplied alpha format
103 mImpl->mFlags |= Visual::Base::Impl::IS_PREMULTIPLIED_ALPHA;
105 if(!mVectorAnimationTask->Load(mUrl.GetUrl()))
110 mVectorAnimationTask->UploadCompletedSignal().Connect(this, &AnimatedVectorImageVisual::OnUploadCompleted);
111 mVectorAnimationTask->SetAnimationFinishedCallback(new EventThreadCallback(MakeCallback(this, &AnimatedVectorImageVisual::OnAnimationFinished)));
113 auto& vectorAnimationManager = mFactoryCache.GetVectorAnimationManager();
114 vectorAnimationManager.AddObserver(*this);
117 AnimatedVectorImageVisual::~AnimatedVectorImageVisual()
121 auto& vectorAnimationManager = mFactoryCache.GetVectorAnimationManager();
122 vectorAnimationManager.RemoveObserver(*this);
126 mFactoryCache.GetVectorAnimationManager().UnregisterEventCallback(mEventCallback);
129 // Finalize animation task and disconnect the signal in the main thread
130 mVectorAnimationTask->UploadCompletedSignal().Disconnect(this, &AnimatedVectorImageVisual::OnUploadCompleted);
131 mVectorAnimationTask->Finalize();
135 void AnimatedVectorImageVisual::VectorAnimationManagerDestroyed()
137 // Core is shutting down. Don't talk to the plugin any more.
138 mCoreShutdown = true;
141 void AnimatedVectorImageVisual::GetNaturalSize(Vector2& naturalSize)
143 if(mVisualSize != Vector2::ZERO)
145 naturalSize = mVisualSize;
149 uint32_t width, height;
150 mVectorAnimationTask->GetDefaultSize(width, height);
151 naturalSize.x = width;
152 naturalSize.y = height;
155 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::GetNaturalSize: w = %f, h = %f [%p]\n", naturalSize.width, naturalSize.height, this);
158 void AnimatedVectorImageVisual::DoCreatePropertyMap(Property::Map& map) const
161 map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::DevelVisual::ANIMATED_VECTOR_IMAGE);
164 map.Insert(Toolkit::ImageVisual::Property::URL, mUrl.GetUrl());
166 map.Insert(Toolkit::DevelImageVisual::Property::LOOP_COUNT, mAnimationData.loopCount);
168 uint32_t startFrame, endFrame;
169 mVectorAnimationTask->GetPlayRange(startFrame, endFrame);
171 Property::Array playRange;
172 playRange.PushBack(static_cast<int32_t>(startFrame));
173 playRange.PushBack(static_cast<int32_t>(endFrame));
174 map.Insert(Toolkit::DevelImageVisual::Property::PLAY_RANGE, playRange);
176 map.Insert(Toolkit::DevelImageVisual::Property::PLAY_STATE, static_cast<int32_t>(mPlayState));
177 map.Insert(Toolkit::DevelImageVisual::Property::CURRENT_FRAME_NUMBER, static_cast<int32_t>(mVectorAnimationTask->GetCurrentFrameNumber()));
178 map.Insert(Toolkit::DevelImageVisual::Property::TOTAL_FRAME_NUMBER, static_cast<int32_t>(mVectorAnimationTask->GetTotalFrameNumber()));
180 map.Insert(Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, mAnimationData.stopBehavior);
181 map.Insert(Toolkit::DevelImageVisual::Property::LOOPING_MODE, mAnimationData.loopingMode);
182 map.Insert(Toolkit::DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, mRedrawInScalingDown);
184 Property::Map layerInfo;
185 mVectorAnimationTask->GetLayerInfo(layerInfo);
186 map.Insert(Toolkit::DevelImageVisual::Property::CONTENT_INFO, layerInfo);
189 void AnimatedVectorImageVisual::DoCreateInstancePropertyMap(Property::Map& map) const
194 void AnimatedVectorImageVisual::EnablePreMultipliedAlpha(bool preMultiplied)
196 // Make always enable pre multiplied alpha whether preMultiplied value is false.
199 DALI_LOG_WARNING("Note : AnimatedVectorVisual cannot disable PreMultipliedAlpha\n");
203 void AnimatedVectorImageVisual::DoSetProperties(const Property::Map& propertyMap)
205 // url already passed in from constructor
206 for(Property::Map::SizeType iter = 0; iter < propertyMap.Count(); ++iter)
208 KeyValuePair keyValue = propertyMap.GetKeyValue(iter);
209 if(keyValue.first.type == Property::Key::INDEX)
211 DoSetProperty(keyValue.first.indexKey, keyValue.second);
215 if(keyValue.first == LOOP_COUNT_NAME)
217 DoSetProperty(Toolkit::DevelImageVisual::Property::LOOP_COUNT, keyValue.second);
219 else if(keyValue.first == PLAY_RANGE_NAME)
221 DoSetProperty(Toolkit::DevelImageVisual::Property::PLAY_RANGE, keyValue.second);
223 else if(keyValue.first == STOP_BEHAVIOR_NAME)
225 DoSetProperty(Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR, keyValue.second);
227 else if(keyValue.first == LOOPING_MODE_NAME)
229 DoSetProperty(Toolkit::DevelImageVisual::Property::LOOPING_MODE, keyValue.second);
231 else if(keyValue.first == REDRAW_IN_SCALING_DOWN_NAME)
233 DoSetProperty(Toolkit::DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN, keyValue.second);
238 TriggerVectorRasterization();
241 void AnimatedVectorImageVisual::DoSetProperty(Property::Index index, const Property::Value& value)
245 case Toolkit::DevelImageVisual::Property::LOOP_COUNT:
248 if(value.Get(loopCount))
250 mAnimationData.loopCount = loopCount;
251 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_LOOP_COUNT;
255 case Toolkit::DevelImageVisual::Property::PLAY_RANGE:
257 const Property::Array* array = value.GetArray();
260 mAnimationData.playRange = *array;
261 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_RANGE;
265 case Toolkit::DevelImageVisual::Property::STOP_BEHAVIOR:
267 int32_t stopBehavior = mAnimationData.stopBehavior;
268 if(Scripting::GetEnumerationProperty(value, STOP_BEHAVIOR_TABLE, STOP_BEHAVIOR_TABLE_COUNT, stopBehavior))
270 mAnimationData.stopBehavior = DevelImageVisual::StopBehavior::Type(stopBehavior);
271 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_STOP_BEHAVIOR;
275 case Toolkit::DevelImageVisual::Property::LOOPING_MODE:
277 int32_t loopingMode = mAnimationData.loopingMode;
278 if(Scripting::GetEnumerationProperty(value, LOOPING_MODE_TABLE, LOOPING_MODE_TABLE_COUNT, loopingMode))
280 mAnimationData.loopingMode = DevelImageVisual::LoopingMode::Type(loopingMode);
281 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_LOOPING_MODE;
285 case Toolkit::DevelImageVisual::Property::REDRAW_IN_SCALING_DOWN:
288 if(value.Get(redraw))
290 mRedrawInScalingDown = redraw;
297 void AnimatedVectorImageVisual::OnInitialize(void)
299 Shader shader = GenerateShader();
301 Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
303 mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
304 mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
306 TextureSet textureSet = TextureSet::New();
307 mImpl->mRenderer.SetTextures(textureSet);
309 // Register transform properties
310 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
313 void AnimatedVectorImageVisual::DoSetOnScene(Actor& actor)
315 // Defer the rasterisation task until we get given a size (by Size Negotiation algorithm)
317 // Hold the weak handle of the placement actor and delay the adding of renderer until the rasterization is finished.
318 mPlacementActor = actor;
322 Vector2 imageSize = Vector2::ZERO;
323 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
324 mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize);
325 actor.AddRenderer(mImpl->mRenderer);
326 ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
330 mVectorAnimationTask->SetRenderer(mImpl->mRenderer);
332 // Add property notification for scaling & size
333 mScaleNotification = actor.AddPropertyNotification(Actor::Property::WORLD_SCALE, StepCondition(0.1f, 1.0f));
334 mScaleNotification.NotifySignal().Connect(this, &AnimatedVectorImageVisual::OnScaleNotification);
336 mSizeNotification = actor.AddPropertyNotification(Actor::Property::SIZE, StepCondition(3.0f));
337 mSizeNotification.NotifySignal().Connect(this, &AnimatedVectorImageVisual::OnSizeNotification);
339 DevelActor::VisibilityChangedSignal(actor).Connect(this, &AnimatedVectorImageVisual::OnControlVisibilityChanged);
341 Window window = DevelWindow::Get(actor);
344 DevelWindow::VisibilityChangedSignal(window).Connect(this, &AnimatedVectorImageVisual::OnWindowVisibilityChanged);
348 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::DoSetOnScene [%p]\n", this);
351 void AnimatedVectorImageVisual::DoSetOffScene(Actor& actor)
358 actor.RemoveRenderer(mImpl->mRenderer);
359 mRendererAdded = false;
362 // Remove property notification
363 actor.RemovePropertyNotification(mScaleNotification);
364 actor.RemovePropertyNotification(mSizeNotification);
366 DevelActor::VisibilityChangedSignal(actor).Disconnect(this, &AnimatedVectorImageVisual::OnControlVisibilityChanged);
368 Window window = DevelWindow::Get(actor);
371 DevelWindow::VisibilityChangedSignal(window).Disconnect(this, &AnimatedVectorImageVisual::OnWindowVisibilityChanged);
374 mPlacementActor.Reset();
376 // Reset the visual size to zero so that when adding the actor back to stage the rasterization is forced
377 mVisualSize = Vector2::ZERO;
378 mVisualScale = Vector2::ONE;
380 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::DoSetOffScene [%p]\n", this);
383 void AnimatedVectorImageVisual::OnSetTransform()
385 Vector2 visualSize = mImpl->mTransform.GetVisualSize(mImpl->mControlSize);
387 if(IsOnScene() && visualSize != mVisualSize)
389 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnSetTransform: width = %f, height = %f [%p]\n", visualSize.width, visualSize.height, this);
391 mVisualSize = visualSize;
393 SetVectorImageSize();
395 if(mPlayState == DevelImageVisual::PlayState::PLAYING && mAnimationData.playState != DevelImageVisual::PlayState::PLAYING)
397 mAnimationData.playState = DevelImageVisual::PlayState::PLAYING;
398 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
405 void AnimatedVectorImageVisual::UpdateShader()
409 Shader shader = GenerateShader();
410 mImpl->mRenderer.SetShader(shader);
414 void AnimatedVectorImageVisual::OnDoAction(const Property::Index actionId, const Property::Value& attributes)
416 // Check if action is valid for this visual type and perform action if possible
419 case DevelAnimatedVectorImageVisual::Action::PLAY:
421 if(IsOnScene() && mVisualSize != Vector2::ZERO)
423 if(mAnimationData.playState != DevelImageVisual::PlayState::PLAYING)
425 mAnimationData.playState = DevelImageVisual::PlayState::PLAYING;
426 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
429 mPlayState = DevelImageVisual::PlayState::PLAYING;
432 case DevelAnimatedVectorImageVisual::Action::PAUSE:
434 if(mAnimationData.playState == DevelImageVisual::PlayState::PLAYING)
436 mAnimationData.playState = DevelImageVisual::PlayState::PAUSED;
437 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
439 mPlayState = DevelImageVisual::PlayState::PAUSED;
442 case DevelAnimatedVectorImageVisual::Action::STOP:
444 if(mAnimationData.playState != DevelImageVisual::PlayState::STOPPED)
446 mAnimationData.playState = DevelImageVisual::PlayState::STOPPED;
447 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
449 mPlayState = DevelImageVisual::PlayState::STOPPED;
452 case DevelAnimatedVectorImageVisual::Action::JUMP_TO:
455 if(attributes.Get(frameNumber))
457 mAnimationData.currentFrame = frameNumber;
458 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_CURRENT_FRAME;
464 TriggerVectorRasterization();
467 void AnimatedVectorImageVisual::OnUploadCompleted()
469 // If weak handle is holding a placement actor, it is the time to add the renderer to actor.
470 Actor actor = mPlacementActor.GetHandle();
471 if(actor && !mRendererAdded)
473 actor.AddRenderer(mImpl->mRenderer);
474 mRendererAdded = true;
476 ResourceReady(Toolkit::Visual::ResourceStatus::READY);
478 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnUploadCompleted: Renderer is added [%p]\n", this);
482 void AnimatedVectorImageVisual::OnAnimationFinished()
484 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnAnimationFinished: action state = %d [%p]\n", mPlayState, this);
486 if(mPlayState != DevelImageVisual::PlayState::STOPPED)
488 mPlayState = DevelImageVisual::PlayState::STOPPED;
490 mAnimationData.playState = DevelImageVisual::PlayState::STOPPED;
492 if(mImpl->mEventObserver)
494 mImpl->mEventObserver->NotifyVisualEvent(*this, DevelAnimatedVectorImageVisual::Signal::ANIMATION_FINISHED);
500 mImpl->mRenderer.SetProperty(DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED);
504 void AnimatedVectorImageVisual::SendAnimationData()
506 if(mAnimationData.resendFlag)
508 mVectorAnimationTask->SetAnimationData(mAnimationData);
512 if(mAnimationData.playState == DevelImageVisual::PlayState::PLAYING)
514 mImpl->mRenderer.SetProperty(DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::CONTINUOUSLY);
518 mImpl->mRenderer.SetProperty(DevelRenderer::Property::RENDERING_BEHAVIOR, DevelRenderer::Rendering::IF_REQUIRED);
522 mAnimationData.resendFlag = 0;
526 void AnimatedVectorImageVisual::SetVectorImageSize()
528 uint32_t width = static_cast<uint32_t>(mVisualSize.width * mVisualScale.width);
529 uint32_t height = static_cast<uint32_t>(mVisualSize.height * mVisualScale.height);
531 mAnimationData.width = width;
532 mAnimationData.height = height;
533 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_SIZE;
536 void AnimatedVectorImageVisual::StopAnimation()
538 if(mAnimationData.playState != DevelImageVisual::PlayState::STOPPED)
540 mAnimationData.playState = DevelImageVisual::PlayState::STOPPED;
541 mAnimationData.resendFlag |= VectorAnimationTask::RESEND_PLAY_STATE;
543 mPlayState = DevelImageVisual::PlayState::STOPPED;
547 void AnimatedVectorImageVisual::TriggerVectorRasterization()
549 if(!mEventCallback && !mCoreShutdown)
551 mEventCallback = MakeCallback(this, &AnimatedVectorImageVisual::OnProcessEvents);
552 auto& vectorAnimationManager = mFactoryCache.GetVectorAnimationManager();
553 vectorAnimationManager.RegisterEventCallback(mEventCallback);
554 Stage::GetCurrent().KeepRendering(0.0f); // Trigger event processing
558 void AnimatedVectorImageVisual::OnScaleNotification(PropertyNotification& source)
560 Actor actor = mPlacementActor.GetHandle();
563 Vector3 scale = actor.GetProperty<Vector3>(Actor::Property::WORLD_SCALE);
565 if(mRedrawInScalingDown || scale.width >= 1.0f || scale.height >= 1.0f)
567 mVisualScale.width = scale.width;
568 mVisualScale.height = scale.height;
570 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnScaleNotification: scale = %f, %f [%p]\n", mVisualScale.width, mVisualScale.height, this);
572 SetVectorImageSize();
575 Stage::GetCurrent().KeepRendering(0.0f); // Trigger event processing
580 void AnimatedVectorImageVisual::OnSizeNotification(PropertyNotification& source)
582 Actor actor = mPlacementActor.GetHandle();
585 Vector3 size = actor.GetCurrentProperty<Vector3>(Actor::Property::SIZE);
586 mVisualSize.width = size.width;
587 mVisualSize.height = size.height;
589 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnSizeNotification: size = %f, %f [%p]\n", mVisualSize.width, mVisualSize.height, this);
591 SetVectorImageSize();
594 Stage::GetCurrent().KeepRendering(0.0f); // Trigger event processing
598 void AnimatedVectorImageVisual::OnControlVisibilityChanged(Actor actor, bool visible, DevelActor::VisibilityChange::Type type)
603 TriggerVectorRasterization();
605 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnControlVisibilityChanged: invisibile. Pause animation [%p]\n", this);
609 void AnimatedVectorImageVisual::OnWindowVisibilityChanged(Window window, bool visible)
614 TriggerVectorRasterization();
616 DALI_LOG_INFO(gVectorAnimationLogFilter, Debug::Verbose, "AnimatedVectorImageVisual::OnWindowVisibilityChanged: invisibile. Pause animation [%p]\n", this);
620 void AnimatedVectorImageVisual::OnProcessEvents()
624 mEventCallback = nullptr; // The callback will be deleted in the VectorAnimationManager
627 Shader AnimatedVectorImageVisual::GenerateShader() const
630 if(mImpl->mCustomShader)
632 shader = Shader::New(mImpl->mCustomShader->mVertexShader.empty() ? mImageVisualShaderFactory.GetVertexShaderSource().data() : mImpl->mCustomShader->mVertexShader,
633 mImpl->mCustomShader->mFragmentShader.empty() ? mImageVisualShaderFactory.GetFragmentShaderSource().data() : mImpl->mCustomShader->mFragmentShader,
634 mImpl->mCustomShader->mHints);
636 shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
640 shader = mImageVisualShaderFactory.GetShader(
642 ImageVisualShaderFeature::FeatureBuilder()
643 .EnableRoundedCorner(IsRoundedCornerRequired())
644 .EnableBorderline(IsBorderlineRequired()));
649 } // namespace Internal
651 } // namespace Toolkit