From 3fe11de107c75059b4446d30e3b8756e090ca46f Mon Sep 17 00:00:00 2001 From: sunghyun kim Date: Tue, 23 Jan 2024 18:45:18 +0900 Subject: [PATCH] [Tizen] Apply CornerRadius for webview CornerRadius apply logic not matched with tizen_7.0, the cherry-pick not works well. To fix this issue, let we it works well. Change-Id: Iedc4f12c633db78266054c520172a2e671d2061a --- .../internal/controls/web-view/web-view-impl.cpp | 54 ++++++++++------------ 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp index 5563de7..8b46880 100644 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp @@ -922,55 +922,49 @@ void WebView::OnFrameRendered() } // Make sure that mVisual is created only once. - if (mVisual) + if(!mVisualChangeRequired && mVisual) + { return; + } // Get webVisual for checking corner radius Toolkit::Visual::Base webVisual = Dali::Toolkit::DevelControl::GetVisual(*this, Toolkit::WebView::Property::URL); - Property::Map webMap; + Property::Map webMap; webVisual.CreatePropertyMap(webMap); - Property::Value* cornerRadiusValue = webMap.Find(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS); + Property::Value* cornerRadiusValue = webMap.Find(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS); if(cornerRadiusValue) { mCornerRadius = cornerRadiusValue->Get(); } - Property::Value* cornerRadiusValuePolicy = webMap.Find(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY); + Property::Value* cornerRadiusValuePolicy = webMap.Find(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY); if(cornerRadiusValuePolicy) { mCornerRadiusPolicy = cornerRadiusValuePolicy->Get(); } - Dali::Toolkit::ImageUrl nativeImageUrl = Dali::Toolkit::Image::GenerateUrl(mWebEngine.GetNativeImageSource()); - Property::Map propertyMap; - propertyMap.Insert(Dali::Toolkit::Visual::Property::TYPE, Dali::Toolkit::Visual::IMAGE); - propertyMap.Insert(Dali::Toolkit::ImageVisual::Property::URL, nativeImageUrl.GetUrl()); - propertyMap.Insert(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS, mCornerRadius); - propertyMap.Insert(Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, mCornerRadiusPolicy); - mVisual = Toolkit::VisualFactory::Get().CreateVisual(propertyMap); - if(mVisual) - { - // Reset flag - mVisualChangeRequired = false; + // Reset flag + mVisualChangeRequired = false; - auto nativeImageSourcePtr = mWebEngine.GetNativeImageSource(); + auto nativeImageSourcePtr = mWebEngine.GetNativeImageSource(); - mLastRenderedNativeImageWidth = nativeImageSourcePtr->GetWidth(); - mLastRenderedNativeImageHeight = nativeImageSourcePtr->GetHeight(); + mLastRenderedNativeImageWidth = nativeImageSourcePtr->GetWidth(); + mLastRenderedNativeImageHeight = nativeImageSourcePtr->GetHeight(); - Dali::Toolkit::ImageUrl nativeImageUrl = Dali::Toolkit::Image::GenerateUrl(nativeImageSourcePtr); + Dali::Toolkit::ImageUrl nativeImageUrl = Dali::Toolkit::Image::GenerateUrl(nativeImageSourcePtr); - mVisual = Toolkit::VisualFactory::Get().CreateVisual( - {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, - {Toolkit::ImageVisual::Property::URL, nativeImageUrl.GetUrl()}, - {Toolkit::ImageVisual::Property::PIXEL_AREA, FULL_TEXTURE_RECT}, - {Toolkit::ImageVisual::Property::WRAP_MODE_U, Dali::WrapMode::CLAMP_TO_EDGE}, - {Toolkit::ImageVisual::Property::WRAP_MODE_V, Dali::WrapMode::CLAMP_TO_EDGE}}); + mVisual = Toolkit::VisualFactory::Get().CreateVisual( + {{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, + {Toolkit::ImageVisual::Property::URL, nativeImageUrl.GetUrl()}, + {Toolkit::ImageVisual::Property::PIXEL_AREA, FULL_TEXTURE_RECT}, + {Toolkit::ImageVisual::Property::WRAP_MODE_U, Dali::WrapMode::CLAMP_TO_EDGE}, + {Toolkit::ImageVisual::Property::WRAP_MODE_V, Dali::WrapMode::CLAMP_TO_EDGE}, + {Toolkit::DevelVisual::Property::CORNER_RADIUS, mCornerRadius}, + {Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, mCornerRadiusPolicy}}); - if(mVisual) - { - DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual); - EnableBlendMode(!mVideoHoleEnabled); - } + if(mVisual) + { + DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual); + EnableBlendMode(!mVideoHoleEnabled); } } -- 2.7.4