2 * Copyright (c) 2023 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/npatch/npatch-visual.h>
22 #include <dali/devel-api/adaptor-framework/image-loading.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>
28 #include <dali-toolkit/devel-api/utility/npatch-helper.h>
29 #include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
30 #include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
31 #include <dali-toolkit/internal/visuals/image-atlas-manager.h>
32 #include <dali-toolkit/internal/visuals/image-visual-shader-factory.h>
33 #include <dali-toolkit/internal/visuals/image-visual-shader-feature-builder.h>
34 #include <dali-toolkit/internal/visuals/npatch-loader.h>
35 #include <dali-toolkit/internal/visuals/rendering-addon.h>
36 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
37 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
38 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
39 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
40 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
41 #include <dali-toolkit/public-api/visuals/visual-properties.h>
51 const int CUSTOM_PROPERTY_COUNT(5); // fixed(3),stretch,aux
54 /////////////////NPatchVisual////////////////
56 NPatchVisualPtr NPatchVisual::New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, const Property::Map& properties)
58 NPatchVisualPtr nPatchVisual(new NPatchVisual(factoryCache, shaderFactory));
59 nPatchVisual->mImageUrl = imageUrl;
60 nPatchVisual->SetProperties(properties);
61 nPatchVisual->Initialize();
65 NPatchVisualPtr NPatchVisual::New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl)
67 NPatchVisualPtr nPatchVisual(new NPatchVisual(factoryCache, shaderFactory));
68 nPatchVisual->mImageUrl = imageUrl;
69 nPatchVisual->Initialize();
73 void NPatchVisual::LoadImages()
75 TextureManager& textureManager = mFactoryCache.GetTextureManager();
76 bool synchronousLoading = mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
78 if(mId == NPatchData::INVALID_NPATCH_DATA_ID)
80 bool preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? true : false;
81 mId = mLoader.Load(textureManager, this, mImageUrl, mBorder, preMultiplyOnLoad, synchronousLoading);
84 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
86 EnablePreMultipliedAlpha(data->IsPreMultiplied());
90 if(mAuxiliaryTextureId == TextureManager::INVALID_TEXTURE_ID && mAuxiliaryUrl.IsValid())
92 auto preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader
93 ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD
94 : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
96 TextureManager::MaskingDataPointer maskingDataPtr = nullptr;
97 ImageAtlasManagerPtr imageAtlasManagerPtr = nullptr;
99 bool atlasing = false;
100 auto atlasRect = Vector4::ZERO;
101 auto atlasRectSize = Dali::ImageDimensions();
103 bool loadingStatus = false;
105 // Load the auxiliary image
106 mAuxiliaryTextureSet = textureManager.LoadTexture(mAuxiliaryUrl, Dali::ImageDimensions(), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, maskingDataPtr, synchronousLoading, mAuxiliaryTextureId, atlasRect, atlasRectSize, atlasing, loadingStatus, this, nullptr, imageAtlasManagerPtr, true, TextureManager::ReloadPolicy::CACHED, preMultiplyOnLoad);
108 if(mAuxiliaryTextureSet)
110 Sampler sampler = Sampler::New();
111 sampler.SetWrapMode(WrapMode::DEFAULT, WrapMode::DEFAULT);
112 mAuxiliaryTextureSet.SetSampler(0u, sampler);
115 // If synchronousLoading is true, we can check the auxiliaryResource's status now.
116 if(synchronousLoading)
118 mAuxiliaryResourceStatus = (mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u) ? Toolkit::Visual::ResourceStatus::READY : Toolkit::Visual::ResourceStatus::FAILED;
123 void NPatchVisual::GetNaturalSize(Vector2& naturalSize)
128 // load now if not already loaded
130 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
132 naturalSize.x = data->GetCroppedWidth();
133 naturalSize.y = data->GetCroppedHeight();
137 if(mImageUrl.IsValid())
139 ImageDimensions dimensions = Dali::GetOriginalImageSize(mImageUrl.GetUrl());
140 if(dimensions != ImageDimensions(0, 0))
142 naturalSize.x = dimensions.GetWidth();
143 naturalSize.y = dimensions.GetHeight();
148 if(mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u)
150 naturalSize.x = std::max(naturalSize.x, float(mAuxiliaryTextureSet.GetTexture(0u).GetWidth()));
151 naturalSize.y = std::max(naturalSize.y, float(mAuxiliaryTextureSet.GetTexture(0u).GetHeight()));
155 void NPatchVisual::DoSetProperties(const Property::Map& propertyMap)
157 // URL is already passed in via constructor
159 Property::Value* borderOnlyValue = propertyMap.Find(Toolkit::ImageVisual::Property::BORDER_ONLY, BORDER_ONLY);
162 borderOnlyValue->Get(mBorderOnly);
165 Property::Value* borderValue = propertyMap.Find(Toolkit::ImageVisual::Property::BORDER, BORDER);
166 if(borderValue && !borderValue->Get(mBorder)) // If value exists and is rect, just set mBorder
168 // Not a rect so try vector4
170 if(borderValue->Get(border))
172 mBorder.left = static_cast<int>(border.x);
173 mBorder.right = static_cast<int>(border.y);
174 mBorder.bottom = static_cast<int>(border.z);
175 mBorder.top = static_cast<int>(border.w);
179 Property::Value* auxImage = propertyMap.Find(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, AUXILIARY_IMAGE_NAME);
183 if(auxImage->Get(url))
189 Property::Value* auxImageAlpha = propertyMap.Find(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, AUXILIARY_IMAGE_ALPHA_NAME);
192 auxImageAlpha->Get(mAuxiliaryImageAlpha);
195 Property::Value* synchronousLoading = propertyMap.Find(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, SYNCHRONOUS_LOADING);
196 if(synchronousLoading)
199 synchronousLoading->Get(sync);
202 mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
206 mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
210 Property::Value* releasePolicy = propertyMap.Find(Toolkit::ImageVisual::Property::RELEASE_POLICY, RELEASE_POLICY_NAME);
213 releasePolicy->Get(mReleasePolicy);
217 void NPatchVisual::DoSetOnScene(Actor& actor)
219 // load when first go on stage
222 // Set mPlacementActor now, because some case, LoadImages can use this information in LoadComplete API.
223 // at this case, we try to SetResouce to mPlaceActor twice. so, we should avoid that case.
224 mPlacementActor = actor;
227 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
229 // If mAuxiliaryUrl need to be loaded, we should wait it until LoadComplete called.
230 if(!mAuxiliaryUrl.IsValid() || mAuxiliaryResourceStatus != Toolkit::Visual::ResourceStatus::PREPARING)
237 void NPatchVisual::DoSetOffScene(Actor& actor)
239 if(mReleasePolicy == Toolkit::ImageVisual::ReleasePolicy::DETACHED)
241 if(mId != NPatchData::INVALID_NPATCH_DATA_ID)
243 mLoader.RequestRemove(mId, this);
244 mImpl->mResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
245 mId = NPatchData::INVALID_NPATCH_DATA_ID;
247 if(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID)
249 TextureManager& textureManager = mFactoryCache.GetTextureManager();
250 textureManager.RequestRemove(mAuxiliaryTextureId, this);
251 mAuxiliaryTextureId = TextureManager::INVALID_TEXTURE_ID;
252 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
253 mAuxiliaryTextureSet.Reset();
257 actor.RemoveRenderer(mImpl->mRenderer);
258 mPlacementActor.Reset();
261 void NPatchVisual::OnSetTransform()
265 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
269 void NPatchVisual::DoCreatePropertyMap(Property::Map& map) const
272 bool sync = IsSynchronousLoadingRequired();
273 map.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, sync);
274 map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::N_PATCH);
275 map.Insert(Toolkit::ImageVisual::Property::URL, mImageUrl.GetUrl());
276 map.Insert(Toolkit::ImageVisual::Property::BORDER_ONLY, mBorderOnly);
277 map.Insert(Toolkit::ImageVisual::Property::BORDER, mBorder);
278 map.Insert(Toolkit::ImageVisual::Property::RELEASE_POLICY, mReleasePolicy);
280 if(mAuxiliaryUrl.IsValid())
282 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, mAuxiliaryUrl.GetUrl());
283 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, mAuxiliaryImageAlpha);
287 void NPatchVisual::DoCreateInstancePropertyMap(Property::Map& map) const
289 if(mAuxiliaryUrl.IsValid())
291 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, mAuxiliaryUrl.GetUrl());
292 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, mAuxiliaryImageAlpha);
296 NPatchVisual::NPatchVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory)
297 : Visual::Base(factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::N_PATCH),
299 mLoader(factoryCache.GetNPatchLoader()),
300 mImageVisualShaderFactory(shaderFactory),
303 mId(NPatchData::INVALID_NPATCH_DATA_ID),
304 mAuxiliaryTextureSet(),
305 mAuxiliaryTextureId(TextureManager::INVALID_TEXTURE_ID),
306 mAuxiliaryResourceStatus(Toolkit::Visual::ResourceStatus::PREPARING),
309 mAuxiliaryImageAlpha(0.0f),
310 mReleasePolicy(Toolkit::ImageVisual::ReleasePolicy::DETACHED)
312 EnablePreMultipliedAlpha(mFactoryCache.GetPreMultiplyOnLoad());
315 NPatchVisual::~NPatchVisual()
317 if(Stage::IsInstalled())
319 if(mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER)
321 if(mId != NPatchData::INVALID_NPATCH_DATA_ID)
323 mLoader.RequestRemove(mId, this);
324 mId = NPatchData::INVALID_NPATCH_DATA_ID;
326 if(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID)
328 TextureManager& textureManager = mFactoryCache.GetTextureManager();
330 textureManager.RequestRemove(mAuxiliaryTextureId, this);
331 mAuxiliaryTextureId = TextureManager::INVALID_TEXTURE_ID;
332 mAuxiliaryTextureSet.Reset();
338 void NPatchVisual::OnInitialize()
340 // Get basic geometry and shader
341 Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
342 auto imageVisualShaderFeatureBuilder = ImageVisualShaderFeatureBuilder();
343 Shader shader = mImageVisualShaderFactory.GetShader(
345 imageVisualShaderFeatureBuilder);
347 mImpl->mRenderer = VisualRenderer::New(geometry, shader);
348 mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
350 //Register transform properties
351 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
354 Geometry NPatchVisual::CreateGeometry()
358 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
360 if(data->GetStretchPixelsX().Size() == 1 && data->GetStretchPixelsY().Size() == 1)
362 if(DALI_UNLIKELY(mBorderOnly))
364 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY);
368 if(data->GetRenderingMap())
370 uint32_t elementCount[2];
371 geometry = RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), Uint16Pair(3, 3), elementCount);
374 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
379 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
383 else if(data->GetStretchPixelsX().Size() > 0 || data->GetStretchPixelsY().Size() > 0)
385 Uint16Pair gridSize(2 * data->GetStretchPixelsX().Size() + 1, 2 * data->GetStretchPixelsY().Size() + 1);
386 if(!data->GetRenderingMap())
388 geometry = !mBorderOnly ? NPatchHelper::CreateGridGeometry(gridSize) : NPatchHelper::CreateBorderGeometry(gridSize);
392 uint32_t elementCount[2];
393 geometry = !mBorderOnly ? RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), gridSize, elementCount) : NPatchHelper::CreateBorderGeometry(gridSize);
396 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
403 // no N patch data so use default geometry
404 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
409 Shader NPatchVisual::CreateShader()
413 // 0 is either no data (load failed?) or no stretch regions on image
414 // for both cases we use the default shader
415 NPatchUtility::StretchRanges::SizeType xStretchCount = 0;
416 NPatchUtility::StretchRanges::SizeType yStretchCount = 0;
418 auto fragmentShader = mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY ? SHADER_NPATCH_VISUAL_MASK_SHADER_FRAG
419 : SHADER_NPATCH_VISUAL_SHADER_FRAG;
420 auto shaderType = mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY ? VisualFactoryCache::NINE_PATCH_MASK_SHADER
421 : VisualFactoryCache::NINE_PATCH_SHADER;
423 // ask loader for the regions
424 if(mLoader.GetNPatchData(mId, data))
426 xStretchCount = data->GetStretchPixelsX().Count();
427 yStretchCount = data->GetStretchPixelsY().Count();
430 if(DALI_LIKELY(!mImpl->mCustomShader))
432 if(DALI_LIKELY((xStretchCount == 1 && yStretchCount == 1) ||
433 (xStretchCount == 0 && yStretchCount == 0)))
435 shader = mFactoryCache.GetShader(shaderType);
436 if(DALI_UNLIKELY(!shader))
438 shader = Shader::New(SHADER_NPATCH_VISUAL_3X3_SHADER_VERT, fragmentShader);
439 // Only cache vanilla 9 patch shaders
440 mFactoryCache.SaveShader(shaderType, shader);
443 else if(xStretchCount > 0 || yStretchCount > 0)
445 std::stringstream vertexShader;
446 vertexShader << "#define FACTOR_SIZE_X " << xStretchCount + 2 << "\n"
447 << "#define FACTOR_SIZE_Y " << yStretchCount + 2 << "\n"
448 << SHADER_NPATCH_VISUAL_SHADER_VERT;
450 shader = Shader::New(vertexShader.str(), fragmentShader);
455 Dali::Shader::Hint::Value hints = Dali::Shader::Hint::NONE;
457 if(!mImpl->mCustomShader->mFragmentShader.empty())
459 fragmentShader = mImpl->mCustomShader->mFragmentShader.c_str();
461 hints = mImpl->mCustomShader->mHints;
463 /* Apply Custom Vertex Shader only if image is 9-patch */
464 if((xStretchCount == 1 && yStretchCount == 1) ||
465 (xStretchCount == 0 && yStretchCount == 0))
467 const char* vertexShader = SHADER_NPATCH_VISUAL_3X3_SHADER_VERT.data();
469 if(!mImpl->mCustomShader->mVertexShader.empty())
471 vertexShader = mImpl->mCustomShader->mVertexShader.c_str();
473 shader = Shader::New(vertexShader, fragmentShader, hints);
475 else if(xStretchCount > 0 || yStretchCount > 0)
477 std::stringstream vertexShader;
478 vertexShader << "#define FACTOR_SIZE_X " << xStretchCount + 2 << "\n"
479 << "#define FACTOR_SIZE_Y " << yStretchCount + 2 << "\n"
480 << SHADER_NPATCH_VISUAL_SHADER_VERT;
482 shader = Shader::New(vertexShader.str(), fragmentShader, hints);
489 void NPatchVisual::ApplyTextureAndUniforms()
492 TextureSet textureSet;
494 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
496 textureSet = data->GetTextures();
497 NPatchHelper::ApplyTextureAndUniforms(mImpl->mRenderer, data.Get());
499 if(mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY)
501 DALI_ASSERT_ALWAYS(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID);
502 DALI_ASSERT_ALWAYS(mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u);
504 // TODO : This code exist due to the texture cache manager hold TextureSet, not Texture.
505 // If we call textureSet.SetTexture(1, texture) directly, the cached TextureSet also be changed.
506 // We should make pass utc-Dali-VisualFactory.cpp UtcDaliNPatchVisualAuxiliaryImage02().
507 TextureSet tempTextureSet = TextureSet::New();
508 tempTextureSet.SetTexture(1, mAuxiliaryTextureSet.GetTexture(0));
509 tempTextureSet.SetTexture(0, textureSet.GetTexture(0));
510 textureSet = tempTextureSet;
512 mImpl->mRenderer.RegisterProperty(DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA,
513 AUXILIARY_IMAGE_ALPHA_NAME,
514 mAuxiliaryImageAlpha);
516 mImpl->mRenderer.SetTextures(textureSet);
520 DALI_LOG_ERROR("The N patch image '%s' is not a valid N patch image\n", mImageUrl.GetUrl().c_str());
521 Actor actor = mPlacementActor.GetHandle();
522 Vector2 imageSize = Vector2::ZERO;
525 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
527 mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize, false);
530 // Register transform properties
531 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
534 Geometry NPatchVisual::GetNinePatchGeometry(VisualFactoryCache::GeometryType subType)
536 Geometry geometry = mFactoryCache.GetGeometry(subType);
539 if(DALI_LIKELY(VisualFactoryCache::NINE_PATCH_GEOMETRY == subType))
541 geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3, 3));
543 else if(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY == subType)
545 geometry = NPatchHelper::CreateBorderGeometry(Uint16Pair(3, 3));
547 mFactoryCache.SaveGeometry(subType, geometry);
552 void NPatchVisual::SetResource()
555 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data))
557 Geometry geometry = CreateGeometry();
558 Shader shader = CreateShader();
560 mImpl->mRenderer.SetGeometry(geometry);
561 mImpl->mRenderer.SetShader(shader);
563 if(RenderingAddOn::Get().IsValid())
565 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
567 Actor actor = mPlacementActor.GetHandle();
570 ApplyTextureAndUniforms();
571 actor.AddRenderer(mImpl->mRenderer);
572 mPlacementActor.Reset();
575 // npatch loaded and ready to display
576 if(data->GetLoadingState() != NPatchData::LoadingState::LOAD_COMPLETE)
578 ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
582 ResourceReady(Toolkit::Visual::ResourceStatus::READY);
587 void NPatchVisual::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
589 if(textureInformation.url.length() > 0) // For the Url.
591 if(DALI_UNLIKELY(mId == NPatchData::INVALID_NPATCH_DATA_ID))
593 // Special case when mLoader.Load call LoadComplete function before mId setup.
594 // We can overwrite mId.
595 mId = static_cast<NPatchData::NPatchDataId>(textureInformation.textureId);
599 EnablePreMultipliedAlpha(textureInformation.preMultiplied);
602 else // For the AuxiliaryUrl
604 if(DALI_UNLIKELY(mAuxiliaryTextureId == TextureManager::INVALID_TEXTURE_ID))
606 // Special case when TextureManager.LoadTexture call LoadComplete function before mAuxiliaryTextureId setup.
607 // We can overwrite mAuxiliaryTextureId.
608 mAuxiliaryTextureId = textureInformation.textureId;
612 mAuxiliaryTextureSet = textureInformation.textureSet;
613 if(mAuxiliaryTextureSet)
615 Sampler sampler = Sampler::New();
616 sampler.SetWrapMode(WrapMode::DEFAULT, WrapMode::DEFAULT);
617 mAuxiliaryTextureSet.SetSampler(0u, sampler);
620 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::READY;
624 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::FAILED;
628 // If auxiliaryUrl didn't required OR auxiliaryUrl load done.
629 if(!mAuxiliaryUrl.IsValid() || mAuxiliaryResourceStatus != Toolkit::Visual::ResourceStatus::PREPARING)
632 // and.. If Url loading done.
633 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
640 } // namespace Internal
642 } // namespace Toolkit