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, this, nullptr, imageAtlasManagerPtr, true, TextureManager::ReloadPolicy::CACHED, preMultiplyOnLoad);
107 if(mAuxiliaryTextureSet)
109 Sampler sampler = Sampler::New();
110 sampler.SetWrapMode(WrapMode::DEFAULT, WrapMode::DEFAULT);
111 mAuxiliaryTextureSet.SetSampler(0u, sampler);
114 // If synchronousLoading is true, we can check the auxiliaryResource's status now.
115 if(synchronousLoading)
117 mAuxiliaryResourceStatus = (mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u) ? Toolkit::Visual::ResourceStatus::READY : Toolkit::Visual::ResourceStatus::FAILED;
122 void NPatchVisual::GetNaturalSize(Vector2& naturalSize)
127 // load now if not already loaded
128 const NPatchData* data;
129 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
131 naturalSize.x = data->GetCroppedWidth();
132 naturalSize.y = data->GetCroppedHeight();
136 if(mImageUrl.IsValid())
138 ImageDimensions dimensions = Dali::GetOriginalImageSize(mImageUrl.GetUrl());
139 if(dimensions != ImageDimensions(0, 0))
141 naturalSize.x = dimensions.GetWidth();
142 naturalSize.y = dimensions.GetHeight();
147 if(mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u)
149 naturalSize.x = std::max(naturalSize.x, float(mAuxiliaryTextureSet.GetTexture(0u).GetWidth()));
150 naturalSize.y = std::max(naturalSize.y, float(mAuxiliaryTextureSet.GetTexture(0u).GetHeight()));
154 void NPatchVisual::DoSetProperties(const Property::Map& propertyMap)
156 // URL is already passed in via constructor
158 Property::Value* borderOnlyValue = propertyMap.Find(Toolkit::ImageVisual::Property::BORDER_ONLY, BORDER_ONLY);
161 borderOnlyValue->Get(mBorderOnly);
164 Property::Value* borderValue = propertyMap.Find(Toolkit::ImageVisual::Property::BORDER, BORDER);
165 if(borderValue && !borderValue->Get(mBorder)) // If value exists and is rect, just set mBorder
167 // Not a rect so try vector4
169 if(borderValue->Get(border))
171 mBorder.left = static_cast<int>(border.x);
172 mBorder.right = static_cast<int>(border.y);
173 mBorder.bottom = static_cast<int>(border.z);
174 mBorder.top = static_cast<int>(border.w);
178 Property::Value* auxImage = propertyMap.Find(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, AUXILIARY_IMAGE_NAME);
182 if(auxImage->Get(url))
188 Property::Value* auxImageAlpha = propertyMap.Find(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, AUXILIARY_IMAGE_ALPHA_NAME);
191 auxImageAlpha->Get(mAuxiliaryImageAlpha);
194 Property::Value* synchronousLoading = propertyMap.Find(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, SYNCHRONOUS_LOADING);
195 if(synchronousLoading)
198 synchronousLoading->Get(sync);
201 mImpl->mFlags |= Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
205 mImpl->mFlags &= ~Impl::IS_SYNCHRONOUS_RESOURCE_LOADING;
209 Property::Value* releasePolicy = propertyMap.Find(Toolkit::ImageVisual::Property::RELEASE_POLICY, RELEASE_POLICY_NAME);
212 releasePolicy->Get(mReleasePolicy);
216 void NPatchVisual::DoSetOnScene(Actor& actor)
218 // load when first go on stage
221 // Set mPlacementActor now, because some case, LoadImages can use this information in LoadComplete API.
222 // at this case, we try to SetResouce to mPlaceActor twice. so, we should avoid that case.
223 mPlacementActor = actor;
225 const NPatchData* data;
226 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
228 // If mAuxiliaryUrl need to be loaded, we should wait it until LoadComplete called.
229 if(!mAuxiliaryUrl.IsValid() || mAuxiliaryResourceStatus != Toolkit::Visual::ResourceStatus::PREPARING)
236 void NPatchVisual::DoSetOffScene(Actor& actor)
238 if(mReleasePolicy == Toolkit::ImageVisual::ReleasePolicy::DETACHED)
240 if(mId != NPatchData::INVALID_NPATCH_DATA_ID)
242 mLoader.Remove(mId, this);
243 mImpl->mResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
244 mId = NPatchData::INVALID_NPATCH_DATA_ID;
246 if(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID)
248 TextureManager& textureManager = mFactoryCache.GetTextureManager();
249 textureManager.Remove(mAuxiliaryTextureId, this);
250 mAuxiliaryTextureId = TextureManager::INVALID_TEXTURE_ID;
251 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::PREPARING;
252 mAuxiliaryTextureSet.Reset();
256 actor.RemoveRenderer(mImpl->mRenderer);
257 mPlacementActor.Reset();
260 void NPatchVisual::OnSetTransform()
264 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
268 void NPatchVisual::DoCreatePropertyMap(Property::Map& map) const
271 bool sync = IsSynchronousLoadingRequired();
272 map.Insert(Toolkit::ImageVisual::Property::SYNCHRONOUS_LOADING, sync);
273 map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::N_PATCH);
274 map.Insert(Toolkit::ImageVisual::Property::URL, mImageUrl.GetUrl());
275 map.Insert(Toolkit::ImageVisual::Property::BORDER_ONLY, mBorderOnly);
276 map.Insert(Toolkit::ImageVisual::Property::BORDER, mBorder);
277 map.Insert(Toolkit::ImageVisual::Property::RELEASE_POLICY, mReleasePolicy);
279 if(mAuxiliaryUrl.IsValid())
281 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, mAuxiliaryUrl.GetUrl());
282 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, mAuxiliaryImageAlpha);
286 void NPatchVisual::DoCreateInstancePropertyMap(Property::Map& map) const
288 if(mAuxiliaryUrl.IsValid())
290 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE, mAuxiliaryUrl.GetUrl());
291 map.Insert(Toolkit::DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA, mAuxiliaryImageAlpha);
295 NPatchVisual::NPatchVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory)
296 : Visual::Base(factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::N_PATCH),
298 mLoader(factoryCache.GetNPatchLoader()),
299 mImageVisualShaderFactory(shaderFactory),
302 mId(NPatchData::INVALID_NPATCH_DATA_ID),
303 mAuxiliaryTextureSet(),
304 mAuxiliaryTextureId(TextureManager::INVALID_TEXTURE_ID),
305 mAuxiliaryResourceStatus(Toolkit::Visual::ResourceStatus::PREPARING),
308 mAuxiliaryImageAlpha(0.0f),
309 mReleasePolicy(Toolkit::ImageVisual::ReleasePolicy::DETACHED)
311 EnablePreMultipliedAlpha(mFactoryCache.GetPreMultiplyOnLoad());
314 NPatchVisual::~NPatchVisual()
316 if(Stage::IsInstalled())
318 if(mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER)
320 if(mId != NPatchData::INVALID_NPATCH_DATA_ID)
322 mLoader.Remove(mId, this);
323 mId = NPatchData::INVALID_NPATCH_DATA_ID;
325 if(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID)
327 TextureManager& textureManager = mFactoryCache.GetTextureManager();
328 textureManager.Remove(mAuxiliaryTextureId, this);
329 mAuxiliaryTextureId = TextureManager::INVALID_TEXTURE_ID;
330 mAuxiliaryTextureSet.Reset();
336 void NPatchVisual::OnInitialize()
338 // Get basic geometry and shader
339 Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
340 Shader shader = mImageVisualShaderFactory.GetShader(
342 ImageVisualShaderFeature::FeatureBuilder());
344 mImpl->mRenderer = VisualRenderer::New(geometry, shader);
345 mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
347 //Register transform properties
348 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
351 Geometry NPatchVisual::CreateGeometry()
354 const NPatchData* data;
355 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
357 if(data->GetStretchPixelsX().Size() == 1 && data->GetStretchPixelsY().Size() == 1)
359 if(DALI_UNLIKELY(mBorderOnly))
361 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY);
365 if(data->GetRenderingMap())
367 uint32_t elementCount[2];
368 geometry = RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), Uint16Pair(3, 3), elementCount);
371 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
376 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
380 else if(data->GetStretchPixelsX().Size() > 0 || data->GetStretchPixelsY().Size() > 0)
382 Uint16Pair gridSize(2 * data->GetStretchPixelsX().Size() + 1, 2 * data->GetStretchPixelsY().Size() + 1);
383 if(!data->GetRenderingMap())
385 geometry = !mBorderOnly ? NPatchHelper::CreateGridGeometry(gridSize) : NPatchHelper::CreateBorderGeometry(gridSize);
389 uint32_t elementCount[2];
390 geometry = !mBorderOnly ? RenderingAddOn::Get().CreateGeometryGrid(data->GetRenderingMap(), gridSize, elementCount) : NPatchHelper::CreateBorderGeometry(gridSize);
393 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
400 // no N patch data so use default geometry
401 geometry = GetNinePatchGeometry(VisualFactoryCache::NINE_PATCH_GEOMETRY);
406 Shader NPatchVisual::CreateShader()
409 const NPatchData* data;
410 // 0 is either no data (load failed?) or no stretch regions on image
411 // for both cases we use the default shader
412 NPatchUtility::StretchRanges::SizeType xStretchCount = 0;
413 NPatchUtility::StretchRanges::SizeType yStretchCount = 0;
415 auto fragmentShader = mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY ? SHADER_NPATCH_VISUAL_MASK_SHADER_FRAG
416 : SHADER_NPATCH_VISUAL_SHADER_FRAG;
417 auto shaderType = mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY ? VisualFactoryCache::NINE_PATCH_MASK_SHADER
418 : VisualFactoryCache::NINE_PATCH_SHADER;
420 // ask loader for the regions
421 if(mLoader.GetNPatchData(mId, data))
423 xStretchCount = data->GetStretchPixelsX().Count();
424 yStretchCount = data->GetStretchPixelsY().Count();
427 if(DALI_LIKELY(!mImpl->mCustomShader))
429 if(DALI_LIKELY((xStretchCount == 1 && yStretchCount == 1) ||
430 (xStretchCount == 0 && yStretchCount == 0)))
432 shader = mFactoryCache.GetShader(shaderType);
433 if(DALI_UNLIKELY(!shader))
435 shader = Shader::New(SHADER_NPATCH_VISUAL_3X3_SHADER_VERT, fragmentShader);
436 // Only cache vanilla 9 patch shaders
437 mFactoryCache.SaveShader(shaderType, shader);
440 else if(xStretchCount > 0 || yStretchCount > 0)
442 std::stringstream vertexShader;
443 vertexShader << "#define FACTOR_SIZE_X " << xStretchCount + 2 << "\n"
444 << "#define FACTOR_SIZE_Y " << yStretchCount + 2 << "\n"
445 << SHADER_NPATCH_VISUAL_SHADER_VERT;
447 shader = Shader::New(vertexShader.str(), fragmentShader);
452 Dali::Shader::Hint::Value hints = Dali::Shader::Hint::NONE;
454 if(!mImpl->mCustomShader->mFragmentShader.empty())
456 fragmentShader = mImpl->mCustomShader->mFragmentShader.c_str();
458 hints = mImpl->mCustomShader->mHints;
460 /* Apply Custom Vertex Shader only if image is 9-patch */
461 if((xStretchCount == 1 && yStretchCount == 1) ||
462 (xStretchCount == 0 && yStretchCount == 0))
464 const char* vertexShader = SHADER_NPATCH_VISUAL_3X3_SHADER_VERT.data();
466 if(!mImpl->mCustomShader->mVertexShader.empty())
468 vertexShader = mImpl->mCustomShader->mVertexShader.c_str();
470 shader = Shader::New(vertexShader, fragmentShader, hints);
472 else if(xStretchCount > 0 || yStretchCount > 0)
474 std::stringstream vertexShader;
475 vertexShader << "#define FACTOR_SIZE_X " << xStretchCount + 2 << "\n"
476 << "#define FACTOR_SIZE_Y " << yStretchCount + 2 << "\n"
477 << SHADER_NPATCH_VISUAL_SHADER_VERT;
479 shader = Shader::New(vertexShader.str(), fragmentShader, hints);
486 void NPatchVisual::ApplyTextureAndUniforms()
488 const NPatchData* data;
489 TextureSet textureSet;
491 if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE)
493 textureSet = data->GetTextures();
494 NPatchHelper::ApplyTextureAndUniforms(mImpl->mRenderer, data);
496 if(mAuxiliaryResourceStatus == Toolkit::Visual::ResourceStatus::READY)
498 DALI_ASSERT_ALWAYS(mAuxiliaryTextureId != TextureManager::INVALID_TEXTURE_ID);
499 DALI_ASSERT_ALWAYS(mAuxiliaryTextureSet && mAuxiliaryTextureSet.GetTextureCount() > 0u);
501 // TODO : This code exist due to the texture cache manager hold TextureSet, not Texture.
502 // If we call textureSet.SetTexture(1, texture) directly, the cached TextureSet also be changed.
503 // We should make pass utc-Dali-VisualFactory.cpp UtcDaliNPatchVisualAuxiliaryImage02().
504 TextureSet tempTextureSet = TextureSet::New();
505 tempTextureSet.SetTexture(0, textureSet.GetTexture(0));
506 tempTextureSet.SetTexture(1, mAuxiliaryTextureSet.GetTexture(0));
507 textureSet = tempTextureSet;
509 mImpl->mRenderer.RegisterProperty(DevelImageVisual::Property::AUXILIARY_IMAGE_ALPHA,
510 AUXILIARY_IMAGE_ALPHA_NAME,
511 mAuxiliaryImageAlpha);
513 mImpl->mRenderer.SetTextures(textureSet);
517 DALI_LOG_ERROR("The N patch image '%s' is not a valid N patch image\n", mImageUrl.GetUrl().c_str());
518 Actor actor = mPlacementActor.GetHandle();
519 Vector2 imageSize = Vector2::ZERO;
522 imageSize = actor.GetProperty(Actor::Property::SIZE).Get<Vector2>();
524 mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize, false);
527 // Register transform properties
528 mImpl->mTransform.SetUniforms(mImpl->mRenderer, Direction::LEFT_TO_RIGHT);
531 Geometry NPatchVisual::GetNinePatchGeometry(VisualFactoryCache::GeometryType subType)
533 Geometry geometry = mFactoryCache.GetGeometry(subType);
536 if(DALI_LIKELY(VisualFactoryCache::NINE_PATCH_GEOMETRY == subType))
538 geometry = NPatchHelper::CreateGridGeometry(Uint16Pair(3, 3));
540 else if(VisualFactoryCache::NINE_PATCH_BORDER_GEOMETRY == subType)
542 geometry = NPatchHelper::CreateBorderGeometry(Uint16Pair(3, 3));
544 mFactoryCache.SaveGeometry(subType, geometry);
549 void NPatchVisual::SetResource()
551 const NPatchData* data;
552 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data))
554 Geometry geometry = CreateGeometry();
555 Shader shader = CreateShader();
557 mImpl->mRenderer.SetGeometry(geometry);
558 mImpl->mRenderer.SetShader(shader);
560 if(RenderingAddOn::Get().IsValid())
562 RenderingAddOn::Get().SubmitRenderTask(mImpl->mRenderer, data->GetRenderingMap());
564 Actor actor = mPlacementActor.GetHandle();
567 ApplyTextureAndUniforms();
568 actor.AddRenderer(mImpl->mRenderer);
569 mPlacementActor.Reset();
572 // npatch loaded and ready to display
573 if(data->GetLoadingState() != NPatchData::LoadingState::LOAD_COMPLETE)
575 ResourceReady(Toolkit::Visual::ResourceStatus::FAILED);
579 ResourceReady(Toolkit::Visual::ResourceStatus::READY);
584 void NPatchVisual::LoadComplete(bool loadSuccess, TextureInformation textureInformation)
586 if(textureInformation.url.length() > 0) // For the Url.
588 if(DALI_UNLIKELY(mId == NPatchData::INVALID_NPATCH_DATA_ID))
590 // Special case when mLoader.Load call LoadComplete function before mId setup.
591 // We can overwrite mId.
592 mId = static_cast<NPatchData::NPatchDataId>(textureInformation.textureId);
596 EnablePreMultipliedAlpha(textureInformation.preMultiplied);
599 else // For the AuxiliaryUrl
601 if(DALI_UNLIKELY(mAuxiliaryTextureId == TextureManager::INVALID_TEXTURE_ID))
603 // Special case when TextureManager.LoadTexture call LoadComplete function before mAuxiliaryTextureId setup.
604 // We can overwrite mAuxiliaryTextureId.
605 mAuxiliaryTextureId = textureInformation.textureId;
609 mAuxiliaryTextureSet = textureInformation.textureSet;
610 if(mAuxiliaryTextureSet)
612 Sampler sampler = Sampler::New();
613 sampler.SetWrapMode(WrapMode::DEFAULT, WrapMode::DEFAULT);
614 mAuxiliaryTextureSet.SetSampler(0u, sampler);
617 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::READY;
621 mAuxiliaryResourceStatus = Toolkit::Visual::ResourceStatus::FAILED;
625 // If auxiliaryUrl didn't required OR auxiliaryUrl load done.
626 if(!mAuxiliaryUrl.IsValid() || mAuxiliaryResourceStatus != Toolkit::Visual::ResourceStatus::PREPARING)
628 const NPatchData* data;
629 // and.. If Url loading done.
630 if(mImpl->mRenderer && mLoader.GetNPatchData(mId, data) && data->GetLoadingState() != NPatchData::LoadingState::LOADING)
637 } // namespace Internal
639 } // namespace Toolkit