X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fnpatch%2Fnpatch-visual.cpp;h=e87e2442af0f5808ac51f76dfe14e17b139ff3f7;hb=035ae4945da7a7e865d4ec4b3ebc603db9e91397;hp=4e95dfe2b4ebabdf59c828a453a1e23738fe7211;hpb=c052b6678e2c6d8a65545dbbe4531ea7057c1999;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 4e95dfe..e87e244 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -22,6 +22,7 @@ #include #include #include +#include // INTERNAL INCLUDES #include @@ -152,10 +153,10 @@ void NPatchVisual::LoadImages() TextureManager& textureManager = mFactoryCache.GetTextureManager(); bool synchronousLoading = mImpl->mFlags & Impl::IS_SYNCHRONOUS_RESOURCE_LOADING; - if(mId == NPatchData::INVALID_NPATCH_DATA_ID && mImageUrl.IsLocalResource()) + if(mId == NPatchData::INVALID_NPATCH_DATA_ID && (mImageUrl.IsLocalResource() || mImageUrl.IsBufferResource())) { bool preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader ? true : false; - mId = mLoader.Load(textureManager, this, mImageUrl.GetUrl(), mBorder, preMultiplyOnLoad, synchronousLoading); + mId = mLoader.Load(textureManager, this, mImageUrl, mBorder, preMultiplyOnLoad, synchronousLoading); const NPatchData* data; if(mLoader.GetNPatchData(mId, data) && data->GetLoadingState() == NPatchData::LoadingState::LOAD_COMPLETE) @@ -164,7 +165,7 @@ void NPatchVisual::LoadImages() } } - if(!mAuxiliaryPixelBuffer && mAuxiliaryUrl.IsValid() && mAuxiliaryUrl.IsLocalResource()) + if(!mAuxiliaryPixelBuffer && mAuxiliaryUrl.IsValid() && (mAuxiliaryUrl.IsLocalResource() || mAuxiliaryUrl.IsBufferResource())) { // Load the auxiliary image auto preMultiplyOnLoading = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY; @@ -364,7 +365,7 @@ NPatchVisual::NPatchVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFa NPatchVisual::~NPatchVisual() { - if((mId != NPatchData::INVALID_NPATCH_DATA_ID) && (mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER)) + if(Stage::IsInstalled() && (mId != NPatchData::INVALID_NPATCH_DATA_ID) && (mReleasePolicy != Toolkit::ImageVisual::ReleasePolicy::NEVER)) { mLoader.Remove(mId, this); mId = NPatchData::INVALID_NPATCH_DATA_ID; @@ -375,7 +376,13 @@ void NPatchVisual::OnInitialize() { // Get basic geometry and shader Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY); - Shader shader = mImageVisualShaderFactory.GetShader(mFactoryCache, false, true, false); + Shader shader = mImageVisualShaderFactory.GetShader( + mFactoryCache, + TextureAtlas::DISABLED, + DefaultTextureWrapMode::APPLY, + RoundedCorner::DISABLED, + Borderline::DISABLED + ); mImpl->mRenderer = Renderer::New(geometry, shader); @@ -555,7 +562,14 @@ void NPatchVisual::ApplyTextureAndUniforms() DALI_LOG_ERROR("The N patch image '%s' is not a valid N patch image\n", mImageUrl.GetUrl().c_str()); textureSet = TextureSet::New(); - Texture croppedImage = mFactoryCache.GetBrokenVisualImage(); + Actor actor = mPlacementActor.GetHandle(); + Vector2 imageSize = Vector2::ZERO; + if(actor) + { + imageSize = actor.GetProperty(Actor::Property::SIZE).Get(); + } + mFactoryCache.UpdateBrokenImageRenderer(mImpl->mRenderer, imageSize); + Texture croppedImage = mImpl->mRenderer.GetTextures().GetTexture(0); textureSet.SetTexture(0u, croppedImage); mImpl->mRenderer.RegisterProperty("uFixed[0]", Vector2::ZERO); mImpl->mRenderer.RegisterProperty("uFixed[1]", Vector2::ZERO);