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 "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/npatch-loader.h>
34 #include <dali-toolkit/internal/visuals/rendering-addon.h>
35 #include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
36 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
37 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
38 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
39 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
40 #include <dali-toolkit/public-api/visuals/visual-properties.h>
50 const int CUSTOM_PROPERTY_COUNT(5); // fixed(3),stretch,aux
53 /////////////////NPatchVisual////////////////
55 NPatchVisualPtr NPatchVisual::New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl, const Property::Map& properties)
57 NPatchVisualPtr nPatchVisual(new NPatchVisual(factoryCache, shaderFactory));
58 nPatchVisual->mImageUrl = imageUrl;
59 nPatchVisual->SetProperties(properties);
60 nPatchVisual->Initialize();
64 NPatchVisualPtr NPatchVisual::New(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory, const VisualUrl& imageUrl)
66 NPatchVisualPtr nPatchVisual(new NPatchVisual(factoryCache, shaderFactory));
67 nPatchVisual->mImageUrl = imageUrl;
68 nPatchVisual->Initialize();
72 void NPatchVisual::LoadImages()
74 TextureManager& textureManager = mFactoryCache.GetTextureManager();
75 bool synchronousLoading = mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
77 if(mId == NPatchData::INVALID_NPATCH_DATA_ID && (mImageUrl.IsLocalResource() || mImageUrl.IsBufferResource()))
79 bool preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? true : false;
80 mId = mLoader.Load(textureManager, this, mImageUrl, mBorder, preMultiplyOnLoad, synchronousLoading);
82 const NPatchData* data;
83 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
85 EnablePreMultipliedAlpha(data->IsPreMultiplied());
89 if(mAuxiliaryTextureId == TextureManager::INVALID_TEXTURE_ID && mAuxiliaryUrl.IsValid() && (mAuxiliaryUrl.IsLocalResource() || mAuxiliaryUrl.IsBufferResource()))
91 auto preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader
92 ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD
93 : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
95 TextureManager::MaskingDataPointer maskingDataPtr = nullptr;
96 ImageAtlasManagerPtr imageAtlasManagerPtr = nullptr;
98 bool atlasing = false;
99 auto atlasRect = Vector4::ZERO;
100 auto atlasRectSize = Dali::ImageDimensions();
102 bool loadingStatus = false;
104 // Load the auxiliary image
105 mAuxiliaryTextureSet = textureManager.LoadTexture(mAuxiliaryUrl, Dali::ImageDimensions(), FittingMode::DEFAULT, SamplingMode::BOX_THEN_LINEAR, maskingDataPtr, synchronousLoading, mAuxiliaryTextureId, atlasRect, atlasRectSize, atlasing, loadingStatus, WrapMode::DEFAULT, WrapMode::DEFAULT, this, nullptr, imageAtlasManagerPtr, true, TextureManager::ReloadPolicy::CACHED, preMultiplyOnLoad);
107 // If synchronousLoading is true, we can check the auxiliaryResource's status now.
108 if(synchronousLoading)
110 mAuxiliaryResourceStatus = (mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u) ? Toolkit::Visual::ResourceStatus::READY : Toolkit::Visual::ResourceStatus::FAILED;
115 void NPatchVisual::GetNaturalSize(Vector2& naturalSize)
120 // load now if not already loaded
121 const NPatchData* data;
122 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
124 naturalSize.x = data->GetCroppedWidth();
125 naturalSize.y = data->GetCroppedHeight();
129 if(mImageUrl.IsValid())
131 ImageDimensions dimensions = Dali::GetOriginalImageSize(mImageUrl.GetUrl());
132 if(dimensions != ImageDimensions(0, 0))
134 naturalSize.x = dimensions.GetWidth();
135 naturalSize.y = dimensions.GetHeight();
140 if(mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u)
142 naturalSize.x = std::max(naturalSize.x, float(mAuxiliaryTextureSet.GetTexture(0u).GetWidth()));
143 naturalSize.y = std::max(naturalSize.y, float(mAuxiliaryTextureSet.GetTexture(0u).GetHeight()));
147 void NPatchVisual::DoSetProperties(const Property::Map& propertyMap)
149 // URL is already passed in via constructor
151 Property::Value* borderOnlyValue = propertyMap.Find(Toolkit::ImageVisual::Property::BORDER_ONLY, BORDER_ONLY);
154 borderOnlyValue->Get(mBorderOnly);
157 Property::Value* borderValue = propertyMap.Find(Toolkit::ImageVisual::Property::BORDER, BORDER);
158 if(borderValue && !borderValue->Get(mBorder)) // If value exists and is rect, just set mBorder
160 // Not a rect so try vector4
162 if(borderValue->Get(border))
164 mBorder.left = static_cast<int>(border.x);
165 mBorder.right = static_cast<int>(border.y);
166 mBorder.bottom = static_cast<int>(border.z);
167 mBorder.top = static_cast<int>(border.w);
171 Property::Value* auxImage = propertyMap.Find(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, AUXILIARY_IMAGE_NAME);
175 if(auxImage->Get(url))
181 Property::Value* auxImageAlpha = propertyMap.Find(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, AUXILIARY_IMAGE_ALPHA_NAME);
184 auxImageAlpha->Get(mAuxiliaryImageAlpha);
187 Property::Value* synchronousLoading = propertyMap.Find(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, SYNCHRONOUS_LOADING);
188 if(synchronousLoading)
191 synchronousLoading->Get(sync);
194 mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
198 mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
202 Property::Value* releasePolicy = propertyMap.Find(Toolkit::ImageVisual::Property::RELEASE_POLICY, RELEASE_POLICY_NAME);
205 releasePolicy->Get(mReleasePolicy);
209 void NPatchVisual::DoSetOnScene(Actor& actor)
211 // load when first go on stage
214 // Set mPlacementActor now, because some case, LoadImages can use this information in LoadComplete API.
215 // at this case, we try to SetResouce to mPlaceActor twice. so, we should avoid that case.
216 mPlacementActor = actor;
218 const NPatchData* data;
219 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
221 // If mAuxiliaryUrl need to be loaded, we should wait it until LoadComplete called.
222 if(!mAuxiliaryUrl.IsValid() || mAuxiliaryResourceStatus != Toolkit::Visual::ResourceStatus::PREPARING)
229 void NPatchVisual::DoSetOffScene(Actor& actor)
231 if(mReleasePolicy == Toolkit::ImageVisual::ReleasePolicy::DETACHED)
233 if(mId != NPatchData::INVALID_NPATCH_DATA_ID)
235 mLoader.Remove(mId, this);
236 mImpl->mResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
237 mId = NPatchData::INVALID_NPATCH_DATA_ID;
239 if(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID)
241 TextureManager& textureManager = mFactoryCache.GetTextureManager();
242 textureManager.Remove(mAuxiliaryTextureId, this);
243 mAuxiliaryTextureId = TextureManager::INVALID_TEXTURE_ID;
244 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
245 mAuxiliaryTextureSet.Reset();
249 actor.RemoveRenderer(mImpl->mRenderer);
250 mPlacementActor.Reset();
253 void NPatchVisual::OnSetTransform()
257 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
261 void NPatchVisual::DoCreatePropertyMap(Property::Map& map) const
264 bool sync = IsSynchronousLoadingRequired();
265 map.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, sync);
266 map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::N_PATCH);
267 map.Insert(Toolkit::ImageVisual::Property::URL, mImageUrl.GetUrl());
268 map.Insert(Toolkit::ImageVisual::Property::BORDER_ONLY, mBorderOnly);
269 map.Insert(Toolkit::ImageVisual::Property::BORDER, mBorder);
270 map.Insert(Toolkit::ImageVisual::Property::RELEASE_POLICY, mReleasePolicy);
272 if(mAuxiliaryUrl.IsValid())
274 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, mAuxiliaryUrl.GetUrl());
275 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, mAuxiliaryImageAlpha);
279 void NPatchVisual::DoCreateInstancePropertyMap(Property::Map& map) const
281 if(mAuxiliaryUrl.IsValid())
283 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, mAuxiliaryUrl.GetUrl());
284 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, mAuxiliaryImageAlpha);
288 NPatchVisual::NPatchVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory)
289 : Visual::Base(factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::N_PATCH),
291 mLoader(factoryCache.GetNPatchLoader()),
292 mImageVisualShaderFactory(shaderFactory),
295 mId(NPatchData::INVALID_NPATCH_DATA_ID),
296 mAuxiliaryTextureSet(),
297 mAuxiliaryTextureId(TextureManager::INVALID_TEXTURE_ID),
298 mAuxiliaryResourceStatus(Toolkit::Visual::ResourceStatus::PREPARING),
301 mAuxiliaryImageAlpha(0.0f),
302 mReleasePolicy(Toolkit::ImageVisual::ReleasePolicy::DETACHED)
304 EnablePreMultipliedAlpha(mFactoryCache.GetPreMultiplyOnLoad());
307 NPatchVisual::~NPatchVisual()
309 if(Stage::IsInstalled())
311 if(mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER)
313 if(mId != NPatchData::INVALID_NPATCH_DATA_ID)
315 mLoader.Remove(mId, this);
316 mId = NPatchData::INVALID_NPATCH_DATA_ID;
318 if(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID)
320 TextureManager& textureManager = mFactoryCache.GetTextureManager();
321 textureManager.Remove(mAuxiliaryTextureId, this);
322 mAuxiliaryTextureId = TextureManager::INVALID_TEXTURE_ID;
323 mAuxiliaryTextureSet.Reset();
329 void NPatchVisual::OnInitialize()
331 // Get basic geometry and shader
332 Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
333 Shader shader = mImageVisualShaderFactory.GetShader(
335 ImageVisualShaderFeature::FeatureBuilder());
337 mImpl->mRenderer = VisualRenderer::New(geometry, shader);
338 mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
340 //Register transform properties
341 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
344 Geometry NPatchVisual::CreateGeometry()
347 const NPatchData* data;
348 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
350 if(data->GetStretchPixelsX().Size() == 1 && data->GetStretchPixelsY().Size() == 1)
352 if(DALI_UNLIKELY(mBorderOnly))
354 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY);
358 if(data->GetRenderingMap())
360 uint32_t elementCount[2];
361 geometry = RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), Uint16Pair(3, 3), elementCount);
364 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
369 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
373 else if(data->GetStretchPixelsX().Size() > 0 || data->GetStretchPixelsY().Size() > 0)
375 Uint16Pair gridSize(2 * data->GetStretchPixelsX().Size() + 1, 2 * data->GetStretchPixelsY().Size() + 1);
376 if(!data->GetRenderingMap())
378 geometry = !mBorderOnly ? NPatchHelper::CreateGridGeometry(gridSize) : NPatchHelper::CreateBorderGeometry(gridSize);
382 uint32_t elementCount[2];
383 geometry = !mBorderOnly ? RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), gridSize, elementCount) : NPatchHelper::CreateBorderGeometry(gridSize);
386 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
393 // no N patch data so use default geometry
394 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
399 Shader NPatchVisual::CreateShader()
402 const NPatchData* data;
403 // 0 is either no data (load failed?) or no stretch regions on image
404 // for both cases we use the default shader
405 NPatchUtility::StretchRanges::SizeType xStretchCount = 0;
406 NPatchUtility::StretchRanges::SizeType yStretchCount = 0;
408 auto fragmentShader = mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY ? SHADER_NPATCH_VISUAL_MASK_SHADER_FRAG
409 : SHADER_NPATCH_VISUAL_SHADER_FRAG;
410 auto shaderType = mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY ? VisualFactoryCache::NINE_PATCH_MASK_SHADER
411 : VisualFactoryCache::NINE_PATCH_SHADER;
413 // ask loader for the regions
414 if(mLoader.GetNPatchData(mId, data))
416 xStretchCount = data->GetStretchPixelsX().Count();
417 yStretchCount = data->GetStretchPixelsY().Count();
420 if(DALI_LIKELY(!mImpl->mCustomShader))
422 if(DALI_LIKELY((xStretchCount == 1 && yStretchCount == 1) ||
423 (xStretchCount == 0 && yStretchCount == 0)))
425 shader = mFactoryCache.GetShader(shaderType);
426 if(DALI_UNLIKELY(!shader))
428 shader = Shader::New(SHADER_NPATCH_VISUAL_3X3_SHADER_VERT, fragmentShader);
429 // Only cache vanilla 9 patch shaders
430 mFactoryCache.SaveShader(shaderType, shader);
433 else if(xStretchCount > 0 || yStretchCount > 0)
435 std::stringstream vertexShader;
436 vertexShader << "#define FACTOR_SIZE_X " << xStretchCount + 2 << "\n"
437 << "#define FACTOR_SIZE_Y " << yStretchCount + 2 << "\n"
438 << SHADER_NPATCH_VISUAL_SHADER_VERT;
440 shader = Shader::New(vertexShader.str(), fragmentShader);
445 Dali::Shader::Hint::Value hints = Dali::Shader::Hint::NONE;
447 if(!mImpl->mCustomShader->mFragmentShader.empty())
449 fragmentShader = mImpl->mCustomShader->mFragmentShader.c_str();
451 hints = mImpl->mCustomShader->mHints;
453 /* Apply Custom Vertex Shader only if image is 9-patch */
454 if((xStretchCount == 1 && yStretchCount == 1) ||
455 (xStretchCount == 0 && yStretchCount == 0))
457 const char* vertexShader = SHADER_NPATCH_VISUAL_3X3_SHADER_VERT.data();
459 if(!mImpl->mCustomShader->mVertexShader.empty())
461 vertexShader = mImpl->mCustomShader->mVertexShader.c_str();
463 shader = Shader::New(vertexShader, fragmentShader, hints);
465 else if(xStretchCount > 0 || yStretchCount > 0)
467 std::stringstream vertexShader;
468 vertexShader << "#define FACTOR_SIZE_X " << xStretchCount + 2 << "\n"
469 << "#define FACTOR_SIZE_Y " << yStretchCount + 2 << "\n"
470 << SHADER_NPATCH_VISUAL_SHADER_VERT;
472 shader = Shader::New(vertexShader.str(), fragmentShader, hints);
479 void NPatchVisual::ApplyTextureAndUniforms()
481 const NPatchData* data;
482 TextureSet textureSet;
484 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
486 textureSet = data->GetTextures();
487 NPatchHelper::ApplyTextureAndUniforms(mImpl->mRenderer, data);
489 if(mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY)
491 DALI_ASSERT_ALWAYS(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID);
492 DALI_ASSERT_ALWAYS(mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u);
494 // TODO : This code exist due to the texture cache manager hold TextureSet, not Texture.
495 // If we call textureSet.SetTexture(1, texture) directly, the cached TextureSet also be changed.
496 // We should make pass utc-Dali-VisualFactory.cpp UtcDaliNPatchVisualAuxiliaryImage02().
497 TextureSet tempTextureSet = TextureSet::New();
498 tempTextureSet.SetTexture(0, textureSet.GetTexture(0));
499 tempTextureSet.SetTexture(1, mAuxiliaryTextureSet.GetTexture(0));
500 textureSet = tempTextureSet;
502 mImpl->mRenderer.RegisterProperty(DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA,
503 AUXILIARY_IMAGE_ALPHA_NAME,
504 mAuxiliaryImageAlpha);
506 mImpl->mRenderer.SetTextures(textureSet);
510 DALI_LOG_ERROR("The N patch image '%s' is not a valid N patch image\n", mImageUrl.GetUrl().c_str());
511 Actor actor = mPlacementActor.GetHandle();
512 Vector2 imageSize = Vector2::ZERO;
515 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
517 mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize, false);
520 // Register transform properties
521 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
524 Geometry NPatchVisual::GetNinePatchGeometry(VisualFactoryCache::GeometryType subType)
526 Geometry geometry = mFactoryCache.GetGeometry(subType);
529 if(DALI_LIKELY(VisualFactoryCache::NINE_PATCH_GEOMETRY == subType))
531 geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3, 3));
533 else if(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY == subType)
535 geometry = NPatchHelper::CreateBorderGeometry(Uint16Pair(3, 3));
537 mFactoryCache.SaveGeometry(subType, geometry);
542 void NPatchVisual::SetResource()
544 const NPatchData* data;
545 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data))
547 Geometry geometry = CreateGeometry();
548 Shader shader = CreateShader();
550 mImpl->mRenderer.SetGeometry(geometry);
551 mImpl->mRenderer.SetShader(shader);
553 if(RenderingAddOn::Get().IsValid())
555 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
557 Actor actor = mPlacementActor.GetHandle();
560 ApplyTextureAndUniforms();
561 actor.AddRenderer(mImpl->mRenderer);
562 mPlacementActor.Reset();
565 // npatch loaded and ready to display
566 if(data->GetLoadingState() != NPatchData::LoadingState::LOAD_COMPLETE)
568 ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
572 ResourceReady(Toolkit::Visual::ResourceStatus::READY);
577 void NPatchVisual::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
579 if(textureInformation.url.length() > 0) // For the Url.
581 if(DALI_UNLIKELY(mId == NPatchData::INVALID_NPATCH_DATA_ID))
583 // Special case when mLoader.Load call LoadComplete function before mId setup.
584 // We can overwrite mId.
585 mId = static_cast<NPatchData::NPatchDataId>(textureInformation.textureId);
589 EnablePreMultipliedAlpha(textureInformation.preMultiplied);
592 else // For the AuxiliaryUrl
594 if(DALI_UNLIKELY(mAuxiliaryTextureId == TextureManager::INVALID_TEXTURE_ID))
596 // Special case when TextureManager.LoadTexture call LoadComplete function before mAuxiliaryTextureId setup.
597 // We can overwrite mAuxiliaryTextureId.
598 mAuxiliaryTextureId = textureInformation.textureId;
602 mAuxiliaryTextureSet = textureInformation.textureSet;
603 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::READY;
607 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::FAILED;
611 // If auxiliaryUrl didn't required OR auxiliaryUrl load done.
612 if(!mAuxiliaryUrl.IsValid() || mAuxiliaryResourceStatus != Toolkit::Visual::ResourceStatus::PREPARING)
614 const NPatchData* data;
615 // and.. If Url loading done.
616 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
623 } // namespace Internal
625 } // namespace Toolkit