}
// 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<Vector4>();
}
- 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<int>();
}
- 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, DepthIndex::CONTENT);
- EnableBlendMode(!mVideoHoleEnabled);
- }
+ if(mVisual)
+ {
+ DevelControl::RegisterVisual(*this, Toolkit::WebView::Property::URL, mVisual, DepthIndex::CONTENT);
+ EnableBlendMode(!mVideoHoleEnabled);
}
}