[dali_1.3.37] Merge branch 'devel/master' 53/187053/1
authorthothamon <jason.perry@partner.samsung.com>
Fri, 17 Aug 2018 11:16:42 +0000 (12:16 +0100)
committerthothamon <jason.perry@partner.samsung.com>
Fri, 17 Aug 2018 11:16:42 +0000 (12:16 +0100)
Change-Id: Ib0f8e3a29968b454dd611a13fbdd5c2dc0c03769

automated-tests/src/dali-toolkit-internal/utc-Dali-TextureManager.cpp
dali-toolkit/internal/controls/image-view/image-view-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/layouting/grid-impl.h
dali-toolkit/internal/layouting/grid-locations.h
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/texture-manager-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index af5f1a6..d72bf17 100644 (file)
@@ -72,3 +72,30 @@ int UtcTextureManagerRequestLoad(void)
 
   END_TEST;
 }
+
+int UtcTextureManagerGenerateHash(void)
+{
+  ToolkitTestApplication application;
+
+  TextureManager textureManager; // Create new texture manager
+
+  TestObserver observer;
+  std::string filename( "image.png" );
+  auto preMultiply = TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
+  TextureManager::TextureId textureId = textureManager.RequestLoad(
+    filename,
+    ImageDimensions(),
+    FittingMode::SCALE_TO_FILL,
+    SamplingMode::BOX_THEN_LINEAR,
+    TextureManager::USE_ATLAS,
+    &observer,
+    true,
+    TextureManager::ReloadPolicy::CACHED,
+    preMultiply);
+
+  VisualUrl url = textureManager.GetVisualUrl( textureId );
+
+  DALI_TEST_EQUALS( url.GetUrl().compare( filename ), 0, TEST_LOCATION );
+
+  END_TEST;
+}
index f709559..6725bfb 100755 (executable)
@@ -324,6 +324,7 @@ void ImageView::OnResourceReady( Toolkit::Control control )
 {
   // Visual ready so update visual attached to this ImageView, following call to RelayoutRequest will use this visual.
   mVisual = DevelControl::GetVisual( *this, Toolkit::ImageView::Property::IMAGE );
+  Toolkit::DevelControl::RequestLayout( *this );
 }
 
 ///////////////////////////////////////////////////////////
index a20808c..3555b3c 100644 (file)
@@ -673,9 +673,12 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
           // Show focus indicator
           mIsFocusIndicatorEnabled = 1;
         }
+        else
+        {
+          // Move the focus towards left
+          MoveFocus(Toolkit::Control::KeyboardFocus::LEFT);
+        }
 
-        // Move the focus towards left
-        MoveFocus(Toolkit::Control::KeyboardFocus::LEFT);
         isFocusStartableKey = true;
       }
       else
@@ -693,9 +696,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
           // Show focus indicator
           mIsFocusIndicatorEnabled = 1;
         }
-
-        // Move the focus towards right
-        MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT);
+        else
+        {
+          // Move the focus towards right
+          MoveFocus(Toolkit::Control::KeyboardFocus::RIGHT);
+        }
       }
       else
       {
@@ -712,9 +717,12 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
+      else
+      {
+        // Move the focus towards up
+        MoveFocus(Toolkit::Control::KeyboardFocus::UP);
+      }
 
-      // Move the focus towards up
-      MoveFocus(Toolkit::Control::KeyboardFocus::UP);
       isFocusStartableKey = true;
     }
     else if (keyName == "Down" && !isAccessibilityEnabled)
@@ -724,9 +732,12 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
+      else
+      {
+        // Move the focus towards down
+        MoveFocus(Toolkit::Control::KeyboardFocus::DOWN);
+      }
 
-      // Move the focus towards down
-      MoveFocus(Toolkit::Control::KeyboardFocus::DOWN);
       isFocusStartableKey = true;
     }
     else if (keyName == "Prior" && !isAccessibilityEnabled)
@@ -736,9 +747,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
-
-      // Move the focus towards the previous page
-      MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_UP);
+      else
+      {
+        // Move the focus towards the previous page
+        MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_UP);
+      }
 
       isFocusStartableKey = true;
     }
@@ -749,9 +762,11 @@ void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
         // Show focus indicator
         mIsFocusIndicatorEnabled = 1;
       }
-
-      // Move the focus towards the next page
-      MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_DOWN);
+      else
+      {
+        // Move the focus towards the next page
+        MoveFocus(Toolkit::Control::KeyboardFocus::PAGE_DOWN);
+      }
 
       isFocusStartableKey = true;
     }
index 6afb3f5..f21a9dd 100644 (file)
@@ -107,12 +107,8 @@ private:
   int mNumColumns;
   int mNumRows;
 
-  int mHorizontalSpacing = 0;
-  int mVerticalSpacing = 0;
-  int mRequestedHorizontalSpacing;
   int mRequestedColumnWidth;
   int mRequestedNumColumns;
-  int mRequestedNumRows;
 };
 
 } // namespace Internal
index f1f8b6e..2bc4359 100644 (file)
@@ -59,7 +59,6 @@ public:
     int xEnd;
     int yTop;
     int yBottom;
-    int explictlyDefined;
 
     Cell( int x1, int x2, int y1, int y2): xStart(x1), xEnd(x2), yTop(y1), yBottom(y2){};
   };
index faeeaec..2fb7e5d 100644 (file)
@@ -689,10 +689,7 @@ void ImageVisual::CreateRenderer( TextureSet& textureSet )
   //Register transform properties
   mImpl->mTransform.RegisterUniforms( mImpl->mRenderer, Direction::LEFT_TO_RIGHT );
 
-  if( IsPreMultipliedAlphaEnabled() )
-  {
-    EnablePreMultipliedAlpha( true );
-  }
+  EnablePreMultipliedAlpha( IsPreMultipliedAlphaEnabled() );
 }
 
 void ImageVisual::CreateNativeImageRenderer( NativeImage& nativeImage )
@@ -779,9 +776,9 @@ void ImageVisual::LoadTexture( bool& atlasing, Vector4& atlasRect, TextureSet& t
                                          mWrapModeV, textureObserver, atlasUploadObserver, atlasManager,
                                          mOrientationCorrection, forceReload, preMultiplyOnLoad);
 
-  if( textures && preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD)
+  if( textures )
   {
-    EnablePreMultipliedAlpha( true );
+    EnablePreMultipliedAlpha( preMultiplyOnLoad == TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD );
   }
 
   if( atlasing ) // Flag needs to be set before creating renderer
@@ -1087,10 +1084,8 @@ void ImageVisual::UploadComplete( bool loadingSuccess, int32_t textureId, Textur
       {
         mImpl->mRenderer.RegisterProperty( ATLAS_RECT_UNIFORM_NAME, mAtlasRect );
       }
-      else if( preMultiplied )
-      {
-        EnablePreMultipliedAlpha( true );
-      }
+
+      EnablePreMultipliedAlpha( preMultiplied );
 
       actor.AddRenderer( mImpl->mRenderer );
       // reset the weak handle so that the renderer only get added to actor once
index dcf734e..6ae1d8e 100755 (executable)
@@ -295,10 +295,7 @@ void NPatchVisual::LoadImages()
 
     mId = mLoader.Load( mImageUrl.GetUrl(), mBorder, preMultiplyOnLoad );
 
-    if( preMultiplyOnLoad )
-    {
-      EnablePreMultipliedAlpha( true );
-    }
+    EnablePreMultipliedAlpha( preMultiplyOnLoad );
   }
 
   if( ! mAuxiliaryPixelBuffer && mAuxiliaryUrl.IsValid() && mAuxiliaryUrl.IsLocalResource() )
index c617a51..1ea95a9 100644 (file)
@@ -932,8 +932,21 @@ TextureManager::TextureHash TextureManager::GenerateHash(
   {
     // We are not including sizing information, but we still need an extra byte for atlasing.
     hashTarget.resize( urlLength + 1u );
+
     // Add the atlasing to the hash input.
-    hashTarget[ urlLength ] = useAtlas;
+    switch( useAtlas )
+    {
+      case UseAtlas::NO_ATLAS:
+      {
+        hashTarget[ urlLength ] = 'f';
+        break;
+      }
+      case UseAtlas::USE_ATLAS:
+      {
+        hashTarget[ urlLength ] = 't';
+        break;
+      }
+    }
   }
 
   if( maskTextureId != INVALID_TEXTURE_ID )
index 7c62965..5fb5321 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 36;
+const unsigned int TOOLKIT_MICRO_VERSION = 37;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 1cafb29..313f705 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.3.36
+Version:    1.3.37
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT