From: Eunki, Hong Date: Wed, 29 Sep 2021 08:14:12 +0000 (+0900) Subject: WebEngine::GetNativeImageSource return NativeImageSourcePtr X-Git-Tag: dali_2.0.46~2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F60%2F264760%2F2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git WebEngine::GetNativeImageSource return NativeImageSourcePtr NativeImageSource --> NativeImageInterface is simple valid job. NativeImageInterface --> NativeImageSource is not simple and expensive job. WebEngine / WebPlugin defined at dali-adaptor/devel-api and NativeImageSource defined at dali-adaptor/public-api. So there is no reason to convert NativeImageSource to NativeImageInterface. Change-Id: I55e9c6824188b1df8b53ea50b4f638f9309cfd84 Signed-off-by: Eunki, Hong --- diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp index 8f8853c..cd863b9 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-web-engine.cpp @@ -2056,7 +2056,7 @@ std::string WebEngine::GetUrl() const return Internal::Adaptor::GetImplementation( *this ).GetUrl(); } -NativeImageInterfacePtr WebEngine::GetNativeImageSource() +NativeImageSourcePtr WebEngine::GetNativeImageSource() { Any source; Dali::NativeImageSourcePtr sourcePtr = Dali::NativeImageSource::New( source ); 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 77b29ca..85b2fe1 100755 --- a/dali-toolkit/internal/controls/web-view/web-view-impl.cpp +++ b/dali-toolkit/internal/controls/web-view/web-view-impl.cpp @@ -47,11 +47,10 @@ #include #include #include -#include #include #include -#include #include +#include namespace Dali { @@ -634,7 +633,7 @@ Dali::Toolkit::ImageView WebView::CreateImageView(Dali::PixelData pixel) const return Dali::Toolkit::ImageView(); } - Dali::Toolkit::ImageUrl url = Dali::Toolkit::Image::GenerateUrl(pixel); + Dali::Toolkit::ImageUrl url = Dali::Toolkit::Image::GenerateUrl(pixel); Dali::Toolkit::ImageView imageView = Dali::Toolkit::ImageView::New(url.GetUrl()); imageView.SetProperty(Dali::Actor::Property::SIZE, Vector2(pixel.GetWidth(), pixel.GetHeight())); return imageView; @@ -777,9 +776,8 @@ void WebView::OnInitialFrameRendered() { mWebEngine.FrameRenderedSignal().Disconnect(this, &WebView::OnInitialFrameRendered); - Texture texture = Dali::Texture::New(*mWebEngine.GetNativeImageSource()); - const std::string nativeImageUrl = Dali::Toolkit::TextureManager::AddTexture(texture); - mVisual = Toolkit::VisualFactory::Get().CreateVisual({{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, {Toolkit::ImageVisual::Property::URL, nativeImageUrl}}); + Dali::Toolkit::ImageUrl nativeImageUrl = Dali::Toolkit::Image::GenerateUrl(mWebEngine.GetNativeImageSource()); + mVisual = Toolkit::VisualFactory::Get().CreateVisual({{Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE}, {Toolkit::ImageVisual::Property::URL, nativeImageUrl.GetUrl()}}); if(mVisual) {