Merge "Lazy initialize ImageViews in KeyboardFocusManager & AccessibilityManager...
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 11 Aug 2016 16:33:07 +0000 (09:33 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 11 Aug 2016 16:33:07 +0000 (09:33 -0700)
dali-toolkit/internal/controls/slider/slider-impl.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/multi-language-support-impl.h

index de7e5c6..03883d2 100755 (executable)
@@ -317,9 +317,9 @@ Slider::Domain Slider::CalcDomain( const Vector2& currentSize )
 
 void Slider::DisplayValue( float value, bool raiseSignals )
 {
-  float clampledValue = Clamp( value, GetLowerBound(), GetUpperBound() );
+  float clampedValue = Clamp( value, GetLowerBound(), GetUpperBound() );
 
-  float percent = MapValuePercentage( clampledValue );
+  float percent = MapValuePercentage( clampedValue );
 
   float x = mDomain.from.x + percent * ( mDomain.to.x - mDomain.from.x );
 
@@ -335,7 +335,7 @@ void Slider::DisplayValue( float value, bool raiseSignals )
   if( raiseSignals )
   {
     Toolkit::Slider self = Toolkit::Slider::DownCast( Self() );
-    mValueChangedSignal.Emit( self, clampledValue );
+    mValueChangedSignal.Emit( self, clampedValue );
 
     int markIndex;
     if( MarkReached( percent, markIndex ) )
@@ -348,9 +348,13 @@ void Slider::DisplayValue( float value, bool raiseSignals )
   {
     std::stringstream ss;
     ss.precision( GetValuePrecision() );
-    ss << std::fixed << clampledValue;
+    ss << std::fixed << clampedValue;
 
-    mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() );
+    std::string label = mHandleValueTextLabel.GetProperty<std::string>( Toolkit::TextLabel::Property::TEXT );
+    if( label.compare(ss.str()) )
+    {
+      mHandleValueTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, ss.str() );
+    }
   }
 }
 
index 750fab7..ae9a68b 100644 (file)
@@ -67,27 +67,34 @@ FontId DefaultFonts::FindFont( TextAbstraction::FontClient& fontClient,
                                const TextAbstraction::FontDescription& description,
                                PointSize26Dot6 size ) const
 {
-  for( Vector<FontId>::ConstIterator it = mFonts.Begin(),
-         endIt = mFonts.End();
+  for( std::vector<CacheItem>::const_iterator it = mFonts.begin(),
+         endIt = mFonts.end();
        it != endIt;
        ++it )
   {
-    const FontId fontId = *it;
-    TextAbstraction::FontDescription fontDescription;
-    fontClient.GetDescription( fontId, fontDescription );
-
-    if( ( size == fontClient.GetPointSize( fontId ) ) &&
-        ( description.weight == fontDescription.weight ) &&
-        ( description.width == fontDescription.width ) &&
-        ( description.slant == fontDescription.slant ) )
+    const CacheItem& item = *it;
+
+    if( ( ( TextAbstraction::FontWeight::NONE == description.weight ) || ( description.weight == item.description.weight ) ) &&
+        ( ( TextAbstraction::FontWidth::NONE == description.width )   || ( description.width == item.description.width ) ) &&
+        ( ( TextAbstraction::FontSlant::NONE == description.slant )   || ( description.slant == item.description.slant ) ) &&
+        ( size == fontClient.GetPointSize( item.fontId ) ) &&
+        ( description.family.empty() || ( description.family == item.description.family ) ) )
     {
-      return fontId;
+      return item.fontId;
     }
   }
 
   return 0u;
 }
 
+void DefaultFonts::Cache( const TextAbstraction::FontDescription& description, FontId fontId )
+{
+  CacheItem item;
+  item.description = description;
+  item.fontId = fontId;
+  mFonts.push_back( item );
+}
+
 MultilanguageSupport::MultilanguageSupport()
 : mDefaultFontPerScriptCache(),
   mValidFontsPerScriptCache()
@@ -654,7 +661,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
                   *( defaultFontPerScriptCacheBuffer + script ) = defaultFontsPerScript;
                 }
               }
-              defaultFontsPerScript->mFonts.PushBack( fontId );
+              defaultFontsPerScript->Cache( currentFontDescription, fontId );
             }
           } // !isValidFont (3)
         } // !isValidFont (2)
index 3f568a2..afbeb23 100644 (file)
@@ -77,6 +77,12 @@ struct ValidateFontsPerScript
  */
 struct DefaultFonts
 {
+  struct CacheItem
+  {
+    TextAbstraction::FontDescription description;
+    FontId fontId ;
+  };
+
   /**
    * Default constructor.
    */
@@ -103,7 +109,9 @@ struct DefaultFonts
                    const TextAbstraction::FontDescription& description,
                    PointSize26Dot6 size ) const;
 
-  Vector<FontId> mFonts;
+  void Cache( const TextAbstraction::FontDescription& description, FontId fontId );
+
+  std::vector<CacheItem> mFonts;
 };
 
 /**