From: Adeel Kazmi Date: Mon, 8 Jun 2020 16:42:59 +0000 (+0100) Subject: Remove NinePatchImage Usage X-Git-Tag: dali_1.9.16~6 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=8e86af3c0235dfa98263c8489bbbac4a4665b41b Remove NinePatchImage Usage Change-Id: I686f15d6e4a8c1daa38a60a988423b4358342ef0 --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index a2e3f03..d917895 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -831,18 +831,6 @@ int UtcDaliVisualFactoryGetNPatchVisual4(void) textureTrace.Reset(); - ResourceImage image = ResourceImage::New( TEST_9_PATCH_FILE_NAME ); - Visual::Base nPatchVisual = factory.CreateVisual( image ); - - DummyControl actor1 = DummyControl::New(true); - TestVisualRender( application, actor1, nPatchVisual ); - - DALI_TEST_EQUALS( textureTrace.CountMethod("BindTexture"), 0, TEST_LOCATION ); // The same texture should be used with the first visual. - - naturalSize = Vector2( 0.0f, 0.0f ); - nPatchVisual.GetNaturalSize( naturalSize ); - DALI_TEST_EQUALS( naturalSize, Vector2( imageSize.GetWidth() - 2.0f, imageSize.GetHeight() - 2.0f ), TEST_LOCATION ); - END_TEST; } diff --git a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp index ed72527..2f0c692 100644 --- a/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp index 873eeca..c4dc4df 100755 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.cpp @@ -275,14 +275,6 @@ NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, const Visua return nPatchVisual; } -NPatchVisualPtr NPatchVisual::New( VisualFactoryCache& factoryCache, NinePatchImage image ) -{ - NPatchVisualPtr nPatchVisual( new NPatchVisual( factoryCache ) ); - VisualUrl visualUrl( image.GetUrl() ); - nPatchVisual->mImageUrl = visualUrl; - return nPatchVisual; -} - void NPatchVisual::LoadImages() { TextureManager& textureManager = mFactoryCache.GetTextureManager(); diff --git a/dali-toolkit/internal/visuals/npatch/npatch-visual.h b/dali-toolkit/internal/visuals/npatch/npatch-visual.h index 7816e84..4a82cfb 100644 --- a/dali-toolkit/internal/visuals/npatch/npatch-visual.h +++ b/dali-toolkit/internal/visuals/npatch/npatch-visual.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -85,14 +84,6 @@ public: */ static NPatchVisualPtr New( VisualFactoryCache& factoryCache, const VisualUrl& imageUrl ); - /** - * @brief Create an N-patch visual with a NinePatchImage resource. - * - * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object - * @param[in] image The NinePatchImage to use - */ - static NPatchVisualPtr New( VisualFactoryCache& factoryCache, NinePatchImage image ); - public: // from Visual /** diff --git a/dali-toolkit/internal/visuals/visual-factory-impl.cpp b/dali-toolkit/internal/visuals/visual-factory-impl.cpp index dc35220..d3be0b4 100644 --- a/dali-toolkit/internal/visuals/visual-factory-impl.cpp +++ b/dali-toolkit/internal/visuals/visual-factory-impl.cpp @@ -320,15 +320,7 @@ Toolkit::Visual::Base VisualFactory::CreateVisual( const Image& image ) if( image ) { - NinePatchImage npatchImage = NinePatchImage::DownCast( image ); - if( npatchImage ) - { - visualPtr = NPatchVisual::New( GetFactoryCache(), npatchImage ); - } - else - { - visualPtr = ImageVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), image ); - } + visualPtr = ImageVisual::New(GetFactoryCache(), GetImageVisualShaderFactory(), image ); } if( mDebugEnabled )