Merge "(Vector) Ensure that all animation data is applied at once" into devel/master
authorHeeyong Song <heeyong.song@samsung.com>
Tue, 9 Jun 2020 01:27:08 +0000 (01:27 +0000)
committerGerrit Code Review <gerrit@review>
Tue, 9 Jun 2020 01:27:08 +0000 (01:27 +0000)
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/text/shaper.cpp [changed mode: 0644->0755]
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/public-api/image-loader/image.cpp
dali-toolkit/public-api/image-loader/image.h

index a2e3f03..d917895 100644 (file)
@@ -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;
 }
 
index ed72527..2f0c692 100644 (file)
@@ -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 <string.h>
 #include <cfloat>
 #include <dali/public-api/animation/animation.h>
-#include <dali/devel-api/images/nine-patch-image.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/math/vector2.h>
 #include <dali/public-api/math/vector4.h>
old mode 100644 (file)
new mode 100755 (executable)
index 593e1e5..de41d0e
@@ -117,8 +117,8 @@ void ShapeText( const Vector<Character>& text,
 
   const Length currentNumberOfGlyphs = glyphs.Count();
   const Length numberOfGlyphsReserved = static_cast<Length>( numberOfCharacters * 1.3f );
-  glyphs.Resize( currentNumberOfGlyphs + numberOfGlyphsReserved, glyphInfo );
-  glyphToCharacterMap.Resize( currentNumberOfGlyphs + numberOfGlyphsReserved );
+  glyphs.Reserve( currentNumberOfGlyphs + numberOfGlyphsReserved );
+  glyphToCharacterMap.Reserve( currentNumberOfGlyphs + numberOfGlyphsReserved );
 
   // The actual number of glyphs.
   Length totalNumberOfGlyphs = currentNumberOfGlyphs;
index 873eeca..c4dc4df 100755 (executable)
@@ -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();
index 7816e84..4a82cfb 100644 (file)
@@ -22,7 +22,6 @@
 #include <dali/public-api/common/intrusive-ptr.h>
 #include <dali/public-api/images/image.h>
 #include <dali/public-api/images/image-operations.h>
-#include <dali/devel-api/images/nine-patch-image.h>
 #include <dali/public-api/rendering/geometry.h>
 #include <dali/public-api/rendering/sampler.h>
 #include <dali/public-api/rendering/shader.h>
@@ -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
 
   /**
index dc35220..d3be0b4 100644 (file)
@@ -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 )
index 2645c07..0b26173 100644 (file)
@@ -39,7 +39,7 @@ std::string GenerateUrl( Dali::FrameBuffer frameBuffer, Pixel::Format pixelForma
   return Dali::Toolkit::TextureManager::AddTexture( texture );
 }
 
-std::string GenerateUrl( const Dali::FrameBuffer frameBuffer, const uint8_t index )
+std::string GenerateUrl( const Dali::FrameBuffer frameBuffer, uint8_t index )
 {
   Texture texture = Dali::DevelFrameBuffer::GetColorTexture( frameBuffer, index );
   return Dali::Toolkit::TextureManager::AddTexture( texture );
@@ -58,7 +58,7 @@ std::string GenerateUrl( const Dali::NativeImageSourcePtr nativeImageSource )
   return Dali::Toolkit::TextureManager::AddTexture( texture );
 }
 
-} // TextureManager
+} // Image
 
 } // Toolkit
 
index 7d27215..1cf2550 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DALI_TOOLKIT_DEVEL_API_IMAGE_MANAGER_H
-#define DALI_TOOLKIT_DEVEL_API_IMAGE_MANAGER_H
+#ifndef DALI_TOOLKIT_IMAGE_H
+#define DALI_TOOLKIT_IMAGE_H
 
 /*
  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
@@ -60,7 +60,7 @@ DALI_TOOLKIT_API std::string GenerateUrl( const Dali::FrameBuffer frameBuffer, P
  * @param[in] index the index of the attached color texture.
  * @return the Url string representing this frame buffer
  */
-DALI_TOOLKIT_API std::string GenerateUrl( const Dali::FrameBuffer frameBuffer, const uint8_t index );
+DALI_TOOLKIT_API std::string GenerateUrl( const Dali::FrameBuffer frameBuffer, uint8_t index );
 
 /**
  * @brief Generate a Url from Pixel data.
@@ -80,10 +80,10 @@ DALI_TOOLKIT_API std::string GenerateUrl( const Dali::PixelData pixelData );
  */
 DALI_TOOLKIT_API std::string GenerateUrl( const Dali::NativeImageSourcePtr nativeImageSource );
 
-} // ImageUtil
+} // Image
 
 } // Toolkit
 
 } // Dali
 
-#endif // DALI_TOOLKIT_DEVEL_API_IMAGE_MANAGER_H
+#endif // DALI_TOOLKIT_IMAGE_H